snaps key doesn't allow to specify which channel to use for a snap
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lpci |
Fix Released
|
Low
|
Simone Pelosi |
Bug Description
Some snaps are not available in latest/stable - as such, when trying to use such a snap via the snaps key in .launchpad.yaml the job will fail with something like:
Running `snap install black`
lpcraft internal error: SnapInstallatio
In this case, if it was possible to specify the channel to use for the snap, ie say 22/stable then it would install correctly.
For a more complete example of this failure, see https:/
Also I notice this runs snap install with --classic even though in this case the snap in question does not use classic confinement. Ideally a snap would only be installed with --classic if it actually declared "confinement: classic"
Related branches
- Jürgen Gmach: Approve
-
Diff: 627 lines (+484/-11)7 files modifiedNEWS.rst (+6/-0)
docs/configuration.rst (+21/-0)
lpcraft/commands/run.py (+9/-4)
lpcraft/commands/tests/test_run.py (+379/-2)
lpcraft/config.py (+58/-1)
lpcraft/plugin/lib.py (+2/-2)
lpcraft/tests/test_config.py (+9/-2)
Changed in lpcraft: | |
assignee: | nobody → Simone Pelosi (pelpsi) |
Changed in lpci: | |
status: | Triaged → Fix Released |
Hey Alex,
thanks for your report.
Indeed, both the channel and the classic option are currently hardcoded as there was no need for configuration yet, also see https:/ /git.launchpad. net/lpcraft/ tree/lpcraft/ commands/ run.py# n477
The upstream library we use supports both options, so this should be a straightforward enhancement for lpcraft.
I saw you install the Snap manually as a workaround, so I think this is a reasonable, but not an urgent task.
I have two additional suggestions: /pre-commit. com/ to install, run and manage all linters. In case you are interested to learn more about the many advantages of pre-commit, we can sit down together next week in Prague.
- As our colleague Sergio is the maintainer of the Black snap, it could make sense to ask him to create a `latest/stable` channel for Black.
- I was curious why you want to install Black as a Snap, so I cloned your repository and had a look, and I saw that you use a Makefile. This seems to be widely used for developing Python packages at Canonical, but rarely seen elsewhere. Since a couple of years most projects have adopted https:/
That said... enhancing the build experience is on our next roadmap, so we should be able to allocate some time for this issue.
Jürgen Gmach
Launchpad team