All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nick Rosbrook <rosbrookn@gmail.com>
To: Ian Jackson <ian.jackson@citrix.com>
Cc: Nick Rosbrook <rosbrookn@ainfosec.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	George Dunlap <George.Dunlap@citrix.com>, Wei Liu <wl@xen.org>,
	"paul@xen.org" <paul@xen.org>
Subject: Re: [PATCH for-4.14] tools: check go compiler version if present
Date: Fri, 12 Jun 2020 17:50:28 -0400	[thread overview]
Message-ID: <20200612215028.GA6286@six> (raw)
In-Reply-To: <24291.45045.185355.587474@mariner.uk.xensource.com>

On Fri, Jun 12, 2020 at 05:40:21PM +0100, Ian Jackson wrote:
> Nick Rosbrook writes ("[PATCH for-4.14] tools: check go compiler version if present"):
> > Currently, no minimum go compiler version is required by the configure
> > scripts. However, the go bindings actually will not build with some
> > older versions of go. Add a check for a minimum go version of 1.11.1 in
> > accordance with tools/golang/xenlight/go.mod.
> 
> > diff --git a/tools/configure.ac b/tools/configure.ac
> > index a9af0a21c6..9d126b7a14 100644
> > --- a/tools/configure.ac
> > +++ b/tools/configure.ac
> > @@ -338,6 +338,13 @@ AS_IF([test "x$golang" = "xy"], [
> >              AC_MSG_ERROR([Go tools enabled, but missing go compiler])
> >          ])
> >          golang="n"
> > +    ], [
> > +        AX_COMPARE_VERSION([$GOVERSION], [lt], [1.11.1], [
> > +            AS_IF([test "x$enable_golang" = "xyes"], [
> > +                AC_MSG_ERROR(["Your version of go: $GOVERSION is not supported"])
> > +            ])
> > +            golang="n"
> > +        ])
> >      ])
> >  ])
> 
> I don't understand this code.  Why are you checking $enable_golang in
> your new code whereas the old code checks $golang ?  I actually read
> the generated code trying to see where $golang is set and AFAICT it is
> only ever set to n ?

For some background, in an attempt to be consistent with existing code
here, I basically copied the logic for enabling the ocaml tools. 

The logic is setup in a way that (unless --disable-golang is set) if a
suitable version of the go compiler is found, then golang is enabled by
default. If, however, a suitable go compiler is not found (either go
is not present at all, or it is too old), then golang is disabled. This
part happens silently unless --enable-golang is _explicitly_ set by the
user, in which case an error is thrown by ./configure. This is why
$enable_golang is checked.

> 
> This is all very weird.  Surely golang should be enabled by default
> when the proper compiler is present, and disabled by default
> otherwise.  I think this effect will be quite hard to achieve with
> AX_ARG_DEFAULT_ENABLE.  Probably you should be using AC_ARG_ENABLE
> and doing the defaulting yourself so that you can use a computed
> default etc.

I believe the behavior you described here is the same as I described
above (and is acheived in this patch). But, I'm happy to re-work the
implementation if necessary so that the code is more clear.

Thanks,
-NR


  reply	other threads:[~2020-06-12 21:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-12 14:31 [PATCH for-4.14] tools: check go compiler version if present Nick Rosbrook
2020-06-12 16:40 ` Ian Jackson
2020-06-12 21:50   ` Nick Rosbrook [this message]
2020-06-15 13:48     ` Ian Jackson
2020-06-15 14:32       ` Nick Rosbrook
2020-06-15 14:42         ` Ian Jackson
2020-06-15 14:46           ` Paul Durrant
2020-06-15 14:50             ` Ian Jackson
2020-06-15 11:42 ` 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=20200612215028.GA6286@six \
    --to=rosbrookn@gmail.com \
    --cc=George.Dunlap@citrix.com \
    --cc=ian.jackson@citrix.com \
    --cc=paul@xen.org \
    --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.