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

Fix platform validation for wasm32-wasip1 target #2894

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions rust/platform/triple.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ def triple(triple):
- abi (str, optional): The abi to use or None if abi does not apply.
- str (str): Original string representation of the triple
"""
if triple == "wasm32-wasi":
if triple in ("wasm32-wasi", "wasm32-wasip1"):
return struct(
arch = "wasm32",
system = "wasi",
vendor = "wasi",
arch = triple.split("-")[0],
system = triple.split("-")[1],
vendor = triple.split("-")[1],
abi = None,
str = triple,
)
Expand Down
1 change: 1 addition & 0 deletions test/unit/platform_triple/platform_triple_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ def _construct_known_triples_test_impl(ctx):
_assert_parts(env, triple("thumbv8m.main-none-eabi"), "thumbv8m.main", None, "none", "eabi")
_assert_parts(env, triple("wasm32-unknown-unknown"), "wasm32", "unknown", "unknown", None)
_assert_parts(env, triple("wasm32-wasi"), "wasm32", "wasi", "wasi", None)
_assert_parts(env, triple("wasm32-wasip1"), "wasm32", "wasip1", "wasip1", None)
_assert_parts(env, triple("x86_64-fuchsia"), "x86_64", "fuchsia", "fuchsia", None)

return unittest.end(env)
Expand Down
Loading