← Back to issue list

snapcraft doesn't fail if the command exists in the host but not in the prime directory

View original Launchpad issue

Metadata

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

Current evaluation

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.

Suggested action:

No scores available.

Issue body

During the prime step, snapcraft generates the command wrapper. If the command specified in the apps section of the snapcraft.yaml doesn't exist, snapcraft must fail. The problem here is that snapcraft is not only searching for the command inside the snap. If a command with the same name is installed in the host, snapcraft will not fail. To reproduce, use this snapcraft.yaml: name: dummy version: dummy summary: dummy description: dummy apps: test: command: hello parts: dummy: plugin: nil Run: $ sudo snap install hello $ snapcraft --> snapcraft doesn't fail, but it should $ sudo snap remove hello $ snapcraft --> snapcraft fails

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b 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.
qwen/qwen3.6-35b-a3b Bug report stating snapcraft incorrectly validates app commands during the prime step by checking the host system. The issue was closed with zero comments and no fix, indicating it was abandoned or marked stale.
qwen/qwen3.6-35b-a3b Abandoned. Snapcraft incorrectly succeeds during the prime step if a command exists on the host but not in the prime directory. No fix was applied.
qwen3.6-35b-a3b-mtp-q6 Closed without resolution. Snapcraft incorrectly validates command existence in the prime directory when a host command shares the same name. No fix was implemented.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#1795171 snapcraft fail to find built executable under prime $SNAP snapcraft (launchpad) closed 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.
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.
72%
#1862163 snapcraft breaks with python app snapcraft (launchpad) closed Closed without resolution. Snapcraft auto-generated invalid command paths starting with `/` for Python apps, causing snapd validation failures. No fix, discussion, or follow-up was provided.
71%
#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.
71%