go plugin ignores the source-subdir keyword
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snapcraft |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
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@
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/
Instead that frps link should be to /home/jgrimm/
--- 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:/
go-importpath: github.
build-packages: [git]
---
This is why we have a `source-subdir` keyword. Does this solve the problem?