Snapcraft 7 silently ignores any files ending in *.snap when the source is a folder

Bug #1990166 reported by Isaac True
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Snapcraft
New
Undecided
Unassigned

Bug Description

Any files which end in *.snap are not copied to the part/x/src directory, as can be seen from this minimal example:

snapcraft.yaml:

name: my-snap-name
base: core22
version: '0.1'
summary: Single-line elevator pitch for your amazing snap
description: Test

grade: devel
confinement: devmode

parts:
  my-part:
    plugin: nil
    source: test
    override-build: |
      cp ${CRAFT_PART_SRC}/test.snap ${CRAFT_PART_INSTALL}/test.snap

---

Snapcraft output:

itrue@lxc-jammy:~/tmp/test-snap$ sudo snapcraft --verbose --destructive-mode
Starting Snapcraft 7.1.3
Logging execution to '/root/.cache/snapcraft/log/snapcraft-20220919-153058.032639.log'
Running on amd64 for amd64
Initializing parts lifecycle
Executing parts lifecycle...
Executing parts lifecycle: skip pull my-part (already ran)
Executing action
Executed: skip pull my-part (already ran)
Executing parts lifecycle: skip overlay my-part (already ran)
Executing action
Executed: skip overlay my-part (already ran)
Executing parts lifecycle: build my-part
Executing action
:: + cp /home/itrue/tmp/test-snap/parts/my-part/src/test.snap /home/itrue/tmp/test-snap/parts/my-part/install/test.snap
:: cp: cannot stat '/home/itrue/tmp/test-snap/parts/my-part/src/test.snap': No such file or directory
'override-build' in part 'my-part' failed with code 1.
Review the scriptlet and make sure it's correct.
Full execution log: '/root/.cache/snapcraft/log/snapcraft-20220919-153058.032639.log'

---

Source folder contents:

itrue@lxc-jammy:~/tmp/test-snap$ ls test
test.notasnap test.snap

---

parts src folder contents:

itrue@lxc-jammy:~/tmp/test-snap$ ls parts/my-part/src/
test.notasnap

---

Please either copy all files in the source directory, or at least add a warning to say that these files are not being copied, rather than silently not doing it.

Revision history for this message
Robert P. J. Day (rpjday) wrote :

Are there any other explicit omissions from the pull step we should be aware of?

Revision history for this message
Robert P. J. Day (rpjday) wrote :
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.