All of lore.kernel.org
 help / color / mirror / Atom feed
From: George Dunlap <George.Dunlap@citrix.com>
To: Ian Jackson <Ian.Jackson@citrix.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	Andrew Cooper <Andrew.Cooper3@citrix.com>,
	Nick Rosbrook <rosbrookn@ainfosec.com>,
	Julien Grall <julien.grall@arm.com>,
	Jan Beulich <jbeulich@suse.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH 5/5] gitignore: Ignore golang package directory
Date: Tue, 26 May 2020 15:30:43 +0000	[thread overview]
Message-ID: <A525D330-BCF9-4998-BEC5-425BA6C26CCF@citrix.com> (raw)
In-Reply-To: <24269.8059.28506.353748@mariner.uk.xensource.com>



> On May 26, 2020, at 2:54 PM, Ian Jackson <ian.jackson@citrix.com> wrote:
> 
> George Dunlap writes ("[PATCH 5/5] gitignore: Ignore golang package directory"):
>> Signed-off-by: George Dunlap <george.dunlap@citrix.com>
> 
> I have to say that finding a directory src/ in gitignore is very
> startling.
> 
> This directory src/ contains only output files ?

With golang, you don’t really distribute package binaries; you only distribute source files.

However, we don’t want to wait until someone tries to clone the package to see if we’ve broken the build; so the current makefile does a “build test” of the package files.

Before golang’s “modules” feature, the only way to do this was to have the code to build inside $GOPATH/src/$PACKAGENAME.  We can set GOPATH but we can’t change the “src” component of that.  So we used to set GOPATH to $XENROOT/tools/golang, put the files in $XENROOT/tools/golang/src/$PACKAGENAME, and 

With the “modules” feature, code can be built anywhere; the build at the moment doesn’t require GOPATH.

If we’re willing to limit ourselves to using versions of golang which support modules by default (1.12+), then we can probably get rid of this bit instead.  (And if we do want to support older versions, we should really add some code in the configure script to determine whether to build with modules or GOPATH.)

Nick, any opinions?

> Is there not a risk that humans will try to edit it ?

I suppose someone might.  If we decide we want to support older versions of go, we probably want to figure something out there.  Options:

1. Copy the files to a temp directory instead.  This is complicated because we have to find a good temp directory, and we’d have to copy them every time, slowing down the incremental build (though not that much).

2. Put a file in the generated directory like “GENERATED_DO_NOT_EDIT”.

3. Put them in tools/golang/GENERATED_DO_NOT_EDIT/src instead.

 -George

  reply	other threads:[~2020-05-26 15:31 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-22 16:12 [PATCH 0/5] Golang build fixes George Dunlap
2020-05-22 16:12 ` [PATCH 1/5] golang: Add a minimum go version to go.mod George Dunlap
2020-05-23 16:29   ` Nick Rosbrook
2020-05-22 16:12 ` [PATCH 2/5] golang: Add a variable for the libxl source directory George Dunlap
2020-05-23 16:32   ` Nick Rosbrook
2020-05-26 13:41   ` Ian Jackson
2020-05-22 16:12 ` [PATCH 3/5] libxl: Generate golang bindings in libxl Makefile George Dunlap
2020-05-23 17:00   ` Nick Rosbrook
2020-05-26 13:53   ` Ian Jackson
2020-05-26 14:56     ` George Dunlap
2020-05-26 16:57       ` Ian Jackson
2020-05-22 16:12 ` [PATCH 4/5] golang/xenlight: Use XEN_PKG_DIR variable rather than open-coding George Dunlap
2020-05-23 16:40   ` Nick Rosbrook
2020-05-23 16:48     ` Nick Rosbrook
2020-05-26  9:31       ` George Dunlap
2020-05-26 15:19         ` Nick Rosbrook
2020-05-26 13:58   ` Ian Jackson
2020-05-22 16:12 ` [PATCH 5/5] gitignore: Ignore golang package directory George Dunlap
2020-05-23 17:03   ` Nick Rosbrook
2020-05-26 13:54   ` Ian Jackson
2020-05-26 15:30     ` George Dunlap [this message]
2020-05-26 16:21       ` Nick Rosbrook
2020-05-26 16:33         ` George Dunlap
2020-05-26 16:59       ` Ian Jackson
2020-05-26 17:07         ` George Dunlap

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=A525D330-BCF9-4998-BEC5-425BA6C26CCF@citrix.com \
    --to=george.dunlap@citrix.com \
    --cc=Andrew.Cooper3@citrix.com \
    --cc=Ian.Jackson@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien.grall@arm.com \
    --cc=konrad.wilk@oracle.com \
    --cc=rosbrookn@ainfosec.com \
    --cc=sstabellini@kernel.org \
    --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.