← Back to issue list

snap build fails if go must download the version

View original Github issue

Metadata

Project
craft-parts
Number
#1447
Type
issue
State
open
Author
adombeck
Labels
Created
2026-02-05 12:54:37+00:00
Updated
2026-03-18 12:04:09+00:00
Closed

Current evaluation

No evaluation has been recorded for this issue yet.

Issue body

### Bug Description I see `snapcraft pack` fail with: ``` Environment validation failed for part 'semver': invalid go compiler version 'go: downloading go1.25.6 (linux/amd64)'. Failed to run snapcraft in instance ``` It works when I execute `snapcraft pack` again. I assume that's because the required Go version was then already downloaded on the instance. I took a quick look at the code where this error originates from. [This](https://github.com/canonical/craft-parts//blob/71291d50ec95aed813215e89463866dd09aaaa5e/craft_parts/plugins/go_plugin.py#L66-L71) is the call to `go version` which calls `subprocess.run` and [returns the stderr](https://github.com/canonical/craft-parts//blob/71291d50ec95aed813215e89463866dd09aaaa5e/craft_parts/plugins/validator.py#L145-L152) it it's non-empty, which it then assumes is the go version. It should use the output on stdout instead. ### To Reproduce I encounter this when trying to build the authd snaps: ```bash git clone https://github.com/canonical/authd cd authd # Prepare snapcraft.yaml ./scripts/prepare-broker-variant-files # Build the snap snapcraft pack ``` ### part yaml ```yaml semver: source: authd-oidc-brokers/tools source-type: local plugin: go override-build: | go mod download all go mod vendor go build -o ${GOBIN}/semver semver/semver.go ``` ### Relevant log output I assume the above is enough to understand the issue. Let me know if you do need logs.

Evaluation history

No evaluation history available.