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

Re: [PATCH 1/2] tools: build golang tools if go compiler is present


  • To: Nick Rosbrook <rosbrookn@xxxxxxxxx>
  • From: George Dunlap <George.Dunlap@xxxxxxxxxx>
  • Date: Thu, 23 Apr 2020 17:27:55 +0000
  • Accept-language: en-GB, en-US
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=George.Dunlap@xxxxxxxxxx; spf=Pass smtp.mailfrom=George.Dunlap@xxxxxxxxxx; spf=None smtp.helo=postmaster@xxxxxxxxxxxxxxx
  • Cc: Nick Rosbrook <rosbrookn@xxxxxxxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, George Dunlap <dunlapg@xxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Ian Jackson <Ian.Jackson@xxxxxxxxxx>
  • Delivery-date: Thu, 23 Apr 2020 17:28:06 +0000
  • Ironport-sdr: rxEB/pU8dw4gPEGBsXUmcyjkWJkHZcezjs9DXmhqLsyhpVGmO9J4jE3Z7zlBAS8DaoEXyhB0cK LqhyPBvlhukpdRVcP2nHuRlQcRETIxxR3HVLng5ERKMrIb/kMlJHqdfzOTQ32ouAQlUxh7P9Yb xJwkV+5pY4PZivL20fvXawwdxB6ZFJezsJDQ8ToE7lXGQ37ibMNhBz0uJsYZB9l+18uURCdM8M 5Jgiga2oCuD320L/IOMsUDeVh0cPUeJNV3coVIq/+cMKuFQIP1MNHhE+1/TRbI1VXbubXZ8Je2 TGU=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHWGXVVEMzovBzqEEyjZLPfGUwjnqiGvR+AgAAXe4A=
  • Thread-topic: [PATCH 1/2] tools: build golang tools if go compiler is present


> On Apr 23, 2020, at 5:03 PM, Nick Rosbrook <rosbrookn@xxxxxxxxx> wrote:
> 
> On Thu, Apr 23, 2020 at 9:44 AM George Dunlap <dunlapg@xxxxxxxxx> wrote:
>> 
>> 
>> 
>> On Thu, Apr 23, 2020 at 1:51 AM Nick Rosbrook <rosbrookn@xxxxxxxxx> wrote:
>>> 
>>> By default, if the go compiler is found by the configure script, build
>>> the golang tools. If the compiler is not found, and
>>> --enable-golang_tools was not explicitly set, do not build to the golang
>>> tools.
>>> 
>>> The new corresponding make variable is CONFIG_GOLANG_TOOLS. Remove
>>> CONFIG_GOLANG from tools/Rules.mk since the new variable is set by
>>> configure.
>>> 
>>> Signed-off-by: Nick Rosbrook <rosbrookn@xxxxxxxxxxxx>
>>> ---
>>> config/Tools.mk.in |   1 +
>>> m4/golang.m4       |   4 ++
>>> tools/Makefile     |   2 +-
>>> tools/Rules.mk     |   2 -
>>> tools/configure    | 138 +++++++++++++++++++++++++++++++++++++++++++++
>>> tools/configure.ac |  12 ++++
>>> 6 files changed, 156 insertions(+), 3 deletions(-)
>>> create mode 100644 m4/golang.m4
>>> 
>>> diff --git a/config/Tools.mk.in b/config/Tools.mk.in
>>> index 189fda1596..2c219f5477 100644
>>> --- a/config/Tools.mk.in
>>> +++ b/config/Tools.mk.in
>>> @@ -55,6 +55,7 @@ CONFIG_QEMU_TRAD    := @qemu_traditional@
>>> CONFIG_QEMU_XEN     := @qemu_xen@
>>> CONFIG_QEMUU_EXTRA_ARGS:= @EXTRA_QEMUU_CONFIGURE_ARGS@
>>> CONFIG_LIBNL        := @libnl@
>>> +CONFIG_GOLANG_TOOLS := @golang_tools@
>>> 
>>> CONFIG_SYSTEMD      := @systemd@
>>> SYSTEMD_CFLAGS      := @SYSTEMD_CFLAGS@
>>> diff --git a/m4/golang.m4 b/m4/golang.m4
>>> new file mode 100644
>>> index 0000000000..0b4bd54ce0
>>> --- /dev/null
>>> +++ b/m4/golang.m4
>>> @@ -0,0 +1,4 @@
>>> +AC_DEFUN([AC_PROG_GO], [
>>> +    dnl Check for the go compiler
>>> +    AC_CHECK_TOOL([GO],[go],[no])
>>> +])
>> 
>> 
>> AFAICT this only checks for the existence of the binary.  Will the bindings 
>> compile with all versions of go?  If not, should we try to check the version 
>> here?
> 
> There are no obvious pieces to me that won't compile on fairly recent
> (i.e. >= 1.9) versions of go, but yes it would probably be best to
> check for a minimum version. I will do some more work to figure out an
> appropriate minimum version, but I think go 1.10 might be a reasonable
> start.

OK — I didn’t mean you had to; I just thought it was worth bringing up.

The underscore thing though — I think it’s a bad idea to mix `-` and `_`; 
—enable-golang_tools just isn’t a good idea IMHO. :-)

Do you need _tools?  Could it just be —enable-golang?

 -George

 


Rackspace

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