Skip to content

GOPATH and GOBIN must be unset before build #4

@oholiab

Description

@oholiab

Not entirely sure about GOPATH, but definitely GOBIN needs to be unset if they are set in the user's environment before calling gdp buildpackage

I attempted to build oz with both set (full incantation was DIST=stretch gbp buildpackage -us -uc --git-debian-branch=debian-test) and it failed here:

...
github.com/subgraph/oz/vendor/github.com/twtiger/gosecco/emulator
github.com/subgraph/oz/vendor/github.com/twtiger/gosecco/tester
go install github.com/subgraph/oz/vendor/github.com/twtiger/gosecco/tester: open /home/user/golang/bin/tester: no such file or directory
dh_auto_build: go install -v -p 1 -buildmode=pie -pkgdir=/build/oz-daemon-0.2.6/tmp.VPEoyMctLR github.com/subgraph/oz github.com/subgraph/oz/cmd/oz-daemon github.com/subgraph/oz/cmd/oz-init github.com/subgraph/oz/cmd/oz-mount github.com/subgraph/oz/cmd/oz-ovpn-route-down github.com/subgraph/oz/cmd/oz-ovpn-route-up github.com/subgraph/oz/cmd/oz-seccomp github.com/subgraph/oz/cmd/oz-seccomp-tracer github.com/subgraph/oz/cmd/oz-setup github.com/subgraph/oz/cmd/oz-umount github.com/subgraph/oz/fs github.com/subgraph/oz/ipc github.com/subgraph/oz/network github.com/subgraph/oz/ns github.com/subgraph/oz/openvpn github.com/subgraph/oz/oz github.com/subgraph/oz/oz-daemongithub.com/subgraph/oz/oz-init github.com/subgraph/oz/oz-mount github.com/subgraph/oz/oz-seccomp github.com/subgraph/oz/vendor/github.com/BurntSushi/xdg github.com/subgraph/oz/vendor/github.com/codegangsta/cli github.com/subgraph/oz/vendor/github.com/docker/libcontainer/netlink github.com/subgraph/oz/vendor/github.com/docker/libcontainer/system github.com/subgraph/oz/vendor/github.com/gotk3/gotk3/cairo github.com/subgraph/oz/vendor/github.com/gotk3/gotk3/gdk github.com/subgraph/oz/vendor/github.com/gotk3/gotk3/glib github.com/subgraph/oz/vendor/github.com/gotk3/gotk3/gtk github.com/subgraph/oz/vendor/github.com/gotk3/gotk3/pango github.com/subgraph/oz/vendor/github.com/j-keck/arping github.com/subgraph/oz/vendor/github.com/kr/pty github.com/subgraph/oz/vendor/github.com/milosgajdos83/tenus github.com/subgraph/oz/vendor/github.com/naegelejd/go-acl github.com/subgraph/oz/vendor/github.com/op/go-logging github.com/subgraph/oz/vendor/github.com/subgraph/constants github.com/subgraph/oz/vendor/github.com/subgraph/go-xdgdirs github.com/subgraph/oz/vendor/github.com/twtiger/gosecco github.com/subgraph/oz/vendor/github.com/twtiger/gosecco/asm github.com/subgraph/oz/vendor/github.com/twtiger/gosecco/checker github.com/subgraph/oz/vendor/github.com/twtiger/gosecco/compiler github.com/subgraph/oz/vendor/github.com/twtiger/gosecco/constants github.com/subgraph/oz/vendor/github.com/twtiger/gosecco/data github.com/subgraph/oz/vendor/github.com/twtiger/gosecco/emulator github.com/subgraph/oz/vendor/github.com/twtiger/gosecco/native github.com/subgraph/oz/vendor/github.com/twtiger/gosecco/parser github.com/subgraph/oz/vendor/github.com/twtiger/gosecco/precompilation github.com/subgraph/oz/vendor/github.com/twtiger/gosecco/simplifier github.com/subgraph/oz/vendor/github.com/twtiger/gosecco/tester github.com/subgraph/oz/vendor/github.com/twtiger/gosecco/tree github.com/subgraph/oz/vendor/github.com/twtiger/gosecco/unifier github.com/subgraph/oz/vendor/golang.org/x/sys/unix github.com/subgraph/oz/xpra returned exit code 1
debian/rules:13: recipe for target 'override_dh_auto_build' failed
make[1]: *** [override_dh_auto_build] Error 1
make[1]: Leaving directory '/build/oz-daemon-0.2.6'
debian/rules:10: recipe for target 'build' failed
make: *** [build] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2
I: copying local configuration
E: Failed autobuilding of package
I: unmounting dev/ptmx filesystem
I: unmounting dev/pts filesystem
I: unmounting dev/shm filesystem
I: unmounting proc filesystem
I: unmounting sys filesystem
I: Cleaning COW directory
I: forking: rm -rf /var/cache/pbuilder/build/cow.25049
gbp:error: 'git-pbuilder -us -uc' failed: it exited with 1
user@subgraph/pts/2:~/oz [debian-test]>

As you can see, my $GOBIN from my .zshrc set to $HOME/golang/bin has polluted the build environment and caused a failure. This is still the case with $GOPATH unset, and if I unset both $GOPATH and $GOBIN it works just fine.

Seems like both of these should be unset at the lowest common entry point for all build scripts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions