Files in path to snapcraft.yaml are excluded in source directive
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snapcraft |
New
|
Undecided
|
Unassigned |
Bug Description
Hi,
I have a potential bug when building a Snap where some files from my source directory are missing when I build the snap.
I have a project with a similar directory structure to the below where my snaps are in a subdirectory.
my-app/
├─ internal/
├─ snaps/
│ ├─ core20/
│ │ ├─ snapcraft.yaml
│ ├─ core22/
│ │ ├─ snapcraft.yaml
├─ src/
│ ├─ stuff.go
├─ .gitignore
├─ Makefile
In my snapcraft.yaml files I have a directive `source: ../..` and the problem I'm encountering is that when I build, specifically the core22 snap, all the files in snap/ are not present inside the folder `parts/
I noticed this because I use `git describe --tags --dirty` to get the version info for my snap but each build of the core22 snap was output a version with "-dirty" appended. Debugging the build I can see that all the files in snap/ are missing and git thinks the directory has been modified.
Testing Info:
I ran the build inside a lxd container with the command `sudo snapcraft --enable-manifest --destructive-mode`
I tested this with the following pairings:
Snapcraft 7.3.1 and Core22: Bug present
Snapcraft 7.3.1 and Core20: No issue
Snapcraft 4.8 and Core22: No issue