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

Bug#873929: gcc7: Enable libgo tests and rebuilds with make -C



On Sat, 2017-09-02 at 04:07 +0200, Matthias Klose wrote:
> On 01.09.2017 23:11, Svante Signell wrote:
> > On Fri, 2017-09-01 at 13:32 +0200, Matthias Klose wrote:
> > > On 01.09.2017 11:55, Svante Signell wrote:
> > > > Source: gcc-7
> > > > Version: 7.2.0-2
> > > > Severity: important
> > > > Tags: patch
> > > > 
> > > > 
> > > > (The GOBENCH = entry is due to a trailing white space in the
> > > > original
> > > > file)
> > > 
> > > ok, this is the libgo-testsuite.diff patch.  Why do you test
> > > USE_DEJAGNU twice then?
> > 
> > I just found out that the test suite does not run properly, and
> > created the patch making that Makefile snippet being the same as
> > for gcc-6. The if then else fi logic is broken:
> > See e.g. https://buildd.debian.org/status/fetch.php?pkg=gcc-
> > 7&arch=amd64&ver=7.2.0-2&stamp=1504127698&raw=0
> > for failed build logs.
> > 
> > > The go testsuite is special, because it's normally run from every
> > > multilib directory instead of the top libdir only.
> > 
> > Sorry, I don't (yet) know what you mean, but will in due time.
> > Perhaps
> > with your help?
> 
> if you look at the check target for all other target libraries, then
> you'll see that it doesn't descend into the multilib directories,
> e.g. 32 and x32 on amd64, which it does for all target libs besides
> libgo.  Instead the target libraries are iterated what you specifiy
> in RUNTESTFLAGS.  libgo doesn't do that, and descends into the non-
> default multilib dirs itself.  This can be a problem if you don't
> have a kernel running which understands all multilib variants, e.g.
> x32. I'm happy to drop any of these patches, but a test run shouldn't
> try to execute multilib variants when current running kernel doesn't
> support it.

If I understand you correctly the behavior in gcc-6 is correct.
Attached is an updated libgo-testsuite.diff file fixing the if-then-
else-fi logic in the same way as for gcc-6 (including the whitespace
fix). Tested on an amd64 box, and only the 64-bit target is run.

The other patch, libgo-Makefile.diff, adds to the CLEANFILES enabling
libgo rebuilds with make -C ...


Index: gcc-7-7.2.0/src/libgo/Makefile.am
===================================================================
--- gcc-7-7.2.0.orig/src/libgo/Makefile.am
+++ gcc-7-7.2.0/src/libgo/Makefile.am
@@ -1423,7 +1423,9 @@ mostlyclean-local:
 	find . -name '*-testsum' -print | xargs rm -f
 	find . -name '*-testlog' -print | xargs rm -f
 
