From: David Chase Date: Fri, 27 Sep 2024 23:15:03 +0000 (-0400) Subject: cmd/go: adjust test with tricky ld flags to not run on Darwin X-Git-Tag: go1.24rc1~748 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=2f507985dc24d198b763e5568ebe5c04d788894f;p=gostls13.git cmd/go: adjust test with tricky ld flags to not run on Darwin normally this would not run on darwin anyway, but if there happens to be a "pkg-config" binary, then it will. Darwin's clang/linker does not have this flag. Change-Id: I61929cf193c95b420441187beb8b237fa1037807 Reviewed-on: https://go-review.googlesource.com/c/go/+/616376 LUCI-TryBot-Result: Go LUCI Reviewed-by: Sam Thanawalla Reviewed-by: Michael Matloob --- diff --git a/src/cmd/go/go_test.go b/src/cmd/go/go_test.go index b99656d3ce..c24ab2a794 100644 --- a/src/cmd/go/go_test.go +++ b/src/cmd/go/go_test.go @@ -1505,13 +1505,16 @@ func main() { tg.setenv("PKG_CONFIG_PATH", tg.path(".")) tg.run("run", tg.path("foo.go")) - // test for ldflags - tg.tempFile("bar.pc", ` + if runtime.GOOS != "darwin" { // darwin doesn't like these ldflags + // test for ldflags + tg.tempFile("bar.pc", ` Name: bar Description: The bar library Version: 1.0.0 Libs: -Wl,-rpath=/path\ with\ spaces/bin `) + } + tg.tempFile("bar.go", `package main /* #cgo pkg-config: bar