Merge lp://qastaging/~mterry/snapcraft/lifecycle-fixes into lp://qastaging/~snappy-dev/snapcraft/core
Status: | Merged |
---|---|
Approved by: | Ricardo Salveti |
Approved revision: | 74 |
Merged at revision: | 72 |
Proposed branch: | lp://qastaging/~mterry/snapcraft/lifecycle-fixes |
Merge into: | lp://qastaging/~snappy-dev/snapcraft/core |
Diff against target: |
556 lines (+186/-123) 13 files modified
bin/snapcraft (+1/-1) runtests.sh (+2/-0) snapcraft/__init__.py (+12/-21) snapcraft/cmds.py (+3/-3) snapcraft/plugin.py (+67/-21) snapcraft/plugins/autotools_project.py (+4/-7) snapcraft/plugins/go14.py (+14/-17) snapcraft/plugins/go14_project.py (+10/-18) snapcraft/plugins/make_project.py (+2/-7) snapcraft/plugins/tgz_content.py (+5/-6) snapcraft/plugins/ubuntu.py (+10/-12) snapcraft/yaml.py (+6/-6) tests/unit/test_plugin.py (+50/-4) |
To merge this branch: | bzr merge lp://qastaging/~mterry/snapcraft/lifecycle-fixes |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ricardo Salveti (community) | Approve | ||
Michael Vogt (community) | Approve | ||
Review via email: mp+264155@code.qastaging.launchpad.net |
Commit message
Clean up part lifecycle logic a bit.
- Drop stage() and snap() calls from plugins. The core code now handles those. Plugins do get a new snapFiles() call that allows them to specify whitelist and blacklist globs. (To be expanded in the future by letting the user blacklist more files from yaml.)
- Add new parts/XXX/install directory. This is a sort of staging area for the staging area. It's useful in three ways: (1) We can detect two parts trying to install the same file into staging (though this isn't implemented yet); (2) We can restrict the whitelist globs from a part to only match the filenames that are in install/ (since otherwise it could match files from other parts in the combined staging area); (3) And we can build other parts against only the parts that they specify (using after/requires) rather than any part that happened to get installed into staging. These changes leave staging as just a play area for the user (to either edit or build their own code against).
- Unify existing plugin code a bit to use the same directories. All source code in src/, all binary code in build/ (even downloaded binary code), and all installed code in install/.
And I did some minor unrelated cleanup is also in this branch for convenience:
- When running locally, prepend (rather than append) our local snapcraft python module, so that any installed version doesn't get picked up instead.
- Allow skipping the plainbox tests via environment variable in runtests.sh
Description of the change
Clean up part lifecycle logic a bit.
- Drop stage() and snap() calls from plugins. The core code now handles those. Plugins do get a new snapFiles() call that allows them to specify whitelist and blacklist globs. (To be expanded in the future by letting the user blacklist more files from yaml.)
- Add new parts/XXX/install directory. This is a sort of staging area for the staging area. It's useful in three ways: (1) We can detect two parts trying to install the same file into staging (though this isn't implemented yet); (2) We can restrict the whitelist globs from a part to only match the filenames that are in install/ (since otherwise it could match files from other parts in the combined staging area); (3) And we can build other parts against only the parts that they specify (using after/requires) rather than any part that happened to get installed into staging. These changes leave staging as just a play area for the user (to either edit or build their own code against).
- Unify existing plugin code a bit to use the same directories. All source code in src/, all binary code in build/ (even downloaded binary code), and all installed code in install/.
And I did some minor unrelated cleanup is also in this branch for convenience:
- When running locally, prepend (rather than append) our local snapcraft python module, so that any installed version doesn't get picked up instead.
- Allow skipping the plainbox tests via environment variable in runtests.sh
This is part1. I'll probably do a second part2 branch to clean up some details around the install/ directory (notably, building parts only against other parts' install/ directories and detecting staging collisions).
Nice, I like that branch a lot. I have some comments inside, but nothing important so feel free to ignore (or not, as you want).