diff options
author | Sören Tempel <soeren+git@soeren-tempel.net> | 2020-04-14 20:02:12 +0200 |
---|---|---|
committer | Sören Tempel <soeren+git@soeren-tempel.net> | 2020-04-14 20:38:13 +0200 |
commit | d466dae2f813ab2125d3de16e00f4c72020d2893 (patch) | |
tree | 30c19da590f0a22058dcc5ab799241b7af8799d9 /community/go | |
parent | b5b340734c9f745798a1e735a1b11710ef301237 (diff) | |
download | aports-d466dae2f813ab2125d3de16e00f4c72020d2893.tar.bz2 aports-d466dae2f813ab2125d3de16e00f4c72020d2893.tar.xz |
community/go: enable more parts of the test suite
Only cgo_test is disabled as `../misc/cgo/test` seems to hang for some
reason. All other tests pass on all architecture as we don't pass
-builmode=pie unconditionally anymore.
Diffstat (limited to 'community/go')
-rw-r--r-- | community/go/0001-Fix-FTBFS-on-HOME-managed-with-git.patch | 84 | ||||
-rw-r--r-- | community/go/APKBUILD | 14 |
2 files changed, 90 insertions, 8 deletions
diff --git a/community/go/0001-Fix-FTBFS-on-HOME-managed-with-git.patch b/community/go/0001-Fix-FTBFS-on-HOME-managed-with-git.patch new file mode 100644 index 0000000000..85d4eee96a --- /dev/null +++ b/community/go/0001-Fix-FTBFS-on-HOME-managed-with-git.patch @@ -0,0 +1,84 @@ +From: "Bryan C. Mills" <bcmills@google.com> +Date: Fri, 13 Mar 2020 12:51:09 -0400 +Subject: Fix FTBFS on $HOME managed with git. +MIME-Version: 1.0 +Content-Type: text/plain; charset="utf-8" +Content-Transfer-Encoding: 8bit + +This is a cherry-pick of +https://github.com/golang/go/commit/e2a9ea035d73df84c813132417366e8e01777c8d + +cmd/go/internal/modload: suppress the 'go mod init' hint for GOROOT more aggressively + +Previously, we suppressed a `to create a module there, run: … go mod +init' warning only if the config file itself (such as .git/config) was +found in GOROOT. However, our release tarballs don't include the +.git/config, so that case was not encountered, and the warning could +occur based on a config file found in some parent directory (outside +of GOROOT entirely). + +Instead, skip the directory walk completely if the working directory +is anywhere in GOROOT. + +Fixes #34191 + +Change-Id: I9f774901bfbb53b700407c4882f37d6339d023fe +Reviewed-on: https://go-review.googlesource.com/c/go/+/223340 +Run-TryBot: Bryan C. Mills <bcmills@google.com> +Reviewed-by: Jay Conrod <jayconrod@google.com> +--- + src/cmd/go/internal/modload/init.go | 9 +++++---- + src/cmd/go/testdata/script/mod_convert_git.txt | 17 +++++++++++++++++ + 2 files changed, 22 insertions(+), 4 deletions(-) + +diff --git a/src/cmd/go/internal/modload/init.go b/src/cmd/go/internal/modload/init.go +index 61cbdf2..a73d858 100644 +--- a/src/cmd/go/internal/modload/init.go ++++ b/src/cmd/go/internal/modload/init.go +@@ -740,13 +740,14 @@ func findAltConfig(dir string) (root, name string) { + panic("dir not set") + } + dir = filepath.Clean(dir) ++ if rel := search.InDir(dir, cfg.BuildContext.GOROOT); rel != "" { ++ // Don't suggest creating a module from $GOROOT/.git/config ++ // or a config file found in any parent of $GOROOT (see #34191). ++ return "", "" ++ } + for { + for _, name := range altConfigs { + if fi, err := os.Stat(filepath.Join(dir, name)); err == nil && !fi.IsDir() { +- if rel := search.InDir(dir, cfg.BuildContext.GOROOT); rel == "." { +- // Don't suggest creating a module from $GOROOT/.git/config. +- return "", "" +- } + return dir, name + } + } +diff --git a/src/cmd/go/testdata/script/mod_convert_git.txt b/src/cmd/go/testdata/script/mod_convert_git.txt +index ece505a..6ff1eb5 100644 +--- a/src/cmd/go/testdata/script/mod_convert_git.txt ++++ b/src/cmd/go/testdata/script/mod_convert_git.txt +@@ -18,6 +18,23 @@ cd $GOROOT + ! go list . + ! stderr 'go mod init' + ++# We should also not suggest creating a go.mod file in $GOROOT if its own ++# .git/config has been stripped away and we find one in a parent directory. ++# (https://golang.org/issue/34191) ++env GOROOT=$WORK/parent/goroot ++cd $GOROOT ++! go list . ++! stderr 'go mod init' ++ ++cd $GOROOT/doc ++! go list . ++! stderr 'go mod init' ++ + -- $WORK/test/.git/config -- + -- $WORK/test/x/x.go -- + package x // import "m/x" ++-- $WORK/parent/.git/config -- ++-- $WORK/parent/goroot/README -- ++This directory isn't really a GOROOT, but let's pretend that it is. ++-- $WORK/parent/goroot/doc/README -- ++This is a subdirectory of our fake GOROOT. diff --git a/community/go/APKBUILD b/community/go/APKBUILD index 036a99a05f..e4305b4c1e 100644 --- a/community/go/APKBUILD +++ b/community/go/APKBUILD @@ -4,7 +4,7 @@ pkgname=go # go binaries are statically linked, security updates require rebuilds pkgver=1.14.2 -pkgrel=0 +pkgrel=1 pkgdesc="Go programming language compiler" url="https://golang.org/" arch="all" @@ -15,6 +15,7 @@ checkdepends="binutils-gold" subpackages="$pkgname-doc" source="https://golang.org/dl/go${pkgver/_/}.src.tar.gz disable-flaky-sync-test.patch + 0001-Fix-FTBFS-on-HOME-managed-with-git.patch " case "$CARCH" in @@ -41,10 +42,6 @@ esac # NOTE: building go for x86 with grsec kernel requires: # sysctl -w kernel.modify_ldt=1 -# The following tests fail currently, most of them fail due to linking -# errors likely related to 'default-buildmode-pie.patch' or musl libc. -_brokentests="runtime debug/gosym cmd/.* cgo.* go_test:os/exec ^test.*" - if [ "$CBUILD" = "$CTARGET" ]; then makedepends="go-bootstrap $makedepends" provides="go-bootstrap=$pkgver-r$pkgrel" @@ -111,8 +108,8 @@ build() { check() { cd "$builddir/src" - PATH="$builddir/bin:$PATH" ./run.bash -no-rebuild \ - -run "!($(echo "$_brokentests" | tr " " "|"))$" + # TODO: `../misc/cgo/test` hangs for some reason, investigate. + PATH="$builddir/bin:$PATH" ./run.bash -no-rebuild -run='!(^cgo_test$)' } package() { @@ -148,4 +145,5 @@ package() { } sha512sums="3f6804e1a60df6a7c55c294fe4147b2d6f028c619ad4ae5b1ae8793c6be637a1e6a62721cc7ce0b28918ab3441a89fa9acda72cb5450bf5af8d7872411d28015 go1.14.2.src.tar.gz -6ce14ca43fd35520e667530af91cfcad8902d635e6dd8c04d19428299b9e29ba049120f5eebbb00717a895f052d1cc40d3f522c090786625cce726715a8218ec disable-flaky-sync-test.patch" +6ce14ca43fd35520e667530af91cfcad8902d635e6dd8c04d19428299b9e29ba049120f5eebbb00717a895f052d1cc40d3f522c090786625cce726715a8218ec disable-flaky-sync-test.patch +dc255153a3c09766c10e613fa5ec90e870382dc24129c96c69e0adbeb46383b7dafc72b68376dcb7250fc34f44da26bfbb329d255d744f2f6ab09f5fdb278d40 0001-Fix-FTBFS-on-HOME-managed-with-git.patch" |