Fix platform validation for wasm32-wasip1 target (#2894)

This fix validation errors for the new `wasm32-wasip1` target. The older
`wasm32-wasi` is already covered. Fixes #2782

Signed-off-by: Chaitanya Munukutla <chaitanya.m61292@gmail.com>
Co-authored-by: UebelAndre <github@uebelandre.com>
This commit is contained in:
Chaitanya Munukutla 2024-10-03 20:36:00 +05:30 committed by GitHub
parent 9594fa70b5
commit ab50fce75f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 4 deletions

View File

@ -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,
)

View File

@ -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)