You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CARGO_MANIFEST_DIR is accessed in build.rs via the env! macro rather than env::var, which makes it access that variable at compile time instead of run time as it should.
This is for example causing problems when pulling in tree-sitter via rules_rust in bazel, where compilation and running happen in completely separate environments.
ERROR: /home/redsun82/.cache/bazel/_bazel_redsun82/bc5487f033a0af65dff1ff0bd4000d75/external/rules_rust~~crate~crate__tree-sitter-0.22.6/BUILD.bazel:92:19: Running Cargo build script tree-sitter failed: (Exit 1): cargo_build_script_runner failed: error executing CargoBuildScriptRun command (from target @@rules_rust~~crate~crate__tree-sitter-0.22.6//:tree-sitter_bs) bazel-out/k8-opt-exec-ST-13d3ddad9198/bin/external/rules_rust~/cargo/cargo_build_script_runner/cargo_build_script_runner ... (remaining 11 arguments skipped)
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
Build script process failed with exit code 101
--stdout:
cargo:rerun-if-env-changed=CARGO_FEATURE_WASM
--stderr:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', external/rules_rust~~crate~crate__tree-sitter-0.22.6/binding_rust/build.rs:33:42
followed by a stack trace.
Expected behavior
Build works, which happens if patching tree-sitter with #3352 🙂
Tree-sitter version (tree-sitter --version)
tree-sitter 0.22.6
Operating system/version
Linux
The text was updated successfully, but these errors were encountered:
Problem
CARGO_MANIFEST_DIR
is accessed in build.rs via theenv!
macro rather thanenv::var
, which makes it access that variable at compile time instead of run time as it should.This is for example causing problems when pulling in
tree-sitter
viarules_rust
in bazel, where compilation and running happen in completely separate environments.Steps to reproduce
bazel
bazel build :foo
Reported error:
followed by a stack trace.
Expected behavior
Build works, which happens if patching
tree-sitter
with #3352 🙂Tree-sitter version (tree-sitter --version)
tree-sitter 0.22.6
Operating system/version
Linux
The text was updated successfully, but these errors were encountered: