← Back to issue list

snapcraft fail to find built executable under prime $SNAP

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1795171
Type
issue
State
closed
Author
~eri0
Labels
Created
Updated
Closed

Current evaluation

⚠️ This summary may be outdated — the issue content or evaluation prompts have changed since this evaluation was made.

Closed without resolution or comments, likely abandoned. The issue reported a FileNotFoundError when Snapcraft failed to expand the $SNAP variable in the prime directory path during build.

Suggested action:

No scores available.

Issue body

Hey, I got the error below when trying build a snap. The binary is under /home/username/git/ags-snap/prime/bin/ags and $snap/bin/ags Priming ags Sorry, an error occurred in Snapcraft: Traceback (most recent call last): File "/usr/bin/snapcraft", line 9, in <module> load_entry_point('snapcraft==2.43.1', 'console_scripts', 'snapcraft')() File "/usr/lib/python3/dist-packages/click/core.py", line 716, in __call__ return self.main(*args, **kwargs) File "/usr/lib/python3/dist-packages/click/core.py", line 696, in main rv = self.invoke(ctx) File "/usr/lib/python3/dist-packages/click/core.py", line 1037, in invoke return Command.invoke(self, ctx) File "/usr/lib/python3/dist-packages/click/core.py", line 889, in invoke return ctx.invoke(self.callback, **ctx.params) File "/usr/lib/python3/dist-packages/click/core.py", line 534, in invoke return callback(*args, **kwargs) File "/usr/lib/python3/dist-packages/click/decorators.py", line 17, in new_func return f(get_current_context(), *args, **kwargs) File "/usr/lib/python3/dist-packages/snapcraft/cli/_runner.py", line 93, in run ctx.forward(lifecyclecli.commands["snap"]) File "/usr/lib/python3/dist-packages/click/core.py", line 552, in forward return self.invoke(cmd, **kwargs) File "/usr/lib/python3/dist-packages/click/core.py", line 534, in invoke return callback(*args, **kwargs) File "/usr/lib/python3/dist-packages/snapcraft/cli/lifecycle.py", line 136, in snap project = _execute(steps.PRIME, parts=[], **kwargs) File "/usr/lib/python3/dist-packages/snapcraft/cli/lifecycle.py", line 35, in _execute lifecycle.execute(step, project_config, parts) File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/_runner.py", line 90, in execute executor.run(step, part_names) File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/_runner.py", line 196, in run self._create_meta(step, processed_part_names) File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/_runner.py", line 359, in _create_meta self.config.validator.schema, File "/usr/lib/python3/dist-packages/snapcraft/internal/meta/_snap_packaging.py", line 109, in create_snap_packaging packaging.write_snap_yaml() File "/usr/lib/python3/dist-packages/snapcraft/internal/meta/_snap_packaging.py", line 312, in write_snap_yaml snap_yaml = self._compose_snap_yaml() File "/usr/lib/python3/dist-packages/snapcraft/internal/meta/_snap_packaging.py", line 468, in _compose_snap_yaml snap_yaml["apps"] = self._wrap_apps(self._config_data["apps"]) File "/usr/lib/python3/dist-packages/snapcraft/internal/meta/_snap_packaging.py", line 567, in _wrap_apps self._wrap_app(app, apps[app]) File "/usr/lib/python3/dist-packages/snapcraft/internal/meta/_snap_packaging.py", line 575, in _wrap_app app[k] = self._wrap_exe(app[k], "{}-{}".format(k, name)) File "/usr/lib/python3/dist-packages/snapcraft/internal/meta/_snap_packaging.py", line 546, in _wrap_exe with open(exepath, "rb") as exefile: FileNotFoundError: [Errno 2] No such file or directory: '/home/username/git/ags-snap/prime/$SNAP/bin/ags' We would appreciate it if you created a bug report at https://launchpad.net/snapcraft/+filebug with the above text included. The current yaml is on github, but the used one is the one attached to this bug report. https://github.com/ericoporto/ags-snap

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b Closed without resolution or comments, likely abandoned. The issue reported a FileNotFoundError when Snapcraft failed to expand the $SNAP variable in the prime directory path during build.
qwen/qwen3.6-35b-a3b Closed without resolution, likely abandoned due to inactivity. Snapcraft incorrectly treated the literal string $SNAP as a directory during the prime step, causing a FileNotFoundError when locating the built executable. No fixes or workarounds were submitted.
qwen3.6-35b-a3b-mtp-q6 Abandoned. Snapcraft incorrectly used the literal $SNAP string in the prime directory path when wrapping executables, triggering a FileNotFoundError. No fix or discussion was recorded.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#1812435 python snap fails to build no such file or directory in prime/bin snapcraft (launchpad) open Snapcraft 2.43.1 crashes with FileNotFoundError when an app's command is missing from prime/bin during snap packaging. Reported 2782 days ago with no comments, labels, or maintainer response. The legacy code path no longer exists in the current codebase.
79%
#1710254 snapcraft doesn't fail if the command exists in the host but not in the prime directory snapcraft (launchpad) closed Closed without resolution. Snapcraft incorrectly validates app commands against the host system rather than the prime directory during the prime step, leaving the bug unfixed.
76%
#1797378 Built executable is not copied to prime/bin/ snapcraft (launchpad) open Snapcraft 2.43.1+18.4 crashes during prime with FileNotFoundError when an app's command points to a file (prettier) that was not copied to prime/bin/; build/bin/ only contained prettier.js. Reported 8 years ago, no maintainer activity, 0 comments, unlabelled.
76%
#1884683 snapcraft fail app snapcraft (launchpad) open Snapcraft 2.43.1+18.4 crashes with FileNotFoundError when an app's command points to /bin/Sastreria, which is missing from the prime directory. No comments or labels; the affected 2.x version is long EOL and the code path no longer exists.
75%
#1838098 snapcraft prime fails if it finds an invalid ELF file snapcraft (launchpad) closed Closed without a fix. Snapcraft prime crashed on invalid ELF files due to an uncaught ELFError. With zero comments and no PR, the report was abandoned or superseded by newer versions handling malformed binaries gracefully.
75%
#1830520 Sorry, an error occurred in Snapcraft: snapcraft (launchpad) open Snapcraft 2.43.1 (2019) crashed with FileNotFoundError wrapping app command spx_service missing from the prime dir during a Launchpad build. No maintainer activity in 7+ years; the 2.x code path no longer exists and the root cause is user snapcraft.yaml config.
74%
#1752766 Snapcraft fails to prime part containg device files snapcraft (launchpad) closed Closed without a direct fix. Snapcraft crashes when priming parts with device files, throwing an OSError during ELF detection. The bug was likely abandoned or resolved in newer Snapcraft versions.
73%
#1627781 Snapcraft should use "prime" keyword instead of "snap" snapcraft (launchpad) closed Closed without resolution. Snapcraft 2.17's lack of support for the prime keyword was superseded by newer versions. No comments or fixes were applied.
73%
#1723965 snapcraft doesn't work snapcraft (launchpad) closed Closed without resolution or comments, indicating abandonment. The reported snap command failure and GL driver errors remain unresolved.
72%
#1794636 Error when building snap package in priming stage snapcraft (launchpad) closed The issue reported a FileNotFoundError during the priming stage of building a snap package. It was closed without a clear resolution, likely abandoned or superseded by newer versions.
72%