-
Notifications
You must be signed in to change notification settings - Fork 522
[FEATURE]: Add Snap packaging support with Github workflow #1998
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
[FEATURE]: Add Snap packaging support with Github workflow #1998
Conversation
cfsmp3
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review: ✅ Approved
Comprehensive Snap packaging implementation with CI workflow.
Files Added:
.github/workflows/build_snap.yml- GitHub Actions workflowsnap/snapcraft.yaml- Snapcraft configurationsnap/local/run-ccextractor.sh- Runtime wrapper for library resolutiondocs/CHANGES.TXT- Changelog entry
Analysis:
- Uses core22 base with CMake build
- Properly bundles FFmpeg, GPAC, Tesseract and other dependencies
- Runtime wrapper ensures correct library resolution across distributions
- Workflow triggers on release publish and manual dispatch
- Well-documented and tested by author on Ubuntu 22.04 and 24.04
Note: Uses --classic confinement which requires Snap Store approval for public distribution.
Verdict: Ready to merge. Nice addition for Linux distribution!
cfsmp3
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Update: Changes Requested
I'm withdrawing my earlier approval after proper testing revealed a critical bug.
Issue Found
The snap builds and installs successfully, but subtitle extraction fails. The binary path is incorrectly passed as an input file:
# Expected (native build):
Input: /home/user/sample.ts
# Actual (snap):
Input: /snap/ccextractor/x1/usr/local/bin/ccextractor, /home/user/sample.ts
This causes ccextractor to try processing its own binary as a media file before the actual input.
Root Cause
In snapcraft.yaml:
apps:
ccextractor:
command: usr/local/bin/ccextractor # This becomes $1
command-chain:
- local/run-ccextractor.sh # Wrapper passes $@ including $1The wrapper script does:
exec "$SNAP/usr/local/bin/ccextractor" "$@"But $@ includes the command value as $1, so the binary path gets passed as an argument.
Suggested Fixes
Option 1: Remove the command: line entirely since the wrapper handles invocation:
apps:
ccextractor:
command-chain:
- local/run-ccextractor.shOption 2: Keep command: but fix the wrapper to skip it:
#!/bin/sh
set -e
# ... LD_LIBRARY_PATH setup ...
# Skip the first argument (the command itself) passed by snap
shift
exec "$SNAP/usr/local/bin/ccextractor" "$@"Test Commands Used
# Build
snapcraft
# Install
sudo snap install ./ccextractor_*.snap --classic --dangerous
# Test (fails - treats binary as input)
ccextractor /path/to/sample.ts -o output.srtPlease fix and I'll re-test.
|
@cfsmp3, Thanks for the thorough testing and for flagging this issue. I’ve updated the runtime wrapper to explicitly shift the first argument passed by Snap, as suggested in option 2, so the binary path is no longer forwarded as an input file. With this change, subtitle extraction works as expected. I rebuilt and installed the snap locally and verified it using: The input is now parsed correctly and the output is generated as expected. Please let me know if you’d like me to test additional cases or make any further adjustments. |
Build Issue:
|
|
@cfsmp3, Thanks for the review and the detailed feedback on the GPAC integration. I followed the suggested snap-part approach for GPAC, but wasn’t able to get a build in Before attempting
With these fixes in place, the CCExtractor build pipeline itself is stable and reproducible. I then attempted to satisfy the 1. Building
|
|
Update: As a follow-up, I also tried integrating GPAC 2.5 in the core22 Snap environment. I built GPAC from source in both static and shared configurations, including reduced/headless builds, and wired it into the Snap using staged artifacts and explicit include/library paths. GPAC itself builds successfully, but CCExtractor is still unable to consume it cleanly in core22. In practice, this shows up as missing installed headers (for example gpac/isomedia.h), or, n the case of static builds—linker failures related to X11/XCB dependencies. Addressing these would likely require fairly invasive build workarounds or maintaining a custom GPAC fork, which doesn’t feel like the right direction for Snap packaging. I wanted to updated that GPAC 2.5 was also tested. Please let me know how you’d like me to proceed. |
In raising this pull request, I confirm the following:
My familiarity with the project:
Summary
As proposed in #1583, this PR adds Snapcraft-based packaging for CCExtractor, along with a GitHub Actions workflow that builds the Snap and uploads the resulting
.snapartifact to GitHub Releases.Benefits:
Implementation Details
snap/snapcraft.yamlSnapcraft configuration using the existing CMake build system. Runtime dependencies (FFmpeg, GPAC, Tesseract, etc.) are bundled explicitly via
stage-packages.snap/local/run-ccextractor.shLightweight runtime wrapper that ensures bundled shared libraries are resolved from within the Snap at execution time, avoiding accidental linkage against host system libraries. While the Snap may work without this wrapper on some environments, it makes runtime behavior deterministic and consistent across distributions.
.github/workflows/build_snap.ymlGitHub Actions workflow completes successfully and produces a
.snappackage, which is published as a CI artifact (zipped by GitHub Actions).Testing
GitHub Actions workflow completes successfully and produces a
.snappackage (CI run artifact).Local runtime verification performed on:
sudo snap install ./ccextractor_*.snap --classic --dangerous ccextractor --version.snapartifact should be attached to GitHub Releases as well.