← Back to issue list

docs: golang plugin doc missing information on cross-compiling

View original Github issue

Metadata

Project
snapcraft
Number
#5931
Type
issue
State
open
Author
sed-i
Labels
Created
Updated
Closed

Current evaluation

Go plugin docs omit cross-compilation; reporter shows cross-compile fails because the plugin sets GOBIN (go install error), and clearing GOBIN triggers a missing install-dir error. Untriaged, no labels or maintainer response in ~255 days.

Suggested action: needs triage

Reason: The issue has no labels, no comments, and no maintainer response in ~255 days, so it has not been triaged. The underlying problem still exists — craft-parts' go_plugin.py unconditionally sets GOBIN and runs `go install ./...`, which fails on cross-compiles — so it remains relevant rather than stale. The old snapcraft go-plugin cross-compile PRs (#1338, #1343) targeted the pre-craft-parts plugin and do not resolve this.

Impact: 35 Quick Win: 22.75 Staleness: 70 Complexity: 35 Confidence: 70 Support Request: 45

Issue body

*Please describe the question or issue you're facing with "Go plugin - Snapcraft 8.13.2 documentation".* The "Environment variables" section states that: > During build, this plugin sets `GOBIN` to `${CRAFT_PART_INSTALL}/bin`. However, when I try to cross-compile on amd64, snapcraft pack errors out with: ``` Detailed information: :: + go mod download all :: + go install -p 8 ./... :: go: cannot install cross-compiled binaries when GOBIN is set Recommended resolution: Check the build output and verify the project can work with the 'go' plugin. ``` But when I clear it, ```yaml build-environment: - GOBIN: "" ``` then `pack` fails with: ``` FileNotFoundError: [Errno 2] No such file or directory: '/root/parts/<snap name>/install/usr' ``` --- *Reported from: https://documentation.ubuntu.com/snapcraft/8.13.2/common/craft-parts/reference/plugins/go_plugin/*

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 35
Quick Win: 22.75
Staleness: 70
Complexity: 35
Confidence: 70
Support Request: 45
needs triage Go plugin docs omit cross-compilation; reporter shows cross-compile fails because the plugin sets GOBIN (go install error), and clearing GOBIN triggers a missing install-dir error. Untriaged, no labels or maintainer response in ~255 days.
qwen/qwen3.6-35b-a3b
Staleness: 75
Complexity: 45
Confidence: 85
Support Request: 60
needs triage Snapcraft Go plugin documentation lacks cross-compilation guidance. Setting GOBIN causes go install failures during cross-compilation, while clearing it triggers a missing directory error. Untriaged with no maintainer response after 215 days.
qwen3.6-35b-a3b-mtp-q6
Staleness: 70
Complexity: 20
Confidence: 75
Support Request: 30
needs triage Documentation for the Snapcraft Go plugin lacks guidance on handling cross-compilation. Setting GOBIN causes build errors, while clearing it causes missing directory errors. Issue remains untriaged with no maintainer response after 201 days.
qwen3.6-35b-a3b-mtp-q6
Staleness: 65
Complexity: 35
Confidence: 75
Support Request: 20
needs triage Snapcraft Go plugin cross-compilation fails due to GOBIN environment variable conflicts. Clearing it triggers a missing directory error. Documentation lacks cross-compilation guidance. Open, unassigned, and untriaged for 179 days.

Update history

No update history recorded yet.

Related work

  • Related To: snapcraft#1338 (confidence 60%)

    Original cross-compilation support for the old snapcraft go plugin; the current craft-parts go plugin lacks this.

  • Related To: snapcraft#1343 (confidence 60%)

    CGo cross-compilation for the old go plugin; related historical effort, not applicable to the craft-parts plugin.

Related issues

Issue Project State Summary Similarity
#1343 go plugin: Cross compile with CGo snapcraft merged Merged to enable cross-compilation for Go plugins when CGo is enabled. Approved by one reviewer, the change updates seven files with 83 additions and 7 deletions to correctly handle CGo flags during cross builds.
74%
#1253 go plugin: cross-compilation support snapcraft closed Superseded. The author split the changes into four smaller pull requests: go plugin cross-compilation support, CGo cross-compilation, multi-arch build dependencies, and foreign arch setup.
72%