-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/link: go test on darwin/arm64 produces invalid code signature in combination with cgo #43105
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
Comments
Change https://golang.org/cl/276693 mentions this issue: |
@oxisto Thanks for report. Does CL https://golang.org/cl/276693 work? Thanks. |
It works. Nice, thanks for for the very quick response
I also checked it against a bigger project (I am currently trying to fix delve's native backend on darwin - see go-delve/delve#2254) and this was blocking me, but it works flawlessly now! |
@oxisto thanks for confirming! |
What version of Go are you using (
go version
)?What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
For reproducibility I have created a minimum viable failing program in the repository here: https://github.com/oxisto/go-test-cgo-fail
I am trying to run
go test
with a go program that makes use of cgo to call native functions. The main purpose of those function is some low level macOS stuff, that also requirements entitlements. I will not go into detail about the actual entitlement signing process, because it is not relevant to the error. Important to know is, thatcodesign
needs a valid code signature on the binary in order to proceed. This works without any problem forgo build
with the master branch after #42684 was implemented and can be checked byHowever, if I try to do the same with a binary produced by
go test
, it fails the code signing check and thus I cannot proceed with my entitlements.Trying
go test
without any cgo / native code works fine and produces a valid code signature. Interesting to know is that also, while this has the effect that it cannot be signed any further, i.e. with entitlements, the signature seems to be "ok enough" for macOS to actually execute.The weird thing is that for a while I was using
gotip download 272258
(from #42684), everything worked, then I switched tomaster
, the problem came up and now even switching back to the old go tip does not seem to clear the error. So I would appreciate if anyone else with a darwin arm64 device can try to reproduce this.What did you expect to see?
What did you see instead?
The text was updated successfully, but these errors were encountered: