Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 615444 - app-emulation/lxd-2.11: file collision with dev-go/go-sqlite3-1.1.0_p20160307
Summary: app-emulation/lxd-2.11: file collision with dev-go/go-sqlite3-1.1.0_p20160307
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Erik Mackdanz
URL:
Whiteboard:
Keywords: InVCS
: 613328 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-04-13 16:11 UTC by Toralf Förster
Modified: 2017-09-15 05:06 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge-info.txt (emerge-info.txt,5.36 KB, text/plain)
2017-04-13 16:11 UTC, Toralf Förster
Details
dev-go:go-sqlite3-1.1.0_p20160307:20170413-035930.log (dev-go:go-sqlite3-1.1.0_p20160307:20170413-035930.log,15.17 KB, text/plain)
2017-04-13 16:12 UTC, Toralf Förster
Details
emerge-history.txt (emerge-history.txt,208.62 KB, text/plain)
2017-04-13 16:12 UTC, Toralf Förster
Details
etc.portage.tbz2 (etc.portage.tbz2,22.84 KB, application/x-bzip)
2017-04-13 16:12 UTC, Toralf Förster
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2017-04-13 16:11:54 UTC
  -----------------------------------------------------------------

  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)
Comment 1 Toralf Förster gentoo-dev 2017-04-13 16:11:57 UTC
Created attachment 469964 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2017-04-13 16:12:00 UTC
Created attachment 469966 [details]
dev-go:go-sqlite3-1.1.0_p20160307:20170413-035930.log
Comment 3 Toralf Förster gentoo-dev 2017-04-13 16:12:03 UTC
Created attachment 469968 [details]
emerge-history.txt
Comment 4 Toralf Förster gentoo-dev 2017-04-13 16:12:06 UTC
Created attachment 469970 [details]
etc.portage.tbz2
Comment 5 Zac Medico gentoo-dev 2017-04-13 16:44:59 UTC
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.
Comment 6 Zac Medico gentoo-dev 2017-04-13 16:57:44 UTC
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
Comment 7 Zac Medico gentoo-dev 2017-04-14 08:31:24 UTC
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
Comment 8 Virgil Dupras (RETIRED) gentoo-dev 2017-06-02 18:31:02 UTC
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?
Comment 9 Virgil Dupras (RETIRED) gentoo-dev 2017-06-03 18:10:49 UTC
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?
Comment 10 Zac Medico gentoo-dev 2017-06-04 06:49:27 UTC
(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?
Comment 11 Zac Medico gentoo-dev 2017-06-04 06:55:24 UTC
> -	# Warn on unhandled locale changes
> -	l10n_find_plocales_changes po "" .po

You dropped the above line. It's not useful?
Comment 12 Virgil Dupras (RETIRED) gentoo-dev 2017-06-04 14:47:51 UTC
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.
Comment 13 Zac Medico gentoo-dev 2017-06-05 08:52:41 UTC
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?
Comment 15 Zac Medico gentoo-dev 2017-06-08 06:35:41 UTC
*** Bug 613328 has been marked as a duplicate of this bug. ***
Comment 17 Jeff Kowalczyk 2017-07-26 22:40:31 UTC
Virgil: Thanks for this. Do you use go tooling on lxd sources to generate the EGO_VENDOR listings, or is the process manual?
Comment 18 Virgil Dupras (RETIRED) gentoo-dev 2017-07-26 23:11:39 UTC
Jeff: I built this list manually, but the next time I do it, I'll build a script. It should be fairly straightforward.
Comment 19 Zac Medico gentoo-dev 2017-08-09 06:01:25 UTC
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\}'
Comment 20 Zac Medico gentoo-dev 2017-08-09 09:42:16 UTC
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
Comment 21 Zac Medico gentoo-dev 2017-08-09 10:17:33 UTC
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
Comment 22 Virgil Dupras (RETIRED) gentoo-dev 2017-08-10 02:01:54 UTC
I built a little helper script based on your one liners Zac: https://github.com/hsoft/gentoo-ego-vendor-update
Comment 23 Zac Medico gentoo-dev 2017-09-15 05:06:18 UTC
(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