----------------------------------------------------------------- This is an unstable amd64 chroot image (named 13.0-no-multilib-libressl_20170409-193000) at a hardened host acting as a tinderbox. ----------------------------------------------------------------- gcc-config -l: [1] x86_64-pc-linux-gnu-5.4.0 * Available Python interpreters, in order of preference: [1] python3.4 [2] python3.6 (fallback) [3] python2.7 (fallback)
Created attachment 469964 [details] emerge-info.txt
Created attachment 469966 [details] dev-go:go-sqlite3-1.1.0_p20160307:20170413-035930.log
Created attachment 469968 [details] emerge-history.txt
Created attachment 469970 [details] etc.portage.tbz2
We need to fix the app-emulation/lxd ebuild so that it doesn't install these files in the /usr/lib/go-gentoo/src/github.com/mattn/go-sqlite3 directory.
I tested building it with all of the bundled libraries moved to ${S}/src/${EGO_PN}/vendor, but it failed due to a missing indirect dependency on github.com/jessevdk/go-flags: cd /var/tmp/portage/app-emulation/lxd-2.11/work/lxd-2.11/src/github.com/lxc/lxd /usr/lib/go/pkg/tool/linux_amd64/compile -o $WORK/github.com/lxc/lxd.a -trimpath $WORK -p github.com/lxc/lxd -complete -buildid fff8ce7e5c250f75c0ce2d00bef1427db5ab3c8e -importmap github.com/gorilla/websocket=github.com/lxc/lxd/vendor/github.com/gorilla/websocket -importmap gopkg.in/yaml.v2=github.com/lxc/lxd/vendor/gopkg.in/yaml.v2 -D _/var/tmp/portage/app-emulation/lxd-2.11/work/lxd-2.11/src/github.com/lxc/lxd -I $WORK -I /var/tmp/portage/app-emulation/lxd-2.11/work/lxd-2.11/pkg/linux_amd64 -pack ./client.go ./config.go make -j4 -l4 go install -v -tags libsqlite3 ./... vendor/github.com/gosexy/gettext/go-xgettext/main.go:42:2: cannot find package "github.com/jessevdk/go-flags" in any of: /var/tmp/portage/app-emulation/lxd-2.11/work/lxd-2.11/src/github.com/lxc/lxd/vendor/github.com/jessevdk/go-flags (vendor tree) /usr/lib/go/src/github.com/jessevdk/go-flags (from $GOROOT) /var/tmp/portage/app-emulation/lxd-2.11/work/lxd-2.11/src/github.com/jessevdk/go-flags (from $GOPATH) /var/tmp/portage/app-emulation/lxd-2.11/temp/goroot/src/github.com/jessevdk/go-flags make: *** [Makefile:16: default] Error 1
We should really migrate the lxd ebuild to handle vendor dependencies with the golang-vcs-snapshot eclass EGO_VENDOR variable. Meanwhile, this solves the problem by moving all of the dependencies to the vendor directory: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a20941347bf2d9ff15f182b50f093880361fe6e2
Zac, Erik, I'd be interested in doing this work (moving the package to golang-vcs-snapshot). I use the package and I'd like to contribute to it being more actively maintained. Has someone started working on this yet? If not, do you mind if I do?
I had some motivation, so I went ahead and did in anyway. Result is at https://github.com/hsoft/portage-overlay/blob/master/app-emulation/lxd/lxd-2.11-r1.ebuild All dependencies are listed and when I run `compile`, nothing is downloaded from go itself. What do you think? Should I create a PR with that?
(In reply to Virgil Dupras from comment #9) > I had some motivation, so I went ahead and did in anyway. Result is at > https://github.com/hsoft/portage-overlay/blob/master/app-emulation/lxd/lxd-2. > 11-r1.ebuild > > > -PATCHES=("${FILESDIR}/${P}-dont-go-get.patch") I wonder why lxd-2.11-dont-go-get.patch isn't needed anymore? > src_compile() { > - golang-build_src_compile > + export GOPATH="${WORKDIR}/${P}:${PWD}/vendor" Are you sure that ${PWD}/vendor is needed in GOPATH?
> - # Warn on unhandled locale changes > - l10n_find_plocales_changes po "" .po You dropped the above line. It's not useful?
You're right Zac, I was a bit too aggressive in my removal of src_prepare(). You're also right that adding the vendor path to GOPATH was unnecessary! I had copied it from the drone package. It's fixed now.
Looks good now, thanks! I see that upstream has released 2.14 now, and we've got bug 613694 open for a version bump. Would you like to update your ebuild for 2.14?
Done! https://github.com/hsoft/portage-overlay/blob/master/app-emulation/lxd/lxd-2.14.ebuild
*** Bug 613328 has been marked as a duplicate of this bug. ***
(In reply to Virgil Dupras from comment #14) > Done! > https://github.com/hsoft/portage-overlay/blob/master/app-emulation/lxd/lxd-2. > 14.ebuild Thanks! It's in gentoo now: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7c15f08e00643b789f3ab4fcf80250b982bc5f2c
Virgil: Thanks for this. Do you use go tooling on lxd sources to generate the EGO_VENDOR listings, or is the process manual?
Jeff: I built this list manually, but the next time I do it, I'll build a script. It should be fairly straightforward.
I wrote this script to query the HEAD commit for a github repository: #!/bin/bash EGO_PN=$1 #<id>tag:github.com,2008:Grit::Commit/5e3acbb5668c4c3deb4842615c4098eb61fb6b1e</id> curl -sS "https://${EGO_PN}/commits/master.atom" | \ grep '^[[:space:]]*<id>tag:github\.com,2008:Grit::Commit/[0-9a-f]\{40\}</id>' | \ head -n1 | grep -o '[0-9a-f]\{40\}'
Using the github api documented at https://developer.github.com/v3/repos/commits/: #!/bin/bash EGO_PN=$1 curl -sS https://api.github.com/repos/${EGO_PN#github.com/}/commits/HEAD | jq -r .sha
According to https://github.com/golang/go/wiki/PackageManagementTools, dep will be the official dependency tool: https://github.com/golang/dep I ran it against lxd-2.14, and it produced a Gopkg.lock file like this: # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. [[projects]] name = "github.com/davecgh/go-spew" packages = ["spew"] revision = "346938d642f2ec3594ed81d874461961cd0faa76" version = "v1.1.0" [[projects]] branch = "master" name = "github.com/dustinkirkland/golang-petname" packages = ["."] revision = "1f4996aa8aa05ee066aaf9e3179d340b48c6da74" [[projects]] branch = "master" name = "github.com/golang/protobuf" packages = ["proto"] revision = "1909bc2f63dc92bb931deace8b8312c4db72d12f" [[projects]] name = "github.com/gorilla/context" packages = ["."] revision = "1ea25387ff6f684839d82767c1733ff4d4d15d0a" version = "v1.1" [[projects]] name = "github.com/gorilla/mux" packages = ["."] revision = "bcd8bc72b08df0f70df986b97f95590779502d31" version = "v1.4.0" [[projects]] name = "github.com/gorilla/websocket" packages = ["."] revision = "ea4d1f681babbce9545c9c5f3d5194a789c89f5b" version = "v1.2.0" [[projects]] name = "github.com/gosexy/gettext" packages = ["."] revision = "74466a0a0c4a62fea38f44aa161d4bbfbe79dd6b" version = "v0.9" [[projects]] name = "github.com/mattn/go-colorable" packages = ["."] revision = "167de6bfdfba052fa6b2d3664c8f5272e23c9072" version = "v0.0.9" [[projects]] name = "github.com/mattn/go-isatty" packages = ["."] revision = "fc9e8d8ef48496124e79ae0df75490096eccf6fe" version = "v0.0.2" [[projects]] name = "github.com/mattn/go-runewidth" packages = ["."] revision = "9e777a8366cce605130a531d2cd6363d07ad7317" version = "v0.0.2" [[projects]] name = "github.com/mattn/go-sqlite3" packages = ["."] revision = "ca5e3819723d8eeaf170ad510e7da1d6d2e94a08" version = "v1.2.0" [[projects]] branch = "master" name = "github.com/olekukonko/tablewriter" packages = ["."] revision = "be5337e7b39e64e5f91445ce7e721888dbab7387" [[projects]] name = "github.com/pborman/uuid" packages = ["."] revision = "e790cca94e6cc75c7064b1332e63811d4aae1a53" version = "v1.1" [[projects]] name = "github.com/pmezard/go-difflib" packages = ["difflib"] revision = "792786c7400a136282c1664665ae0a8db921c6c2" version = "v1.0.0" [[projects]] name = "github.com/stretchr/testify" packages = ["assert","require","suite"] revision = "69483b4bd14f5845b5a1e55bca19e954e827f1d0" version = "v1.1.4" [[projects]] branch = "master" name = "github.com/syndtr/gocapability" packages = ["capability"] revision = "db04d3cc01c8b54962a58ec7e491717d06cfcc16" [[projects]] branch = "master" name = "golang.org/x/crypto" packages = ["pbkdf2","scrypt","ssh/terminal"] revision = "b176d7def5d71bdd214203491f89843ed217f420" [[projects]] branch = "master" name = "golang.org/x/net" packages = ["context"] revision = "1c05540f6879653db88113bc4a2b70aec4bd491f" [[projects]] branch = "master" name = "golang.org/x/sys" packages = ["unix","windows"] revision = "b0e0dd72976dc482b6cb37c5640440f876ac1907" [[projects]] name = "gopkg.in/flosch/pongo2.v3" packages = ["."] revision = "5e81b817a0c48c1c57cdf1a9056cf76bdee02ca9" version = "v3.0" [[projects]] name = "gopkg.in/inconshreveable/log15.v2" packages = [".","stack","term"] revision = "b105bd37f74e5d9dc7b6ad7806715c7a2b83fd3f" version = "v2.11" [[projects]] branch = "v2" name = "gopkg.in/lxc/go-lxc.v2" packages = ["."] revision = "1a2cf29ce27f74298fe70acbf817ca2f46cf7457" [[projects]] branch = "v2" name = "gopkg.in/tomb.v2" packages = ["."] revision = "d5d1b5820637886def9eef33e03a27a9f166942c" [[projects]] branch = "v2" name = "gopkg.in/yaml.v2" packages = ["."] revision = "25c4ec802a7d637f88d584ab26798e94ad14c13b" [solve-meta] analyzer-name = "dep" analyzer-version = 1 inputs-digest = "e527ba01a7345d5c415572efb999384a338950dcd3200050926069d24f157c97" solver-name = "gps-cdcl" solver-version = 1
I built a little helper script based on your one liners Zac: https://github.com/hsoft/gentoo-ego-vendor-update
(In reply to Virgil Dupras from comment #22) > I built a little helper script based on your one liners Zac: > https://github.com/hsoft/gentoo-ego-vendor-update Works like a charm! :D