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

Bug #1710254 reported by Leo Arias
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

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

    command: hello

    plugin: nil

$ sudo snap install hello
$ snapcraft
--> snapcraft doesn't fail, but it should
$ sudo snap remove hello
$ snapcraft
--> snapcraft fails

Revision history for this message
Kyle Fazzari (kyrofa) wrote :

Ouch. Yeah we need to look at the path that being resolved and ensure it's actually in the snap.

Changed in snapcraft:
status: New → Triaged
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.