← 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

Launchpad #1795171: crash was user error — app command used literal $SNAP/bin/ags. Maintainer @ogra gave the correct YAML (command: bin/ags), reporter confirmed; report later expired for 60 days inactivity.

Resolution: closed not a bug

Reason: No code change was made: maintainer @ogra explained that apps command paths are relative to $SNAP and supplied the corrected snippet ('command: bin/ags'), which the reporter confirmed worked. The bug was then auto-closed by ~janitor on 2018-12-02 with '[Expired for Snapcraft because there has been no activity for 60 days.]'.

Evaluated by: mr-cal-bot

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
stealth/space-bunny-alpha — closed not a bug Launchpad #1795171: crash was user error — app command used literal $SNAP/bin/ags. Maintainer @ogra gave the correct YAML (command: bin/ags), reporter confirmed; report later expired for 60 days inactivity.
stealth/space-bunny-alpha — closed not a bug Snapcraft 2.43.1 crashed priming because an app command of "$SNAP/bin/ags" is not expanded and is looked up literally. Maintainer @ogra supplied the correct snippet (command: bin/ags); reporter confirmed, then the report expired in Dec 2018.
stealth/space-bunny-alpha — closed stale Closed without a recorded fix or explanation after Snapcraft 2.43.1 failed to resolve prime/$SNAP/bin/ags while priming the app executable.
qwen/qwen3.6-35b-a3b — — Closed without resolution, likely abandoned. Snapcraft failed to resolve the $SNAP environment variable in the prime directory path, causing a FileNotFoundError during packaging.
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

Date Change
created

Related work

  • Related To: snapcraft (launchpad)#1812435 (confidence 45%)

    Later Launchpad report of the same class of 'missing prime/bin executable' symptom in Snapcraft 2.43.1, likewise resolved by correcting the apps command path rather than a snapcraft fix.

Related issues

Issue Project State Summary Similarity
#1884683 snapcraft fail app snapcraft (launchpad) open Snapcraft 2.43.1 crashed on missing executable /bin/Sastreria; newer code added invalid-command handling, and the maintainer says the Snapcraft snap fixes it, but no retest was posted.
73%
#1812435 python snap fails to build no such file or directory in prime/bin snapcraft (launchpad) open Snapcraft 2.43.1 fails while priming because apps.command references a missing prime/bin/mockpyairpulse; the supplied YAML lacks evidence about the source package's entry point.
73%
#1794636 Error when building snap package in priming stage snapcraft (launchpad) closed User error: the app's `command:` binary was never installed into prime/, causing FileNotFoundError in _wrap_exe. Reporter copied the built folder/file into prime/ themselves; no Snapcraft fix.
72%
#1875872 snapcraft crashes whenever I try to run it snapcraft (launchpad) closed Closed after the apt-installed Snapcraft package failed; the reporter was directed to remove it and use `snap install snapcraft` instead.
71%
#1797378 Built executable is not copied to prime/bin/ snapcraft (launchpad) open Snapcraft 2.43.1 fails on missing prime/bin/prettier although build/bin contains only prettier.js. The report suggests a command/config mismatch, but lacks project files or maintainer triage.
71%