snapcraft.yaml needs to make all stages dirty (was: the can't add file without recreating entire package)

Bug #1477904 reported by Olli Ries
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Snapcraft
Fix Released
Wishlist
Kyle Fazzari

Bug Description

I am running snapcraft assemble (qml plugin) on ted's branch lp:~ted/+junk/digitalsign

while iterating over the package, I added 1 new file in ./pic.jpg and edited snapcraft.yaml accordingly:
parts:
  qml:
    plugin: qml
  digitalsign:
    plugin: copy
    mkdirs:
      - bin
    files:
      digitalsign: bin/digitalsign
      digitalsign.qml: digitalsign.qml
      pic.jpg: pic.jpg
snappy-metadata: meta

rerunning snapcraft assemble will not pull in the new file, as it's skipping the build stage:

olli@joe-XPS-12-9Q33:~/code/snappy/digitalsign$ ../../qml/bin/snapcraft assemble
Skipping pull digitalsign (already ran)
Skipping build digitalsign (already ran)
Skipping stage digitalsign (already ran)
Snapping digitalsign
...

upon deleting ./snap/ ./parts/ ./stage/ the file is being pulled in:
...
Building digitalsign
cp --preserve=all -R digitalsign /home/olli/code/snappy/digitalsign/parts/digitalsign/install/bin/digitalsign
cp --preserve=all -R digitalsign.qml /home/olli/code/snappy/digitalsign/parts/digitalsign/install/digitalsign.qml
cp --preserve=all -R pic.jpg /home/olli/code/snappy/digitalsign/parts/digitalsign/install/pic.jpg
...

while not critical (workaround: delete files, start over) it's imho a bad experience as it can be expected that developers will iterate over the package quite frequently, rebuilding is taking longer time and thus not desirable

Tags: first-steps
Revision history for this message
Michael Vogt (mvo) wrote :

It appears that snapcraft was not realizing that it needs to rebuild everything when the snapcraft.yaml file changes. I.e. if the file changes we need to "dirty" all previous stages and run the equivalent of "--force" internally.

Changed in snapcraft:
importance: Undecided → High
status: New → Confirmed
summary: - can't add file without recreating entire package
+ snapcraft.yaml needs to make all stages dirty (was: the can't add file
+ without recreating entire package)
tags: added: first-steps
Changed in snapcraft:
milestone: none → 0.4
Changed in snapcraft:
milestone: 0.4 → none
Revision history for this message
Leo Arias (elopio) wrote :
Changed in snapcraft:
status: Confirmed → Invalid
Changed in snapcraft:
status: Invalid → Triaged
Changed in snapcraft:
milestone: none → 2.2
Changed in snapcraft:
importance: High → Wishlist
Changed in snapcraft:
milestone: 2.2 → none
Changed in snapcraft:
milestone: none → next
Changed in snapcraft:
milestone: 2.3 → next
Kyle Fazzari (kyrofa)
Changed in snapcraft:
status: Triaged → In Progress
assignee: nobody → Kyle Fazzari (kyrofa)
Changed in snapcraft:
milestone: 2.4 → next
Changed in snapcraft:
milestone: next → none
Changed in snapcraft:
milestone: none → 2.7
Changed in snapcraft:
milestone: 2.7 → none
Changed in snapcraft:
milestone: none → 2.8
Revision history for this message
Sergio Schvezov (sergiusens) wrote :
Changed in snapcraft:
status: In Progress → Fix Committed
status: Fix Committed → In Progress
Revision history for this message
Kyle Fazzari (kyrofa) wrote :

More progress (making the strip step dirty): https://github.com/ubuntu-core/snapcraft/pull/442

Revision history for this message
Kyle Fazzari (kyrofa) wrote :

More progress (making the stage step dirty): https://github.com/ubuntu-core/snapcraft/pull/443

Revision history for this message
Kyle Fazzari (kyrofa) wrote :

More progress (making the build step dirty): https://github.com/ubuntu-core/snapcraft/pull/447

Revision history for this message
Kyle Fazzari (kyrofa) wrote :

Last bit of progress (making the pull step dirty): https://github.com/ubuntu-core/snapcraft/pull/448

Kyle Fazzari (kyrofa)
Changed in snapcraft:
status: In Progress → Fix Committed
Changed in snapcraft:
status: Fix Committed → Fix Released
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.