Part's without `source` key has an implicit source `.`

Bug #1776807 reported by 林博仁(Buo-ren, Lin)
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Snapcraft
Fix Released
Critical
Sergio Schvezov

Bug Description

Consider this snapcraft parts recipe:

```yaml
  ccache:
    plugin: nil
    build-packages:
      - ccache
    override-build: 'true'
    override-stage: 'true'
    override-prime: 'true'
```

And according to the description of `snapcraft help nil`:

> The nil plugin is useful for parts with no source.

However after running `snapcraft pull ccahe`, non-snapcraft-generated files in the source tree are pulled into the part's sourcedir:

```
parts/ccache/src
├── guvcview-brlin_source.tar.bz2
├── guvcview.strace.log
├── icons
│ ├── guvcview256.png
│ └── guvcview.png
├── LICENSE
├── nohup.out
├── README.md
└── screenshots
    └── view-image-control.png

2 directories, 8 files
```

IMO the behavior is unexpected and should be a snapcraft bug.

## Workaround
Override the entire pull step using `override-pull` [scriptlets](https://forum.snapcraft.io/t/scriptlets/4892).

Revision history for this message
林博仁(Buo-ren, Lin) (buo-ren-lin) wrote :

Related Snapcraft Forum topic:
[Snapcraft implicit source - snapcraft - snapcraft.io](https://forum.snapcraft.io/t/snapcraft-implicit-source/7060)

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

If using a base, this will be the default behavior.
PR here https://github.com/snapcore/snapcraft/pull/2326

Changed in snapcraft:
status: New → In Progress
importance: Undecided → Critical
assignee: nobody → Sergio Schvezov (sergiusens)
milestone: none → 3.0
Changed in snapcraft:
status: In Progress → Fix Committed
Changed in snapcraft:
status: Fix Committed → Fix Released
summary: - `nil` plugin shouldn't pull anything to the srctree
+ part's without `source` key has an implicit source `.`
summary: - part's without `source` key has an implicit source `.`
+ Part's without `source` key has an implicit source `.`
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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