-
-
Notifications
You must be signed in to change notification settings - Fork 670
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
Go package driver doesn't work with Go 1.18 #3080
Labels
IDE
Go package driver and IDE support
Comments
+1, I got a very similar bug with go 1.18 (stable, darwin_amd64) + bazel 5.0.0 + rules_go 0.30. external/go_sdk/src/crypto/elliptic/p256_asm.go:24:12: pattern p256_asm_table.bin: cannot embed irregular file p256_asm_table.bin
bazel-out/host/bin/external/org_golang_x_mobile/cmd/gomobile/gomobile_/gomobile: go build -v -buildmode=c-shared -o=/var/folders/lm/g6r0qpk15dsdklyy9w35dh040000gp/T/gomobile-work-1280566553/android/src/main/jniLibs/arm64-v8a/libgojni.so gobind failed: exit status 1 |
Same here. bazel 5.0.0 and rules_go v0.31.0 |
@linzhp it looks like the new release bumps the golang version to 1.18.x but this fix didn't land, does that mean auto completion is now broken with the configuration suggested in the README.md? |
Yeah, sorry, @xytan0056 may work on #3083 soon. |
xytan0056
pushed a commit
to xytan0056/rules_go
that referenced
this issue
May 12, 2022
The stdliblist operation that the gopackagesdriver relies on fails on Go 1.18rc1 with the following error: ``` external/go_sdk/src/crypto/elliptic/p256_asm.go:24:12: pattern p256_asm_table.bin: cannot embed irregular file p256_asm_table.bin ``` We see this failure because Bazel builds a symlink tree of the GOROOT run `go list` with. However, since [CL 380475][1], the Go standard library uses `go:embed` to embed a file in `crypto/elliptic`, but `go:embed` does not support symlinks. [1]: https://go.dev/cl/380475 Fix this by having stdliblist copy the relevant portions of the GOROOT to run `go list` with. This matches [what the stdlib action does][2]. [2]: https://github.com/bazelbuild/rules_go/blob/e9a7054ff11a520e3b8aceb76a3ba44bb8da4c94/go/tools/builders/stdlib.go#L54-L57 Resolves bazel-contrib#3080
linzhp
pushed a commit
that referenced
this issue
May 19, 2022
…or stdliblist.go (#3157) * stdliblist: Fix for Go 1.18 by replicating stdlib The stdliblist operation that the gopackagesdriver relies on fails on Go 1.18rc1 with the following error: ``` external/go_sdk/src/crypto/elliptic/p256_asm.go:24:12: pattern p256_asm_table.bin: cannot embed irregular file p256_asm_table.bin ``` We see this failure because Bazel builds a symlink tree of the GOROOT run `go list` with. However, since [CL 380475][1], the Go standard library uses `go:embed` to embed a file in `crypto/elliptic`, but `go:embed` does not support symlinks. [1]: https://go.dev/cl/380475 Fix this by having stdliblist copy the relevant portions of the GOROOT to run `go list` with. This matches [what the stdlib action does][2]. [2]: https://github.com/bazelbuild/rules_go/blob/e9a7054ff11a520e3b8aceb76a3ba44bb8da4c94/go/tools/builders/stdlib.go#L54-L57 Resolves #3080 * test/stdlib: Depend on _list_json Add a dependency on `GoStdLib._list_json` to the stdlib test. This ensures that we can successfully build the JSON data needed by the gopackagesdriver.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Current package driver calls
builder stdliblist
to get information for std libraries.stdliblist
callsgo list
:https://github.com/bazelbuild/rules_go/blob/e9a7054ff11a520e3b8aceb76a3ba44bb8da4c94/go/tools/builders/stdliblist.go#L148-L149
This caused two problems:
go list
stdliblist
callsgo list
, it is in Bazel's sandbox, where all Go files of std libraries are symlinks. One of the Go files in 1.18 embeds a binary file, which would break when the binary file is a symlink, leading to errors like:What version of rules_go are you using?
0.30
What version of Bazel are you using?
5.0.0
What version of Go are you using?
Go 1.18rc1
Does this issue reproduce with the latest releases of all the above?
Yes
What operating system and processor architecture are you using?
macOS arm64
Any other potentially useful information about your toolchain?
The text was updated successfully, but these errors were encountered: