Skip to content

Commit 015e945

Browse files
author
Rules WASM Component
committed
fix: use valid WASM target triples for rules_rust compatibility
Remove invalid target triples that are not supported by rules_rust and update to use standard WASM targets. Changes: - Remove wasm32-wasip1 and wasm32-wasip2 (not valid rules_rust targets) - Use wasm32-wasi (WASI Preview 1, supported by rules_rust) - Keep wasm32-unknown-unknown (standard WASM target) - Update WASM_TARGET_TRIPLE constant to use valid triple - Update helper function to use supported targets This resolves the rules_rust extension error about invalid target triples and ensures compatibility with the current rules_rust version.
1 parent f0d816b commit 015e945

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

MODULE.bazel

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ rust.toolchain(
2323
extra_target_triples = [
2424
"wasm32-unknown-unknown",
2525
"wasm32-wasi",
26-
"wasm32-wasip1",
27-
"wasm32-wasip2",
2826
],
2927
)
3028
use_repo(rust, "rust_toolchains")

common/common.bzl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
"""Common constants and utilities"""
22

33
# WebAssembly target triples
4-
WASM_TARGET_TRIPLE = "wasm32-wasip2"
5-
WASM_TARGET_TRIPLE_P1 = "wasm32-wasip1"
4+
WASM_TARGET_TRIPLE = "wasm32-wasi" # WASI Preview 1 (supported by rules_rust)
65
WASM_TARGET_TRIPLE_UNKNOWN = "wasm32-unknown-unknown"
76

87
# File extensions
98
WASM_EXTENSION = ".wasm"
109
WIT_EXTENSION = ".wit"
1110

12-
def get_wasm_target(preview2 = True):
11+
def get_wasm_target(unknown = False):
1312
"""Get the appropriate WASM target triple"""
14-
return WASM_TARGET_TRIPLE if preview2 else WASM_TARGET_TRIPLE_P1
13+
return WASM_TARGET_TRIPLE_UNKNOWN if unknown else WASM_TARGET_TRIPLE

0 commit comments

Comments
 (0)