Snapcraft go plugin install issues
Metadata
Current evaluation
Go 1.6 godoc builds targeted read-only GOROOT; Go 1.7 fixed the special case, and Snapcraft now directs Go binaries into the part install directory.
Suggested action: close resolved
Reason: The reporter confirmed that Go 1.7 routes godoc to GOPATH and that the reproducer succeeds. Snapcraft PR #859, commit e44e634f6, later set GOBIN in the Go build environment, and the current Go plugin still sets GOBIN to ${CRAFT_PART_INSTALL}/bin, providing the requested path isolation.
Evaluated by: mr-cal-bot
Impact:
28
Quick Win:
18
Complexity:
30
Confidence:
94
Actionability:
94
Issue body
Trying to snap godoc I run into this golang bug:
https://github.com/golang/go/issues/15106
Sample run:
$ snapcraft
Preparing to pull godoc
Pulling godoc
go get -t -d golang.org/x/tools/cmd/godoc
Preparing to build godoc
Building godoc
go install golang.org/x/tools/cmd/godoc
go install golang.org/x/tools/cmd/godoc: open /usr/lib/go-1.6/bin/godoc: permission denied
Command '['/bin/sh', '/tmp/tmpws7rhnp0', 'go', 'install', 'golang.org/x/tools/cmd/godoc']' returned non-zero exit status 1
(See attached snapcraft.yaml)
Basically godoc is special and go install tries to put it in $GOROOT/bin instead of $GOPATH/bin
Even when when this is fixed in golang, snapcraft should NOT allow to install into $GOROOT or give the user a way out, like building without installing or forcing installation path within the snap environment.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha |
Impact:
28
Quick Win:
18
Complexity:
30
Confidence:
94
Actionability:
94
|
close resolved | Go 1.6 godoc builds targeted read-only GOROOT; Go 1.7 fixed the special case, and Snapcraft now directs Go binaries into the part install directory. | |
| stealth/space-bunny-alpha |
Impact:
30
Quick Win:
23
Complexity:
15
Confidence:
97
Actionability:
90
|
close resolved | Snapcraft's Go plugin previously let `go install` target `$GOROOT`, breaking godoc builds; setting `GOBIN` and Go 1.7's routing fix resolved the reported failure. | |
| qwen/qwen3.6-35b-a3b |
Impact:
20
Quick Win:
4
Complexity:
40
Confidence:
60
Actionability:
30
|
close stale | Snapcraft Go plugin fails when go install writes to $GOROOT/bin instead of $GOPATH/bin (godoc edge case). Issue references golang/go#15106. No maintainer engagement in 10 years. | |
| qwen/qwen3.8-27b |
Impact:
30
Quick Win:
14
Staleness:
95
Complexity:
55
Confidence:
60
Support Request:
20
|
needs triage | Snapcraft's go plugin fails to build godoc because go install writes to $GOROOT/bin (permission denied), a known golang bug; reporter also asks snapcraft to prevent installs into $GOROOT or force install path inside the snap. No labels, no comments, no maintainer activity in ~10 years. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
98
Complexity:
35
Confidence:
90
Support Request:
20
|
close stale | Report of Snapcraft Go plugin failing to install godoc due to Go 1.6 writing to GOROOT/bin. Issue is over 10 years old with no maintainer interaction. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
98
Complexity:
30
Confidence:
90
Support Request:
20
|
close stale | Reports a Go plugin permission error when building godoc due to go install targeting $GOROOT/bin. Unlabeled, no maintainer comments, inactive for over a decade. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
98
Complexity:
20
Confidence:
90
Support Request:
30
|
close stale | Reports a permission denied error when snapcraft's go plugin runs go install for godoc, attempting to write to $GOROOT/bin. Issue is nearly 10 years old with no maintainer interaction or labels. |
Update history
| Date | Change |
|---|---|
| created |
Related work
-
Caused By:
go#15106
(confidence 100%)
Go 1.6 special-cased godoc installation and targeted GOROOT rather than the user-selected binary directory.
-
Likely Fixed By:
canonical/snapcraft#859
(confidence 96%)
Merged PR that set GOBIN in the Go plugin build environment.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1537728 go plugin: GOROOT env confuses snapcraft go | snapcraft (launchpad) | closed | Resolved in Snapcraft 3.x by isolated build environments that prevent host GOROOT from leaking into Go plugin builds. | |
| #1748202 go plugin doesn't honor godeps file | snapcraft (launchpad) | closed | Closed after a maintainer explained that Snapcraft's dedicated godeps plugin must be used; the go plugin does not consume versions from a Godeps file. |