fix(rust): fetch CARGO_MANIFEST_DIR at runtime in build script
The `CARGO_MANIFEST_DIR` environment variable should be accessed by `build.rs` at run time rather than compile time. This was for example causing issues when importing `tree-sitter` via [`rules_rust`](https://github.com/bazelbuild/rules_rust) in bazel, where compilation and running happen in separate environments.
This commit is contained in:
parent
8e8648afa9
commit
d35e40185a
1 changed files with 2 additions and 5 deletions
|
|
@ -1,7 +1,4 @@
|
|||
use std::{
|
||||
env, fs,
|
||||
path::{Path, PathBuf},
|
||||
};
|
||||
use std::{env, fs, path::PathBuf};
|
||||
|
||||
fn main() {
|
||||
let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());
|
||||
|
|
@ -26,7 +23,7 @@ fn main() {
|
|||
.include(env::var("DEP_WASMTIME_C_API_WASM_INCLUDE").unwrap());
|
||||
}
|
||||
|
||||
let manifest_path = Path::new(env!("CARGO_MANIFEST_DIR"));
|
||||
let manifest_path = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap());
|
||||
let include_path = manifest_path.join("include");
|
||||
let src_path = manifest_path.join("src");
|
||||
let wasm_path = src_path.join("wasm");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue