-
-
Notifications
You must be signed in to change notification settings - Fork 668
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
linkmode = "c-shared"
cannot be used with wasm
#4200
Comments
Could you try removing the check that causes the failure? If that ends up working, it should be easy to fix properly. |
leonm1
added a commit
to leonm1/rules_go
that referenced
this issue
Dec 19, 2024
Go 1.24 added support for `GOOS=wasip1 GOARCH=wasm go build -buildmode=c-shared`; however, the rules_go starlark code contained validation against this. I also suppressed the addition of a `lib` prefix and the `.so` suffix for wasi reactors. Fixes bazel-contrib#4200 Signed-off-by: Matt Leon <[email protected]>
fmeum
pushed a commit
to leonm1/rules_go
that referenced
this issue
Dec 24, 2024
Go 1.24 added support for `GOOS=wasip1 GOARCH=wasm go build -buildmode=c-shared`; however, the rules_go starlark code contained validation against this. I also suppressed the addition of a `lib` prefix and the `.so` suffix for wasi reactors. Fixes bazel-contrib#4200 Signed-off-by: Matt Leon <[email protected]>
fmeum
pushed a commit
that referenced
this issue
Dec 24, 2024
**What type of PR is this?** Bug fix **What does this PR do? Why is it needed?** [Go 1.24](https://go.dev/doc/go1.24#wasm) added support for `GOOS=wasip1 GOARCH=wasm go build -buildmode=c-shared`; however, the rules_go starlark code contained validation against this. * Fixes validation error in newly supported go 1.24 wasip1-wasm tuple with -buildmode=c-shared. * Removes lib prefix for wasip1 -buildmode=c-shared * Adds `.wasm` suffix for wasi reactors built with `-buildmode=c-shared` **Which issues(s) does this PR fix?** Fixes #4200 **Other notes for review** It looks like this could use a test (as simple as adding a new go file under `tests/core/c_linkmodes/`); however, the support for features added in this PR requires Go 1.24, which is not out yet. Updating `go_register_toolchains(version = "1.24rc1")` does allow it to build, but then `nogo` fails due to lack of support in some of the linters for go 1.24. Signed-off-by: Matt Leon <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What version of rules_go are you using?
v0.51.0
What version of gazelle are you using?
N/A
What version of Bazel are you using?
6.5.0
Does this issue reproduce with the latest releases of all the above?
Yes.
What operating system and processor architecture are you using?
x86_64-linux
Any other potentially useful information about your toolchain?
Using go toolchain 1.24rc1
What did you do?
.bazelversion
:WORKSPACE
:BUILD
:main.go
:What did you expect to see?
Go 1.24 newly supports building wasm modules as wasi reactors: https://tip.golang.org/doc/go1.24#wasm.
I expected the module to be built with the go compiler invocation such as:
What did you see instead?
rules_go validation causes this to fail:
The text was updated successfully, but these errors were encountered: