]> Cypherpunks repositories - gostls13.git/commit
misc/cgo/testplugin: set the package name in TestIssue19534
authorBryan C. Mills <bcmills@google.com>
Thu, 19 May 2022 14:41:32 +0000 (10:41 -0400)
committerGopher Robot <gobot@golang.org>
Thu, 19 May 2022 15:38:08 +0000 (15:38 +0000)
commite23cc0844d542688c0956900206fca7c602593c5
treed281096aa2c494dc2f37e9a6ed0c90938f01d04f
parent0aa8a87b5d8f9425ed4c1b66b85e453bef8b7f29
misc/cgo/testplugin: set the package name in TestIssue19534

The fix for #19534 (in CL 40994) adjusted escaping in the
dynamically-linked name lookup logic for the plugin package. However,
the regression test added for it incorrectly included quotes within
the -ldflags flag, causing the flag to inadvertently be ignored.

Possibly in that same CL or possibly at some other point, the
condition that the test thought it was checking stopped working: the
dynamic lookup used the path passed to ldflags, but the object file
actually contained the symbol indexed by the original package name.

Ideally we should stop mucking around with ldflags in this test and
run 'go build' from a suitably-named directory instead, to mimic the
actual conditions in which the original bug was reported. For now, as
a more targeted fix, we can pass the '-p' flag to the compiler to
adjust the package path used at compile time to match the one that
will be set at link time.

For #43177.
Updates #19534.

Change-Id: I9763961feb37cfb05dee543f273492e91a350663
Reviewed-on: https://go-review.googlesource.com/c/go/+/407314
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
misc/cgo/testplugin/plugin_test.go