-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMODULE.bazel
More file actions
152 lines (126 loc) · 5.08 KB
/
Copy pathMODULE.bazel
File metadata and controls
152 lines (126 loc) · 5.08 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
"""Bazel Module for wsc - WebAssembly Signature Component"""
module(
name = "wsc",
# Keep in sync with [workspace.package].version in Cargo.toml.
version = "0.11.0",
)
# Dependencies
bazel_dep(name = "rules_rust", version = "0.65.0")
bazel_dep(name = "rules_cc", version = "0.2.4")
bazel_dep(name = "bazel_skylib", version = "1.8.1")
bazel_dep(name = "platforms", version = "1.0.0")
# Pin rules_go to a version compatible with Bazel 8.5.0
# This overrides the transitive dependency from rules_wasm_component
bazel_dep(name = "rules_go", version = "0.53.0")
# Force this version for all transitive dependencies
single_version_override(
module_name = "rules_go",
version = "0.53.0",
)
# Enable C++ toolchain auto-configuration for cross-platform support
cc_configure = use_extension("@rules_cc//cc:extensions.bzl", "cc_configure")
use_repo(cc_configure, "local_config_cc")
# WebAssembly Component Model support
bazel_dep(name = "rules_wasm_component", version = "1.0.0")
# Git repository override - use pulseengine fork with latest fixes
# Note: Using older commit to avoid componentize-py canary checksum issues
# The newer commits (58b80d2+) have unstable canary checksums that break CI
git_override(
module_name = "rules_wasm_component",
commit = "27eefae46a6b542fedf066d924a3c07a7b3d6f6a", # Stable: hermetic Go tools + go_sum support
remote = "https://github.com/pulseengine/rules_wasm_component.git",
)
# Local development override - use local rules_wasm_component (disabled for CI)
# Uncomment for local development if you have rules_wasm_component checked out locally
# local_path_override(
# module_name = "rules_wasm_component",
# path = "../rules_wasm_component",
# )
# Rust toolchain setup
rust = use_extension("@rules_rust//rust:extensions.bzl", "rust")
rust.toolchain(
edition = "2024",
extra_target_triples = [
"wasm32-wasip2", # WASI Preview 2 for component builds
],
versions = ["1.90.0"],
)
use_repo(rust, "rust_toolchains")
register_toolchains("@rust_toolchains//:all")
# Rust crate dependencies via crate_universe
# NOTE: rust_wasm_component uses Bazel's rust_shared_library, which requires
# dependencies to be Bazel targets, not Cargo dependencies!
crate = use_extension("@rules_rust//crate_universe:extension.bzl", "crate")
crate.from_cargo(
name = "wsc_deps",
cargo_lockfile = "//:Cargo.lock",
manifests = ["//:Cargo.toml"], # Workspace root is sufficient
supported_platform_triples = [
"x86_64-unknown-linux-gnu",
"aarch64-unknown-linux-gnu",
"aarch64-apple-darwin",
"x86_64-apple-darwin",
"x86_64-pc-windows-msvc",
"wasm32-wasip2", # WASM target support
],
)
use_repo(crate, "wsc_deps")
# WASI WIT interface 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_random",
"wasi_sockets",
)
# WebAssembly toolchains
wasm_toolchain = use_extension("@rules_wasm_component//wasm:extensions.bzl", "wasm_toolchain")
wasm_toolchain.register(
name = "wasm_tools",
strategy = "download", # Use pre-built binaries for faster builds
version = "1.240.0",
)
use_repo(wasm_toolchain, "wasm_tools_toolchains")
register_toolchains("@wasm_tools_toolchains//:wasm_tools_toolchain")
# Register C++ toolchains explicitly for cross-platform compatibility
# This ensures CI environments have proper C++ toolchain resolution
register_toolchains("@bazel_tools//tools/cpp:all")
# ── Formal Verification ──────────────────────────────────────────────
# Verus SMT-backed Rust verification (CV-20, CV-21, CV-22)
bazel_dep(name = "rules_verus", version = "0.1.0")
git_override(
module_name = "rules_verus",
commit = "8a2bbf6",
remote = "https://github.com/pulseengine/rules_verus.git",
)
# Configure Verus toolchain
verus = use_extension("@rules_verus//verus:extensions.bzl", "verus")
verus.toolchain(version = "0.2026.02.15")
use_repo(verus, "verus_toolchains")
register_toolchains("@verus_toolchains//:all")
# Lean4 formal verification (CV-24)
bazel_dep(name = "rules_lean", version = "0.1.0")
git_override(
module_name = "rules_lean",
commit = "3298aea",
remote = "https://github.com/pulseengine/rules_lean.git",
)
# Import repos created by rules_lean's extension (don't re-configure)
lean = use_extension("@rules_lean//lean:extensions.bzl", "lean")
use_repo(lean, "mathlib")
# Rocq/coq-of-rust formal verification (CV-22, CV-23)
# Requires Nix for coq-of-rust toolchain — CI installs Nix via cachix/install-nix-action
bazel_dep(name = "rules_rocq_rust", version = "0.1.0")
git_override(
module_name = "rules_rocq_rust",
commit = "6a8da0b",
remote = "https://github.com/pulseengine/rules_rocq_rust.git",
)
# Import coq-of-rust repos from rules_rocq_rust extension
rocq_of_rust = use_extension("@rules_rocq_rust//coq_of_rust:extensions.bzl", "rocq_of_rust")
use_repo(rocq_of_rust, "rocq_of_rust_source")