Files created in override-stage fail to get copied to prime

Bug #1917897 reported by Robie Basak
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Snapcraft
Triaged
Low
Claudio Matsuoka

Bug Description

In override-stage I put:

      override-stage: |
        snapcraftctl stage
        ln -s mawk usr/bin/awk

This failed to end up in prime/ and the symlink created was missing from the snap. This was an attempt to work around "stage-packages: [awk]" not putting an awk symlink into the snap. My full snapcraft.yaml if you need it is at: http://paste.ubuntu.com/p/jw3Vhhv8q5/

Expected behaviour: things I create in stage using override-stage ends up being copied to prime. Actual behaviour: things I create don't seem to get copied.

I don't know if this is intended behaviour or not, but the following documentation leads me to think that this should work:

https://snapcraft.io/docs/parts-lifecycle#heading--steps

"""
prime: copies the staged components into the priming area, to their final locations for the resulting snap. This is very similar to the stage step, but files go into the priming area instead of the staging area. The prime step exists because the staging area might still contain files that are required for the build but not for the snap. For example, if you have a part that downloads and installs a compiler, then you stage this part so other parts can use the compiler during building. You can then use the prime filter keyword to make sure that it doesn’t get copied to the priming area, so it’s not taking up space in the snap. Some extra checks are also run during this step to ensure that all dependencies are satisfied for a proper run time. If confinement was set to classic, then files will be scanned and, if needed, patched to work with this confinement mode.
"""

I infer that given I haven't applied a filter, everything in stage/ should end up combined into prime.

Revision history for this message
Robie Basak (racb) wrote :

Running on a Hirsute host, using --use-lxd --enable-experimental-package-repositories, building a classic snap, with:

installed: 4.5.1 (6050) 71MB classic

Revision history for this message
Sergio Schvezov (sergiusens) wrote :

We will add a mechanism for file registration into the part for new files added outside of the staging and priming area.

When migrating from stage to prime we will warn of any dangling files not belonging to any part.

Changed in snapcraft:
status: New → Triaged
importance: Undecided → Low
assignee: nobody → Claudio Matsuoka (cmatsuoka)
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.