Martin Kletzander
2021-May-06 11:30 UTC
[Libguestfs] [libnbd PATCH 4/5] golang: Check for module support
If golang does not support modules, then it is too old anyway. Signed-off-by: Martin Kletzander <mkletzan at redhat.com> --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 3b51354346cc..31130218a1e6 100644 --- a/configure.ac +++ b/configure.ac @@ -494,7 +494,7 @@ AS_IF([test "x$enable_golang" != "xno"],[ AC_CHECK_PROG([GOLANG],[go],[go],[no]) AS_IF([test "x$GOLANG" != "xno"],[ AC_MSG_CHECKING([if $GOLANG is usable]) - AS_IF([$GOLANG run $srcdir/golang/config-test.go 2>&AS_MESSAGE_LOG_FD],[ + AS_IF([$GOLANG run $srcdir/golang/config-test.go && $GOLANG help modules >/dev/null 2>&AS_MESSAGE_LOG_FD],[ AC_MSG_RESULT([yes]) # Print the version to help with debugging. -- 2.31.1
Eric Blake
2021-May-07 12:17 UTC
[Libguestfs] [libnbd PATCH 4/5] golang: Check for module support
On 5/6/21 6:30 AM, Martin Kletzander wrote:> If golang does not support modules, then it is too old anyway. > > Signed-off-by: Martin Kletzander <mkletzan at redhat.com> > --- > configure.ac | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/configure.ac b/configure.ac > index 3b51354346cc..31130218a1e6 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -494,7 +494,7 @@ AS_IF([test "x$enable_golang" != "xno"],[ > AC_CHECK_PROG([GOLANG],[go],[go],[no]) > AS_IF([test "x$GOLANG" != "xno"],[ > AC_MSG_CHECKING([if $GOLANG is usable]) > - AS_IF([$GOLANG run $srcdir/golang/config-test.go 2>&AS_MESSAGE_LOG_FD],[ > + AS_IF([$GOLANG run $srcdir/golang/config-test.go && $GOLANG help modules >/dev/null 2>&AS_MESSAGE_LOG_FD],[Long line; I'd break after the &&. Also, why are you not sending the output of config-test.go to AS_MESSAGE_LOG_FD any more? And why send stdout to /dev/null? Either you have to repeat the redirections, or you should group the two commands: AS_IF([{$GOLANG run ... && $GOLANG help; } 2>&AS_MESSAGE_LOG_FD> AC_MSG_RESULT([yes]) > > # Print the version to help with debugging. >-- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org
Richard W.M. Jones
2021-May-11 11:22 UTC
[Libguestfs] [libnbd PATCH 4/5] golang: Check for module support
On Thu, May 06, 2021 at 01:30:09PM +0200, Martin Kletzander wrote:> If golang does not support modules, then it is too old anyway. > > Signed-off-by: Martin Kletzander <mkletzan at redhat.com> > --- > configure.ac | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/configure.ac b/configure.ac > index 3b51354346cc..31130218a1e6 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -494,7 +494,7 @@ AS_IF([test "x$enable_golang" != "xno"],[ > AC_CHECK_PROG([GOLANG],[go],[go],[no]) > AS_IF([test "x$GOLANG" != "xno"],[ > AC_MSG_CHECKING([if $GOLANG is usable]) > - AS_IF([$GOLANG run $srcdir/golang/config-test.go 2>&AS_MESSAGE_LOG_FD],[ > + AS_IF([$GOLANG run $srcdir/golang/config-test.go && $GOLANG help modules >/dev/null 2>&AS_MESSAGE_LOG_FD],[ > AC_MSG_RESULT([yes]) > > # Print the version to help with debugging.With Eric's suggested changes, this is fine. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://people.redhat.com/~rjones/virt-top