Skip to content

Commit

Permalink
Fix platform validation for wasm32-wasip1 target (#2894)
Browse files Browse the repository at this point in the history
This fix validation errors for the new `wasm32-wasip1` target. The older
`wasm32-wasi` is already covered. Fixes #2782

Signed-off-by: Chaitanya Munukutla <[email protected]>
Co-authored-by: UebelAndre <[email protected]>
  • Loading branch information
c16a and UebelAndre authored Oct 3, 2024
1 parent 9594fa7 commit ab50fce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
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

0 comments on commit ab50fce

Please sign in to comment.