Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@ sh_test(
# Uses vendored dependencies for hermetic builds
cargo_test(
name = "cargo_check",
python_venv = ":python_deps",
srcs = [":cargo_srcs"],
vendor = ":cargo_deps",
script = "cargo check --all --all-features --tests --benches --locked --offline",
Expand All @@ -420,6 +421,7 @@ cargo_test(
# Uses vendored dependencies for hermetic builds
cargo_test(
name = "cargo_build_release",
python_venv = ":python_deps",
size = "enormous",
srcs = [":cargo_srcs"],
vendor = ":cargo_deps",
Expand All @@ -430,6 +432,7 @@ cargo_test(
# Uses vendored dependencies for hermetic builds
cargo_test(
name = "cargo_clippy",
python_venv = ":python_deps",
srcs = [":cargo_srcs"],
vendor = ":cargo_deps",
script = "cargo clippy --all --all-features --offline -- -D warnings",
Expand Down Expand Up @@ -486,6 +489,7 @@ cargo_test(
name = "cargo_hack_check",
size = "enormous",
srcs = [":cargo_srcs"],
python_venv = ":python_deps",
tools = ["@cargo_hack//:cargo-hack"],
vendor = ":cargo_deps",
script = "cargo hack check --each-feature --exclude-features=codegen-docs --offline",
Expand Down
35 changes: 31 additions & 4 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,11 @@ register_toolchains("@python_versions//:all")

bazel_dep(name = "aspect_rules_lint", version = "2.5.0")
bazel_dep(name = "rules_go", version = "0.60.0", repo_name = "io_bazel_rules_go")
bazel_dep(name = "rules_cc", version = "0.2.17")
bazel_dep(name = "gazelle", version = "0.50.0")
bazel_dep(name = "rules_rust", version = "0.68.1")
bazel_dep(name = "rules_rust_wasm_bindgen", version = "0.68.1")
bazel_dep(name = "rules_rust_pyo3", version = "0.68.1")
bazel_dep(name = "rules_shell", version = "0.6.1")
bazel_dep(name = "rules_shellcheck", version = "0.4.0")

Expand All @@ -63,11 +65,17 @@ npm.npm_translate_lock(
"//editors/code:package.json",
"//playground:package.json",
],
# code-server installs the nested VS Code runtime during postinstall. Its
# optional native addons are not needed by the headless tests and require
# host Python/compiler discovery, so suppress nested install scripts only.
lifecycle_hooks_envs = {
"code-server": ["npm_config_user_agent=npm/10.0.0 node/v22.0.0"],
"code-server": [
"npm_config_ignore_scripts=true",
"npm_config_user_agent=npm/10.0.0 node/v22.0.0",
],
},
lifecycle_hooks_execution_requirements = {
"code-server": ["no-sandbox"],
"code-server": ["no-sandbox", "requires-network"],
},
pnpm_lock = "//:pnpm-lock.yaml",
)
Expand Down Expand Up @@ -99,6 +107,7 @@ rust.toolchain(
use_repo(rust, "rust_toolchains")

register_toolchains("@rust_toolchains//:all")
register_toolchains("@rules_rust_pyo3//toolchains:toolchain")

# Required for WASM cross-compilation
register_toolchains("@rules_rust//rust/private/dummy_cc_toolchain:dummy_cc_wasm32_toolchain")
Expand All @@ -125,11 +134,29 @@ crate.from_cargo(

# Annotations for pyo3 crates - use Python toolchain for build scripts
crate.annotation(
build_script_toolchains = ["@rules_python//python:current_py_toolchain"],
build_script_data = ["@@rules_rust_pyo3+//:current_pyo3_toolchain"],
build_script_env = {
"PYO3_CROSS": "$(PYO3_CROSS)",
"PYO3_CROSS_LIB_DIR": "$(PYO3_CROSS_LIB_DIR)",
"PYO3_CROSS_PYTHON_IMPLEMENTATION": "$(PYO3_CROSS_PYTHON_IMPLEMENTATION)",
"PYO3_CROSS_PYTHON_VERSION": "$(PYO3_CROSS_PYTHON_VERSION)",
"PYO3_NO_PYTHON": "$(PYO3_NO_PYTHON)",
"PYO3_PYTHON": "$(PYO3_PYTHON)",
},
build_script_toolchains = ["@@rules_rust_pyo3+//:current_pyo3_toolchain"],
crate = "pyo3-build-config",
)
crate.annotation(
build_script_toolchains = ["@rules_python//python:current_py_toolchain"],
build_script_data = ["@@rules_rust_pyo3+//:current_pyo3_toolchain"],
build_script_env = {
"PYO3_CROSS": "$(PYO3_CROSS)",
"PYO3_CROSS_LIB_DIR": "$(PYO3_CROSS_LIB_DIR)",
"PYO3_CROSS_PYTHON_IMPLEMENTATION": "$(PYO3_CROSS_PYTHON_IMPLEMENTATION)",
"PYO3_CROSS_PYTHON_VERSION": "$(PYO3_CROSS_PYTHON_VERSION)",
"PYO3_NO_PYTHON": "$(PYO3_NO_PYTHON)",
"PYO3_PYTHON": "$(PYO3_PYTHON)",
},
build_script_toolchains = ["@@rules_rust_pyo3+//:current_pyo3_toolchain"],
crate = "pyo3-ffi",
)
use_repo(crate, "crates")
8 changes: 5 additions & 3 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading