go plugin: GOROOT env confuses snapcraft go
Metadata
Current evaluation
Resolved in Snapcraft 3.x by isolated build environments that prevent host GOROOT from leaking into Go plugin builds.
Resolution: closed resolved
Reason: A maintainer closed the issue after confirming that Snapcraft 3.x handles GOROOT through its build environments. Earlier fix ubuntu-core/snapcraft#269 was explicitly deemed unsatisfactory.
Evaluated by: mr-cal-bot
No scores available.
Issue body
i dont think GOROOT or alike should cause side effects for go plugin projects that use their own downloaded go runtime etc. and have their own workspace to build the code...
asac@bigos:/tmp/snapcraft/examples/gopaste$ export GOROOT=/home/asac/non-existant
asac@bigos:/tmp/snapcraft/examples/gopaste$ ../../bin/snapcraft build
Pulling gopaste
From https://github.com/wisnij/gopaste
* branch HEAD -> FETCH_HEAD
Already up-to-date.
env GOPATH=/tmp/snapcraft/examples/gopaste/parts/gopaste/go go get -t -d ./gopaste.git/...
go: cannot find GOROOT directory: /home/asac/non-existant
Command '['/bin/sh', '/tmp/tmpvnr6ul5r', 'env', 'GOPATH=/tmp/snapcraft/examples/gopaste/parts/gopaste/go', 'go', 'get', '-t', '-d', './gopaste.git/...']' returned non-zero exit status 2
Also if path exist it still causes troubles:
asac@bigos:/tmp/snapcraft/examples/gopaste$ export GOROOT=/home/asac/go/
asac@bigos:/tmp/snapcraft/examples/gopaste$ ../../bin/snapcraft build
Pulling gopaste
From https://github.com/wisnij/gopaste
* branch HEAD -> FETCH_HEAD
Already up-to-date.
env GOPATH=/tmp/snapcraft/examples/gopaste/parts/gopaste/go go get -t -d ./gopaste.git/...
package bytes: unrecognized import path "bytes" (import path does not begin with hostname)
package database/sql: unrecognized import path "database/sql" (import path does not begin with hostname)
package flag: unrecognized import path "flag" (import path does not begin with hostname)
package fmt: unrecognized import path "fmt" (import path does not begin with hostname)
package math: unrecognized import path "math" (import path does not begin with hostname)
package reflect: unrecognized import path "reflect" (import path does not begin with hostname)
package sort: unrecognized import path "sort" (import path does not begin with hostname)
package strings: unrecognized import path "strings" (import path does not begin with hostname)
package sync: unrecognized import path "sync" (import path does not begin with hostname)
package database/sql/driver: unrecognized import path "database/sql/driver" (import path does not begin with hostname)
package errors: unrecognized import path "errors" (import path does not begin with hostname)
package io: unrecognized import path "io" (import path does not begin with hostname)
package net/url: unrecognized import path "net/url" (import path does not begin with hostname)
package runtime: unrecognized import path "runtime" (import path does not begin with hostname)
package strconv: unrecognized import path "strconv" (import path does not begin with hostname)
package time: unrecognized import path "time" (import path does not begin with hostname)
package unsafe: unrecognized import path "unsafe" (import path does not begin with hostname)
package html/template: unrecognized import path "html/template" (import path does not begin with hostname)
package log: unrecognized import path "log" (import path does not begin with hostname)
package math/rand: unrecognized import path "math/rand" (import path does not begin with hostname)
package net/http: unrecognized import path "net/http" (import path does not begin with hostname)
package os: unrecognized import path "os" (import path does not begin with hostname)
package path/filepath: unrecognized import path "path/filepath" (import path does not begin with hostname)
package regexp: unrecognized import path "regexp" (import path does not begin with hostname)
Command '['/bin/sh', '/tmp/tmptkwztlze', 'env', 'GOPATH=/tmp/snapcraft/examples/gopaste/parts/gopaste/go', 'go', 'get', '-t', '-d', './gopaste.git/...']' returned non-zero exit status 1
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Resolved in Snapcraft 3.x by isolated build environments that prevent host GOROOT from leaking into Go plugin builds. | |
| stealth/space-bunny-alpha | — | closed resolved | Resolved in Snapcraft 3.x through isolated build environments that prevent host GOROOT from affecting Go plugin builds. | |
| stealth/space-bunny-alpha | — | closed stale | GOROOT interference in Go plugin builds was closed unresolved; Launchpad bug 1537728 records no fix, and no resolving commit was found. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without resolution. Setting GOROOT breaks the go plugin, causing build failures for projects using isolated Go runtimes. The issue was abandoned with no fix implemented. | |
| qwen/qwen3.6-35b-a3b | — | — | Setting GOROOT breaks the snapcraft go plugin build. The report was closed without resolution, indicating it was abandoned. |
Update history
| Date | Change |
|---|---|
| created |
Related work
-
Related To:
ubuntu-core/snapcraft#269
(confidence 100%)
Initial attempted fix was linked, but the maintainer said it did not provide a satisfactory solution.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1612741 Snapcraft go plugin install issues | snapcraft (launchpad) | open | 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. | |
| #1553215 Some go env variable makes snapcraft build failing | snapcraft (launchpad) | closed | Fixed by merged canonical/snapcraft#859 (commit e44e634f6), which set GOBIN in the Go plugin build environment so binaries install within Snapcraft parts. | |
| #1590108 Go plugin breaks with snapcraft.yaml in tree | snapcraft (launchpad) | closed | Fixed by hard-linking local sources instead of symlinking them, preventing recursive GOPATH traversal; merged in snapcore/snapcraft#622 (commit a07fa0faa). |