go plugin ignores the source-subdir keyword
Metadata
Current evaluation
No evaluation has been recorded for this issue yet.
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
No evaluation history available.