1

I'm using pdebuild to test my package on older versions of Ubuntu. However an environment variable, GOROOT is leaking through to the build from my environment.

debian/tmp/usr/lib/gocode/src/code.brandscreen.net/cortex/go/util/http.go:4:2: cannot find package "io" in any of:
    /home/mjoiner/src/go/src/pkg/io (from $GOROOT)
    /tmp/buildd/golang-brandscreen-0.0/debian/tmp/usr/lib/gocode/src/io (from $GOPATH)
    /usr/lib/gocode/src/io

How do I clear this (and other environment variables) when calling pdebuild?

Matt Joiner
  • 112,946
  • 110
  • 377
  • 526

2 Answers2

1

Does putting

GOROOT=""

or

unset GOROOT

in ~/.pbuilderrc have any effect?

Mark Stanislav
  • 979
  • 4
  • 11
0

Normally, pdebuild runs pbuilder via sudo, so the easiest thing to do is to let sudo clear the environment for you. The general recommendation from a few different places, including the Debian pbuilder tricks page, is to use:

Defaults        env_reset,env_keep="DIST ARCH DEB_* BUILD* PATH"

in your sudo configuration so that you can still pass in a few of the environment variables that control pbuilder operations or are used by debhelper.

rra
  • 3,807
  • 18
  • 29