-CLEANFILES = *.go *.gox goc2c *.c s-version libgo.sum libgo.log
+CLEANFILES = *.go *.gox goc2c *.c s-* libgo.sum libgo.log \
+	*.dep */*.dep */*/*.dep */*/*/*.dep */*/*.dep */*/*/*/*.dep \
+	*/*/*/*/*/*.dep
 
 clean-local:
 	find . -name '*.la' -print | xargs $(LIBTOOL) --mode=clean rm -f
Index: gcc-7-7.2.0/src/libgo/Makefile.in
===================================================================
--- gcc-7-7.2.0.orig/src/libgo/Makefile.in
+++ gcc-7-7.2.0/src/libgo/Makefile.in
@@ -1347,7 +1347,10 @@ TEST_PACKAGES = \
 	unicode/utf8/check
 
 MOSTLYCLEAN_FILES = libgo.head libgo.sum.sep libgo.log.sep
-CLEANFILES = *.go *.gox goc2c *.c s-version libgo.sum libgo.log
+CLEANFILES = *.go *.gox goc2c *.c s-* libgo.sum libgo.log \
+	*.dep */*.dep */*/*.dep */*/*/*.dep */*/*.dep */*/*/*/*.dep \
+	*/*/*/*/*/*.dep
+
 all: config.h
 	$(MAKE) $(AM_MAKEFLAGS) all-recursive
 
# DP: Only run the libgo testsuite for flags configured in RUNTESTFLAGS

Index: gcc-7-7.2.0/src/libgo/Makefile.am
===================================================================
--- gcc-7-7.2.0.orig/src/libgo/Makefile.am
+++ gcc-7-7.2.0/src/libgo/Makefile.am
@@ -929,7 +929,7 @@ BUILDGOX = \
 	$(SHELL) $(srcdir)/mvifdiff.sh $@.tmp `echo $@ | sed -e 's/s-gox/gox/'`
 
 GOTESTFLAGS =
-GOBENCH = 
+GOBENCH =
 
 # Check a package.
 CHECK = \
@@ -948,6 +948,12 @@ CHECK = \
 	$(MKDIR_P) $(@D); \
 	rm -f $@-testsum $@-testlog; \
 	files=`$(SHELL) $(srcdir)/match.sh --goarch=$(GOARCH) --goos=$(GOOS) --srcdir=$(srcdir)/go/$(@D) --extrafiles="$(extra_go_files_$(subst /,_,$(@D)))" $(matchargs_$(subst /,_,$(@D)))`; \
+	run_check=yes; \
+	MULTILIBDIR="$(MULTILIBDIR)"; \
+	case "$$MULTILIBDIR" in /64|/x32) \
+	  echo "$$RUNTESTFLAGS" | grep -q "$${MULTILIBDIR\#/*}" || run_check=; \
+	esac; \
+	if test "$$run_check" = "yes"; then \
 	if test "$(USE_DEJAGNU)" = "yes"; then \
 	  $(SHELL) $(srcdir)/testsuite/gotest --goarch=$(GOARCH) --goos=$(GOOS) --dejagnu=yes --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --pkgpath="$(@D)" --pkgfiles="$$files" --testname="$(@D)" $(GOTESTFLAGS); \
 	elif test "$(GOBENCH)" != ""; then \
@@ -963,6 +969,7 @@ CHECK = \
 	    echo "FAIL: $(@D)" > $@-testsum; \
 	    exit 1; \
 	  fi; \
+	fi; \
 	fi
 
 # Build all packages before checking any.
Index: gcc-7-7.2.0/src/libgo/Makefile.in
===================================================================
--- gcc-7-7.2.0.orig/src/libgo/Makefile.in
+++ gcc-7-7.2.0/src/libgo/Makefile.in
@@ -1085,7 +1085,7 @@ BUILDGOX = \
 	$(SHELL) $(srcdir)/mvifdiff.sh $@.tmp `echo $@ | sed -e 's/s-gox/gox/'`
 
 GOTESTFLAGS = 
-GOBENCH = 
+GOBENCH =
 
 # Check a package.
 CHECK = \
@@ -1104,6 +1104,12 @@ CHECK = \
 	$(MKDIR_P) $(@D); \
 	rm -f $@-testsum $@-testlog; \
 	files=`$(SHELL) $(srcdir)/match.sh --goarch=$(GOARCH) --goos=$(GOOS) --srcdir=$(srcdir)/go/$(@D) --extrafiles="$(extra_go_files_$(subst /,_,$(@D)))" $(matchargs_$(subst /,_,$(@D)))`; \
+	run_check=yes; \
+	MULTILIBDIR="$(MULTILIBDIR)"; \
+	case "$$MULTILIBDIR" in /64|/x32) \
+	  echo "$$RUNTESTFLAGS" | grep -q "$${MULTILIBDIR\#/*}" || run_check=; \
+	esac; \
+	if test "$$run_check" = "yes"; then \
 	if test "$(USE_DEJAGNU)" = "yes"; then \
 	  $(SHELL) $(srcdir)/testsuite/gotest --goarch=$(GOARCH) --goos=$(GOOS) --dejagnu=yes --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --pkgpath="$(@D)" --pkgfiles="$$files" --testname="$(@D)" $(GOTESTFLAGS); \
 	elif test "$(GOBENCH)" != ""; then \
@@ -1119,6 +1125,7 @@ CHECK = \
 	    echo "FAIL: $(@D)" > $@-testsum; \
 	    exit 1; \
 	  fi; \
+	fi; \
 	fi
 
 

Reply to: