From de31b96fc8d7a89824db8e389675e102c39921aa Mon Sep 17 00:00:00 2001 From: Puck Meerburg Date: Sun, 2 Mar 2025 14:05:26 +0000 Subject: [PATCH] (zilch lang rust): add CARGO_TARGET_DIR --- lang/rust/helpers/src/bin/buildscript-runner.rs | 7 +++++++ lang/rust/src/build-script.sld | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lang/rust/helpers/src/bin/buildscript-runner.rs b/lang/rust/helpers/src/bin/buildscript-runner.rs index 6de7315..f02397d 100644 --- a/lang/rust/helpers/src/bin/buildscript-runner.rs +++ b/lang/rust/helpers/src/bin/buildscript-runner.rs @@ -40,9 +40,16 @@ fn parse(data: &str) -> HashMap { fn main() { create_dir(var_os("OUT_DIR").unwrap()).unwrap(); + create_dir(var_os("CARGO_TARGET_DIR").unwrap()).unwrap(); let mut f = File::create(var_os("out").unwrap()).unwrap(); writeln!(&mut f, "zilch: OUT_DIR={:?}", var("OUT_DIR").unwrap()).unwrap(); + writeln!( + &mut f, + "zilch: CARGO_TARGET_DIR={:?}", + var("CARGO_TARGET_DIR").unwrap() + ) + .unwrap(); let mut cmd = Command::new(var_os("script").unwrap()); diff --git a/lang/rust/src/build-script.sld b/lang/rust/src/build-script.sld index 1996b49..afcdb00 100644 --- a/lang/rust/src/build-script.sld +++ b/lang/rust/src/build-script.sld @@ -33,7 +33,8 @@ #~(("script" . #$input-script) ("cwd" . #$cwd) ("OUT_DIR" . ,(make-placeholder "outdir")) + ("CARGO_TARGET_DIR" . ,(make-placeholder "targetdir")) . #$env) - '("out" "outdir"))) + '("out" "outdir" "targetdir"))) (values (cdr (assoc "outdir" output)) (cdr (assoc "out" output))))))