All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nick Rosbrook <rosbrookn@gmail.com>
To: George Dunlap <George.Dunlap@citrix.com>
Cc: Nick Rosbrook <rosbrookn@ainfosec.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Wei Liu <wl@xen.org>, Ian Jackson <Ian.Jackson@citrix.com>
Subject: Re: [PATCH 2/3] golang/xenlight: init xenlight go module
Date: Tue, 12 May 2020 19:36:56 -0400	[thread overview]
Message-ID: <CAEBZRSeFptOcLQ5sVyP6k4cmaqUwx9=HabnzPXfwBb+ih3nduQ@mail.gmail.com> (raw)
In-Reply-To: <294923FB-07D4-4CEB-9B29-3450DB454000@citrix.com>

> 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


  parent reply	other threads:[~2020-05-12 23:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-30 21:38 [PATCH 0/3] initialize xenlight go module Nick Rosbrook
2020-04-30 21:38 ` [PATCH 1/3] golang/xenlight: re-track generated go code Nick Rosbrook
2020-05-12 14:48   ` George Dunlap
2020-04-30 21:39 ` [PATCH 2/3] golang/xenlight: init xenlight go module Nick Rosbrook
2020-05-12 14:36   ` George Dunlap
2020-05-12 15:06     ` Nick Rosbrook
2020-05-12 15:47       ` George Dunlap
2020-05-12 15:58         ` Nick Rosbrook
2020-05-12 17:30       ` George Dunlap
2020-05-12 17:37         ` George Dunlap
2020-05-12 23:36         ` Nick Rosbrook [this message]
2020-04-30 21:39 ` [PATCH 3/3] golang/xenlight: add necessary module/package documentation Nick Rosbrook
2020-05-12 17:20   ` George Dunlap
2020-05-12 21:59     ` Nick Rosbrook

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAEBZRSeFptOcLQ5sVyP6k4cmaqUwx9=HabnzPXfwBb+ih3nduQ@mail.gmail.com' \
    --to=rosbrookn@gmail.com \
    --cc=George.Dunlap@citrix.com \
    --cc=Ian.Jackson@citrix.com \
    --cc=rosbrookn@ainfosec.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.