stage-snaps not usable with branches
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snapcraft |
Fix Committed
|
Low
|
Michał Sawicz |
Bug Description
I’m trying to use a branch of a stage snap, but this either isn’t supported, or it doesn’t have the obvious syntax. I have:
mir-kiosk-x11:
plugin: nil
stage-snaps: [mir-kiosk-
But that fails with:
Failed to install or refresh a snap: ‘mir-kiosk-x11’ does not exist or is not available on the desired channel ‘edge/core18’. Use snap info mir-kiosk-x11 to get a list of channels the snap is available on.
On https:/
mir-kiosk-x11:
plugin: nil
stage-snaps: [mir-kiosk-
results in the same error.
However, both
snap install mir-kiosk-x11 --channel=
and
snap install mir-kiosk-x11 --channel=
work fine.
description: | updated |
Changed in snapcraft: | |
status: | New → Confirmed |
importance: | Undecided → Low |
assignee: | nobody → Sergio Schvezov (sergiusens) |
Changed in snapcraft: | |
assignee: | Sergio Schvezov (sergiusens) → Michał Sawicz (saviq) |
status: | Confirmed → In Progress |
Changed in snapcraft: | |
status: | In Progress → Fix Committed |
The problem occurs for Snaps listed under 'build-snaps', too.
I attached the full log file, called 'openjdk_ amd64.txt' , from my build on Launchpad.
Channel branches seemed a great way to publish the temporary "boot JDK," which is the previous version of the JDK used to build the current version. For example, I wanted to build JDK 13 using the temporary build of JDK 12 that I put on the channel 'latest/ stable/ jdk-12' as follows:
parts: /github. com/openjdk/ jdk13u. git PROJECT_ VERSION latest/ stable/ jdk-12
jdk:
plugin: autotools
source: https:/
source-branch: jdk-$SNAPCRAFT_
source-depth: 1
build-snaps:
- openjdk/
...
That build fails with:
"Failed to install or refresh a snap: 'openjdk' does not exist or is not available on the desired channel 'latest/ stable/ jdk-12' . Use `snap info openjdk` to get a list of channels the snap is available on."
Yet the package can be installed with the command:
$ sudo snap install --channel= latest/ stable/ jdk-12 openjdk
openjdk (stable/jdk-12) 12.0.2+10 from John Neffenger (jgneff) installed
It looks as if the Snapcraft code is first running the equivalent of the following command to check the store listing before trying to install the Snap:
$ sudo curl --unix-socket /run/snapd.socket "http:// localhost/ v2/find? name=openjdk& channel= latest/ stable/ jdk-12"
It doesn't find the branch name in the response, so it doesn't even attempt the installation.