Skip to content

docs: golang plugin doc missing information on cross-compiling #5931

@sed-i

Description

@sed-i

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,

    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/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions