From 4f48d5945e6158ea985e812a3225ba2f94df9dce Mon Sep 17 00:00:00 2001 From: Sam Willcocks Date: Tue, 13 Sep 2022 16:56:26 +0100 Subject: [PATCH] Use absolute path to cargo.lock to fix build on nix --- build.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.rs b/build.rs index 4187f26..b8cf7c1 100644 --- a/build.rs +++ b/build.rs @@ -1,5 +1,5 @@ fn main() -> Result<(), Box> { - let s = std::fs::read_to_string("./cargo.lock")?; + let s = std::fs::read_to_string(std::env::var("CARGO_MANIFEST_DIR")? + "/cargo.lock")?; let lock = s.parse::().unwrap(); let mut reqwest_ver: Option = None; for p in lock.as_table().unwrap()["package"].as_array().unwrap() {