Closed gruyaume closed 1 year ago
Thanks for the report! I was able to reproduce this, and I believe the issue is with the pebble
"implicit part" that we add in every rockcraft part. It uses go/1.19/stable
and it looks like we install all build-snaps for all parts in one step. If I repackage rockcraft without the pebble part I get the expected behavior:
Executing parts lifecycle: build golang
Executing action
:: + set -x
:: + go version
:: go version go1.13.15 linux/amd64
:: + craftctl default
:: + go version
:: go version go1.13.15 linux/amd64
I don't know a straightforward fix for this, I suppose it would happen in any situation where different parts define different versions of the same snap in their build-snaps
. Maybe we could do the switch/refresh step for every snap that a part declares, in their build "preamble"?
Alternatively, for go
specifically, a "workaround" might be to lower the version that we use to build the pebble
part. It looks like the minimum version is 1.14
so it still wouldn't help us in this specific case.
this was fixed with #144
Description
Using the
go
build-snap doesn't allow for using the specified go version. The go version installed is always 1.19.Example
rockcraft.yaml:
Execution output:
Workaround
Add snap commands as an override-build that will switch the go version