Skip to content

Commit f4efb2c

Browse files
authored
shared: support runtime configuration for schema lookup (#2657)
1 parent e252c2e commit f4efb2c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

crates/shared/build.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use std::collections::hash_map::DefaultHasher;
2+
use std::env;
23
use std::hash::Hasher;
34
use std::path::PathBuf;
45
use std::process::Command;
@@ -21,7 +22,10 @@ fn main() {
2122
}
2223

2324
fn set_schema_version_env_var() {
24-
let schema_file = PathBuf::from(concat!(env!("CARGO_MANIFEST_DIR"), "/src/lib.rs"));
25+
let cargo_manifest_dir = env::var("CARGO_MANIFEST_DIR").expect(
26+
"The `CARGO_MANIFEST_DIR` environment variable is needed to locate the schema file",
27+
);
28+
let schema_file = PathBuf::from(cargo_manifest_dir).join("src/lib.rs");
2529
let schema_file = std::fs::read(schema_file).unwrap();
2630

2731
let mut hasher = DefaultHasher::new();

0 commit comments

Comments
 (0)