-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMODULE.bazel
More file actions
122 lines (95 loc) · 4.32 KB
/
MODULE.bazel
File metadata and controls
122 lines (95 loc) · 4.32 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
"""Bazel File Operations Component
Universal file operations for Bazel build systems via WebAssembly components.
This module provides both TinyGo and Rust implementations of file operations
that can be used across different Bazel rule sets with enhanced security
through WebAssembly sandboxing.
"""
module(
name = "bazel-file-ops-component",
version = "0.1.0",
compatibility_level = 1,
)
# Core Bazel dependencies - updated to match rules_wasm_component expectations
bazel_dep(name = "platforms", version = "1.0.0")
bazel_dep(name = "rules_cc", version = "0.2.14")
bazel_dep(name = "bazel_skylib", version = "1.8.2")
# 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")
# Add compatibility proxy repository for rules_cc 0.2.0 (required for bzlmod)
# Note: This is handled automatically by rules_cc 0.2.4+
# WebAssembly and component support
bazel_dep(name = "rules_rust", version = "0.62.0")
bazel_dep(name = "rules_go", version = "0.57.0")
# Development dependencies
bazel_dep(name = "buildifier_prebuilt", version = "6.4.0", dev_dependency = True)
# Documentation site dependencies - simplified setup
bazel_dep(name = "rules_nodejs", version = "6.5.0")
# TinyGo toolchain for WebAssembly components
bazel_dep(name = "rules_wasm_component", version = "0.1.0")
# Git repository override - use our fork with latest fixes
git_override(
module_name = "rules_wasm_component",
commit = "27eefae46a6b542fedf066d924a3c07a7b3d6f6a", # Latest: hermetic Go tools + go_sum support
remote = "https://github.com/pulseengine/rules_wasm_component.git",
)
# Git repository override for rules_rust - WASI Preview 2 support required
git_override(
module_name = "rules_rust",
commit = "7d7d3ac00ad013c94e7a9d0db0732c20ffe8eab7", # WASI Preview 2 support
remote = "https://github.com/bazelbuild/rules_rust.git",
)
# Local development override - use local rules_wasm_component (disabled for CI)
# local_path_override(
# module_name = "rules_wasm_component",
# path = "/Users/r/git/rules_wasm_component",
# )
# Rust toolchain setup
rust = use_extension("@rules_rust//rust:extensions.bzl", "rust")
rust.toolchain(edition = "2021")
use_repo(rust, "rust_toolchains")
register_toolchains("@rust_toolchains//:all")
# Note: C++ toolchains are provided by rules_cc and WASI SDK
# Using WASI SDK toolchains for WebAssembly C++ compilation
# WASI SDK toolchain for WebAssembly C++ components
wasi_sdk = use_extension("@rules_wasm_component//wasm:extensions.bzl", "wasi_sdk")
wasi_sdk.register(
name = "wasi",
strategy = "download",
version = "27",
)
use_repo(wasi_sdk, "wasi_sdk")
# Register WASI SDK toolchains
register_toolchains(
"@wasi_sdk//:wasi_sdk_toolchain",
"@wasi_sdk//:cc_toolchain",
)
# Wasmtime runtime toolchain for running and testing WASM components
wasmtime = use_extension("@rules_wasm_component//wasm:extensions.bzl", "wasmtime")
wasmtime.register(
name = "wasmtime",
strategy = "download",
version = "35.0.0", # Latest version with verified checksums
)
use_repo(wasmtime, "wasmtime_toolchain")
# Register wasmtime toolchain
register_toolchains("@wasmtime_toolchain//:wasmtime_toolchain")
# Register C++ toolchains explicitly for cross-platform compatibility
# This ensures Linux CI has proper C++ toolchain resolution for Rust binaries
register_toolchains("@bazel_tools//tools/cpp:all")
# WebAssembly toolchain - using default download strategy from rules_wasm_component
# Note: Signing is handled via Cosign in release workflow, not wasmsign2
# The "bazel" strategy for wasmsign2 is not yet production-ready in rules_wasm_component
# Note: Rust dependencies are provided by rules_wasm_component
# No local Rust crate dependencies needed for TinyGo-focused implementation
# Go toolchain setup
go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")
go_sdk.download(version = "1.23.0")
# TinyGo toolchain setup - using rules_wasm_component native setup
# Note: TinyGo toolchain is registered automatically by rules_wasm_component
# Node.js setup for documentation
node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node")
node.toolchain(node_version = "20.18.0")
use_repo(node, "nodejs_toolchains")
# Register Node.js toolchains
register_toolchains("@nodejs_toolchains//:all")