From cdc9fbb2401732fe23fc60071b02efb1aca9c705 Mon Sep 17 00:00:00 2001 From: Amaan Qureshi Date: Sun, 10 Mar 2024 17:53:22 -0400 Subject: [PATCH] fix: cli build script behavior on release --- cli/build.rs | 18 +++++++++++++++++- cli/dynamic-symbols-darwin.txt | 4 ---- cli/dynamic-symbols.txt | 6 ------ 3 files changed, 17 insertions(+), 11 deletions(-) delete mode 100644 cli/dynamic-symbols-darwin.txt delete mode 100644 cli/dynamic-symbols.txt diff --git a/cli/build.rs b/cli/build.rs index 8c8df104..a29a940b 100644 --- a/cli/build.rs +++ b/cli/build.rs @@ -29,7 +29,23 @@ fn main() { target_os = "netbsd", target_os = "dragonfly", ))] - println!("cargo:rustc-link-arg=-Wl,--dynamic-list=cli/dynamic-symbols.txt"); + { + let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap()).join("dynamic-symbols.txt"); + std::fs::write( + &out_dir, + "{ + ts_current_malloc; + ts_current_calloc; + ts_current_realloc; + ts_current_free; + };", + ) + .unwrap(); + println!( + "cargo:rustc-link-arg=-Wl,--dynamic-list={}", + out_dir.display() + ); + } } fn web_playground_files_present() -> bool { diff --git a/cli/dynamic-symbols-darwin.txt b/cli/dynamic-symbols-darwin.txt deleted file mode 100644 index 1b4f3c68..00000000 --- a/cli/dynamic-symbols-darwin.txt +++ /dev/null @@ -1,4 +0,0 @@ -_ts_current_malloc -_ts_current_calloc -_ts_current_realloc -_ts_current_free diff --git a/cli/dynamic-symbols.txt b/cli/dynamic-symbols.txt deleted file mode 100644 index 3c1ecc36..00000000 --- a/cli/dynamic-symbols.txt +++ /dev/null @@ -1,6 +0,0 @@ -{ - ts_current_malloc; - ts_current_calloc; - ts_current_realloc; - ts_current_free; -};