From 470cf6b343e8793ba0662847de8eb4f6ba82623e Mon Sep 17 00:00:00 2001 From: Sam Willcocks Date: Thu, 18 Nov 2021 02:18:25 +0000 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() {