-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMODULE.bazel
More file actions
86 lines (77 loc) · 2.45 KB
/
MODULE.bazel
File metadata and controls
86 lines (77 loc) · 2.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
"""WebAssembly Component Model Examples
Demonstrates building WASI components in C, C++, Go, Rust, and Rust P3 async
using pulseengine/rules_wasm_component.
"""
module(
name = "hello_wasm_components",
version = "0.3.0",
)
# Core dependency - WebAssembly Component Model rules
bazel_dep(name = "rules_wasm_component", version = "1.0.0")
# RULES_WASM_COMPONENT_OVERRIDE_START
git_override(
module_name = "rules_wasm_component",
remote = "https://github.com/pulseengine/rules_wasm_component.git",
branch = "main",
)
# RULES_WASM_COMPONENT_OVERRIDE_END
# Required transitive dependencies
bazel_dep(name = "rules_rust", version = "0.69.0")
bazel_dep(name = "bazel_skylib", version = "1.9.0")
bazel_dep(name = "platforms", version = "1.0.0")
bazel_dep(name = "rules_cc", version = "0.2.17")
bazel_dep(name = "rules_go", version = "0.60.0")
bazel_dep(name = "rules_oci", version = "2.3.0")
bazel_dep(name = "fmt", version = "11.0.2")
bazel_dep(name = "nlohmann_json", version = "3.11.3")
bazel_dep(name = "abseil-cpp", version = "20250814.0")
bazel_dep(name = "spdlog", version = "1.12.0")
# Override rules_rust with upstream main (includes #3727 fix)
git_override(
module_name = "rules_rust",
commit = "6281d27f3ffdb826df90db25c1dc66a198345d64",
remote = "https://github.com/bazelbuild/rules_rust.git",
)
# Rust toolchain
rust = use_extension("@rules_rust//rust:extensions.bzl", "rust")
rust.toolchain(
edition = "2021",
extra_target_triples = [
"wasm32-wasip1",
"wasm32-wasip2",
],
versions = ["1.91.1"],
)
use_repo(rust, "rust_toolchains")
register_toolchains("@rust_toolchains//:all")
# WASI WIT definitions
wasi_wit_ext = use_extension("@rules_wasm_component//wasm:extensions.bzl", "wasi_wit")
wasi_wit_ext.init()
use_repo(
wasi_wit_ext,
"wasi_cli",
"wasi_clocks",
"wasi_filesystem",
"wasi_http",
"wasi_io",
"wasi_nn",
"wasi_nn_v0_2_0_rc_2024_06_25",
"wasi_nn_v0_2_0_rc_2024_08_19",
"wasi_random",
"wasi_sockets",
)
# Crates for Rust examples
crate = use_extension("@rules_rust//crate_universe:extension.bzl", "crate")
crate.from_cargo(
name = "hello_crates",
cargo_lockfile = "//rust:Cargo.lock",
manifests = ["//rust:Cargo.toml"],
supported_platform_triples = [
"wasm32-wasip2",
"aarch64-apple-darwin",
"x86_64-apple-darwin",
"x86_64-unknown-linux-gnu",
"aarch64-unknown-linux-gnu",
],
)
use_repo(crate, "hello_crates", "crates")