Skip to content
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

Support Go 1.24's wasip1 reactors #4201

Merged
merged 1 commit into from
Dec 24, 2024
Merged

Conversation

leonm1
Copy link
Contributor

@leonm1 leonm1 commented Dec 19, 2024

What type of PR is this?

Bug fix

What does this PR do? Why is it needed?

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.

  • 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.

@leonm1
Copy link
Contributor Author

leonm1 commented Dec 19, 2024

@fmeum would you be able to review this PR?

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
Copy link
Member

fmeum commented Dec 24, 2024

Thanks! We can add a test after Go 1.24 has been released.

@fmeum fmeum enabled auto-merge (squash) December 24, 2024 09:26
@fmeum fmeum merged commit 6505cf2 into bazel-contrib:master Dec 24, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

linkmode = "c-shared" cannot be used with wasm
2 participants