Hey,
Refering to the original revision of your post before you used the for-loop, the problem will have been specifying snap/local
as the path. The current working directory changes for each build stage, so you’ll have been implicitly trying to find $CRAFT_PART_SRC/snap
rather than $CRAFT_PROJECT_DIR/snap
, which is why the for-loop works but the singular line didn’t.
Regarding the packing error, try running snapcraft with:
snapcraft --debug
This will drop you into the VM/LXD shell the snap is built in and allow you to inspect the filesystem. For LXD, stuff is usually kept in /root/parts
, e.g, /root/parts/gnuclad/src
or /root/parts/gnuclad/build
etc; but in your snapcraft.yaml
you should always refer to these with the environment variables because they can move around across bases and implementations!
In any case, in the shell that’ll open from snapcraft --debug
, try doing
ls /root/prime
Is there anything in it? There should be everything your app has built and all the stages packages. If your command
is e.g bin/gnuclad
, then there should be /root/prime/bin/gnuclad
, if not, you’ll need to either change the command
to point to where the binary is (relative to the $SNAP variable at runtime, so don’t put /root/prime
!), or determine why the binary doesn’t exist.
If you can’t find the binary in /root/prime
, try:
ls /root/parts/gnuclad/install
Is there anything in there? If not, try
ls /root/parts/gnuclad/build
Is there anything in there? (Hopefully!).
Ideally the build artefacts/binaries end up in install
, which then propogates to the final /root/prime
. However in some cases you might find certain build environments will place the final artefacts in build
and not install
, so they don’t propogate through to the final result.
Unfortunately I’m writing these paths based on memory so they might be slightly incorrect, but in summary:
- Check if the
command
value points to the right binary
- Check the binary exists in prime
- If it doesn’t, check if it exists in the install folder
- If it doesn’t, check if it exists in the build folder
But ultimately I reckon your command
is command: gnuclad
and probably needs to be command: bin/gnuclad
or command: usr/bin/gnuclad