[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: GO111MODULE=on and "go: cannot use modules with build cache disabled"



On Tue, Feb 26, 2019 at 03:17:49PM +0100, Michael Stapelberg wrote:
> You can set GOPROXY=off to prevent the go tool from using the network (we should
> do this in dh-golang).
> Note that building a program using modules currently requires the go.mod files
> of all dependencies (in all versions mentioned in the transitive dependency
> closure!) to be present. They can partly be synthesized, and most likely,
> synthesizing them in your package is the route of least resistance for now.
> See https://github.com/golang/go/issues/29410 for details.

Thanks Michael - will take a look at that.  But it seems like it's
going to be somewhat hard work (see Shengjing's post) :-(

Best wishes,

   Julian

> On Tue, Feb 26, 2019 at 3:09 PM Julian Gilbey <julian-pkggo@d-and-j.net> wrote:
> 
>   On Tue, Feb 26, 2019 at 11:20:00AM +0100, Michael Stapelberg wrote:
>   > My guess is that you need to set GOCACHE to a temporary directory. This
>   should
>   > be done within dh-golang itself, so please send a patch.
>   > I think you’re treading on unchartered territory here — I’m not aware of any
>   > package within Debian using Go modules yet.
> 
>   Thanks Michael!
> 
>   I tried manually creating a temporary directory and setting GOCACHE to
>   point to it.  That was successful, though it gave the following
>   output, which is significantly different in format from what I have
>   seen before with other builds:
> 
>   [...]
>      dh_auto_build -O--buildsystem=golang
>   go: finding github.com/rsteube/cobra v0.0.1-zsh-completion-custom
>   go: finding github.com/rivo/tview v0.0.0-20180419193403-f855bee0205c
>   [...]
>   go: finding golang.org/x/net v0.0.0-20180724234803-3673e40ba225
>   warning: ignoring symlink
>   /home/jdg/debian/go-gitlab/build-area/git-lab-0.15.2/obj-x86_64-linux-gnu/src/cloud.google.com
>   [... many more similar warnings ...]
>   go: downloading github.com/xanzy/go-gitlab
>   v0.12.3-0.20181228114601-7bc4155e8bf8
>   go: downloading github.com/rsteube/cobra v0.0.1-zsh-completion-custom
>   [... lots more downloading lines ...]
>   warning: ignoring symlink
>   /home/jdg/debian/go-gitlab/build-area/git-lab-0.15.2/obj-x86_64-linux-gnu/src/cloud.google.com
>   [... many more similar warnings ...]
>   go: finding github.com/spf13/cobra v0.0.0-20180412120829-615425954c3b
>   can't load package: package
>   github.com/zaquestion/lab/obj-x86_64-linux-gnu/pkg/mod/github.com/avast/retry-go@v0.0.0-20180319101611-5469272a8171:
>   can only use path@version syntax with 'go get'
>   [... lots more "can't load package" errors ...]
>           cd obj-x86_64-linux-gnu && go install
>   -gcflags=all=\"-trimpath=/home/jdg/debian/go-gitlab/build-area/git-lab-0.15.2/obj-x86_64-linux-gnu/src\"
>   -asmflags=all=\"-trimpath=/home/jdg/debian/go-gitlab/build-area/git-lab-0.15.2/obj-x86_64-linux-gnu/src\"
>   -v -p 4 github.com/zaquestion/lab github.com/zaquestion/lab/cmd
>   github.com/zaquestion/lab/docs github.com/zaquestion/lab/internal/browser
>   github.com/zaquestion/lab/internal/config
>   github.com/zaquestion/lab/internal/copy github.com/zaquestion/lab/internal/git
>   github.com/zaquestion/lab/internal/gitlab
>   internal/race
>   errors
>   [...]
> 
>   and then it goes on to complete the build with no problems.
> 
>   Hmm, it does seem as though it is actively downloading packages from
>   the internet with the settings:
> 
>   export GO111MODULE := on
>   export GOCACHE := /tmp/tmp.X9n0iu3c3b
> 
>   That's not good.  :/
> 
>   Any ideas?  The current package is at
>   salsa.debian.org:go-team/packages/git-lab.git
>   (though it is broken when it downloads packages directly: the patch
>   update-for-new-tview.patch needs to be removed).  There are also other
>   issues with this package, but they are unrelated.
> 
>   Best wishes,
> 
>      Julian


Reply to: