-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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/link: running go build -ldflags "-B <SHA1>" fails in Go 1.23.3 on macOS #70380
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
Comments
Ok, it looks like we can switch our builds to do We were doing this workaround before 089cc68676 was around. |
We can't remove the length restriction, as macOS UUID has a fixed length. Yeah, you discovered |
praveenkumar
added a commit
to praveenkumar/crc
that referenced
this issue
Feb 4, 2025
As of now, a random build ID (20 digits) generated and added to binary but with go-1.23.x it is causing following issue in the CI ``` /usr/lib/golang/pkg/tool/linux_amd64/link: -B option too long (max 16 digits): 0x1c32bce09ea23923c57a3cca65fd91e377714192 ``` Looks like `gobuilid` can be used to generate it with -B options without random ID hack and it can work without isssue for CI - golang/go#70380 ``` $ readelf -n out/linux-amd64/crc Displaying notes found in: .note.gnu.property Owner Data size Description GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0 Properties: x86 ISA needed: x86-64-baseline Displaying notes found in: .note.gnu.build-id Owner Data size Description GNU 0x00000014 NT_GNU_BUILD_ID (unique build ID bitstring) Build ID: f1c4d1d70301bc12737353faf4ee38de3cd25930 ```
praveenkumar
added a commit
to praveenkumar/crc
that referenced
this issue
Feb 4, 2025
As of now, a random build ID (20 digits) generated and added to binary but with go-1.23.x it is causing following issue in the CI ``` /usr/lib/golang/pkg/tool/linux_amd64/link: -B option too long (max 16 digits): 0x1c32bce09ea23923c57a3cca65fd91e377714192 ``` Looks like `gobuilid` can be used to generate it with -B options without random ID and it can work without isssue for CI - golang/go#70380 ``` $ readelf -n out/linux-amd64/crc Displaying notes found in: .note.gnu.property Owner Data size Description GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0 Properties: x86 ISA needed: x86-64-baseline Displaying notes found in: .note.gnu.build-id Owner Data size Description GNU 0x00000014 NT_GNU_BUILD_ID (unique build ID bitstring) Build ID: f1c4d1d70301bc12737353faf4ee38de3cd25930 ```
praveenkumar
added a commit
to crc-org/crc
that referenced
this issue
Feb 4, 2025
Loading
Loading status checks…
As of now, a random build ID (20 digits) generated and added to binary but with go-1.23.x it is causing following issue in the CI ``` /usr/lib/golang/pkg/tool/linux_amd64/link: -B option too long (max 16 digits): 0x1c32bce09ea23923c57a3cca65fd91e377714192 ``` Looks like `gobuilid` can be used to generate it with -B options without random ID and it can work without isssue for CI - golang/go#70380 ``` $ readelf -n out/linux-amd64/crc Displaying notes found in: .note.gnu.property Owner Data size Description GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0 Properties: x86 ISA needed: x86-64-baseline Displaying notes found in: .note.gnu.build-id Owner Data size Description GNU 0x00000014 NT_GNU_BUILD_ID (unique build ID bitstring) Build ID: f1c4d1d70301bc12737353faf4ee38de3cd25930 ```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Go version
go version go1.23.3 darwin/arm64
Output of
go env
in your module/workspace:What did you do?
We create binaries with our own GNU build IDs. This used to work fine in Go 1.23.2, but it now fails in Go 1.23.3.
To reproduce, create
test.go
:Then run:
I believe 5472853 (the fix for #68678 (comment)) caused this issue. Now on macOS, the build IDs can only be 16 characters.
@cherrymui Can we remove this restriction?
What did you see happen?
What did you expect to see?
No build errors.
The text was updated successfully, but these errors were encountered: