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

Re: [PATCH 2/3] golang/xenlight: init xenlight go module



> The whole point of running ‘go build’ is to make sure that *the code we just 
> copied* — the code right now in our own local tree, perhaps which was just 
> generated — actually compiles.

I understand that, and in my tests that's the outcome.

> It looks like when we add the `go.mod` further up the tree, it makes `go 
> build` ignore the GOPATH environment variable we’re giving it, which causes 
> the build failure.  But your “fix” doesn’t make it use the in-tree go code 
> again; instead it looks like it causes `go build` command to go and fetch the 
> most recent `master` version from xenbits, ignoring the go code in the tree 
> completely. :-)

The GOPATH is "ignored" because it is obsolete in module-aware go
(this is one of the primary motivations of modules). The build fails
(without changing XEN_GOCODE_URL) because xenproject.golang.org is
*not* the module in the local tree, and the subsequent fetch fails.
However, when the correct import path (after updating XEN_GOCODE_URL)
is used, go is smart enough to realize we're trying to build our local
module and will not do a fetch.

However, I'm more than happy to just use `go build` instead of `go
install` in that make target.

Thanks
-NR



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.