-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/go: macOS plugin builds are not reproducible #58557
Comments
Temporary directory is in |
It looks like there is an existing case here that attempts to mitigate |
Change https://go.dev/cl/477296 mentions this issue: |
There is already a case that when buildmode=shared passes only the basename of the -o argument to the link command to the linker (and runs in the directory of that argument) to avoid having that (temporary) directory of the file be included in the LC_ID_DYLIB load command. Extend the case to buildmode=plugin, because the same thing can happen there. This can only happen on darwin: the -o command can be embedded into Mach-O and PE binaries, but plugin isn't supported on Windows. For #58557 Change-Id: I7a4a5627148e77c6906ac4583af3d9f053d5b249 Reviewed-on: https://go-review.googlesource.com/c/go/+/477296 Run-TryBot: Michael Matloob <matloob@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Michael Matloob <matloob@golang.org>
Change https://go.dev/cl/478196 mentions this issue: |
On Linux, for a shared object, at least with the Gold linker, the output file path is recorded in the .gnu.version_d section. When the output file path is in a temporary directory, it causes nondeterministic build. This is similar to #58557, but for Linux with the Gold linker. Apply the same workaround as in CL 477296. Should fix the linux-arm64-longtest builder. Change-Id: Ic703bff32c1bcc40054b89be696e04280855e876 Reviewed-on: https://go-review.googlesource.com/c/go/+/478196 Run-TryBot: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com>
Change https://go.dev/cl/494577 mentions this issue: |
This avoids printing verbose binary data and making bell sounds when the test fails. The binary data can be inspected via other means if needed. For #58557. Change-Id: Ia1c4f2c6b9ff2cf6f97611cf335b978fc7bb201f Reviewed-on: https://go-review.googlesource.com/c/go/+/494577 Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Bryan Mills <bcmills@google.com>
What version of Go are you using (
go version
)?Tested with Go 1.19 and Go 1.20
Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I have created a package with single
main
function and built it on Mac twice as a plugin:The resulting binaries differ.
Reproducer is at https://github.com/misha-ridge/test-plugin-build
What did you expect to see?
I expected the binaries to be identical.
What did you see instead?
Plugin embeds a temporary directory path, plus some other differences that might be related to it:
The text was updated successfully, but these errors were encountered: