← Back to issue list

go plugin ignores the source-subdir keyword

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1613779
Type
issue
State
open
Author
~jgrimm
Labels
plugin sources
Created
Updated
Closed

Current evaluation

Go plugin (snapcraft 1.x) ignored source-subdir, symlinking GOPATH to git root instead of the subdirectory. 10 years old, 0 comments, no maintainer interaction. The GOPATH-symlink approach and go-importpath key no longer exist in the modern go plugin.

Suggested action: close stale

Reason: The issue is 3667 days old with 0 comments and no maintainer interaction. The described behavior — the go plugin creating GOPATH-style symlinks and honoring go-importpath — no longer exists: the current go plugin (craft_parts/plugins/go_plugin.py) uses go.mod with 'go install ./...' and contains no symlink logic or go-importpath key, and source_subdir is now handled generically in craft_parts/parts.py (lines 895-896, 913-916). The affected code path has been entirely removed, so the issue is no longer applicable.

Impact: 20 Quick Win: 14.0 Staleness: 95 Complexity: 30 Confidence: 80 Support Request: 15

Issue body

When using 'source', the go plugin assumes source is in the git root dir. Sample snapcraft.yaml of project that shows this below. The go plugin attempts to symlink in the source from the local cloned repo, but makes an assumption that the root of the git repo holds the source. In the below case the real source to build is at 'src/cmd/frps' within the git repo. Here's the symlink created: jgrimm@jgrimm-ThinkPad-X250:~/snapit/frps/parts/frps/go/src/github.com/fatedier/frp/src/cmd$ ll total 12 drwxr-xr-x 2 jgrimm lxd 4096 Aug 16 10:24 ./ drwxr-xr-x 3 jgrimm lxd 4096 Aug 16 10:24 ../ lrwxrwxrwx 1 jgrimm lxd 39 Aug 16 10:24 frps -> /home/jgrimm/snapit/frps/parts/frps/src/ Instead that frps link should be to /home/jgrimm/snapit/frps/parts/frps/src/src/cmd/frps/ --- snapcraft.yaml --- name: frps version: "0.8" summary: frps - short text description: | FIXME: confinement: devmode apps: frps: command: bin/frps plugs: [network, network-bind] parts: frps: plugin: go source: https://github.com/fatedier/frp.git go-importpath: github.com/fatedier/frp/src/cmd/frps build-packages: [git] ---

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 20
Quick Win: 14.0
Staleness: 95
Complexity: 30
Confidence: 80
Support Request: 15
close stale Go plugin (snapcraft 1.x) ignored source-subdir, symlinking GOPATH to git root instead of the subdirectory. 10 years old, 0 comments, no maintainer interaction. The GOPATH-symlink approach and go-importpath key no longer exist in the modern go plugin.
qwen/qwen3.6-35b-a3b
Staleness: 95
Complexity: 35
Confidence: 80
Support Request: 10
close stale The go plugin in snapcraft incorrectly ignores the source-subdir keyword, creating symlinks to the git root instead of the specified subdirectory. The report lacks maintainer feedback and is over nine years old.
qwen/qwen3.6-35b-a3b
Staleness: 98
Complexity: 45
Confidence: 90
Support Request: 5
close stale The go plugin incorrectly ignores the source-subdir keyword when creating symlinks, assuming source is always in the git root. The report is over 9 years old with no maintainer response.
qwen3.6-35b-a3b-mtp-q6
Staleness: 98
Complexity: 40
Confidence: 92
Support Request: 10
close stale Go plugin ignores source-subdir, creating incorrect symlinks. Issue is over 9 years old with zero maintainer interaction.
qwen3.6-35b-a3b-mtp-q6
Staleness: 98
Complexity: 40
Confidence: 90
Support Request: 5
close stale Go plugin ignores source-subdir keyword, symlinking source from git root instead of the specified subdirectory. Open, unassigned, inactive for two years. Requires triage and code fix.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#1591565 go plugin is not striping the .git from the source snapcraft (launchpad) open 2015 bug report: the legacy go parts plugin does not strip the .git suffix from source URLs, so go get targets the wrong package path (e.g. ./cli.git/...). No labels, no comments, inactive ~9.5 years; the go plugin no longer exists in modern snapcraft.
75%
#1858494 go module plugin assumes go files are in root of part source snapcraft (launchpad) closed Closed without a fix. The author provided a workaround using override-build, but the Go plugin was never updated to handle cmd/ subdirectories. The request was effectively abandoned.
70%