← Back to issue list

go v1 plugin: go.mod support for 1.11 and 1.12

View original Github issue

Metadata

Project
snapcraft
Number
#3133
Type
pull request
State
merged
Author
sergiusens
Labels
Created
Updated
Closed

Current evaluation

Merged changes adding limited Go Modules support for Go 1.11 and 1.12. Introduces a _get_module helper for build target resolution and a one-time compatibility warning. Replaces PR #3132 after approval.

Suggested action:

No scores available.

Issue body

Add limited support for using Go Modules for 1.11 and 1.12 of Go. The limitation when using 1.11 and 1.12 is that only the main module is installed. This is due to limitations in "go build" in those versions, to find the correct target, a new method "_get_module" is introduced. A warning is issued when using 1.11 and 1.12 with a link on how to enable support for Go Modules with precautions to only print the warning once per execution. Some general cleanup in GoPluing._build took place to remove repetition of "domain" specific flag settings for when building and relinking. LP: #1879315 Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com> - [ ] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)? - [ ] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? - [ ] Have you successfully run `./runtests.sh static`? - [ ] Have you successfully run `./runtests.sh tests/unit`? -----

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b Merged changes adding limited Go Modules support for Go 1.11 and 1.12. Introduces a _get_module helper for build target resolution and a one-time compatibility warning. Replaces PR #3132 after approval.
qwen3.6-35b-a3b-mtp-q6 Merged limited Go Modules support for Go 1.11/1.12. Introduces a _get_module method for target resolution and a one-time warning about limitations. Replaces PR #3132 after discussions on environment variables and backwards compatibility.
qwen3.6-35b-a3b-mtp-q6 Merged limited Go Modules support for Go 1.11 and 1.12. Introduces a _get_module method to handle build constraints and shows a one-time warning. Replaces PR #3132 after reviewing backwards compatibility and environment variable concerns.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#3132 go v1 plugin: warn when using go.mod and go < 1.13 snapcraft closed Closed after discussion regarding duplicate warnings and GO111MODULE handling. Adds a warning for Go versions below 1.13 when using go.mod.
82%
#1879315 go plugin: go mod support @ golang 1.12 snapcraft (launchpad) closed Closed without resolution. The request to lower the minimum Go version for go mod support from 1.13 to 1.12 was abandoned due to zero comments and no implementation.
77%
#1802256 go plugin: support Go modules snapcraft (launchpad) open Feature request for first-class Go modules support in the Go plugin. Now implemented: craft-parts' go plugin is go.mod-based (craft-parts#78), and snapcraft#3133 added go.mod support to the old v1 plugin. No activity for ~8 years.
71%
#3046 plugins: introduce v2.GoPlugin snapcraft merged Merged after approval and CI checks. Introduces v2.GoPlugin for Go plugin support requiring go.mod and adds .get_build_snaps as an abstract method to PluginV2. Changes span 26 files with 366 additions and 49 deletions.
71%