From 38489281a97bfef1dbfb05dabeb7de968150a1a6 Mon Sep 17 00:00:00 2001 From: daxpedda Date: Tue, 30 Jan 2024 12:11:56 +0100 Subject: [PATCH] Fixed temporary folder detection on MacOS --- CHANGELOG.md | 3 +++ crates/cli/src/bin/wasm-bindgen-test-runner/main.rs | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da0f386a3c5b..d03b4bc7ce0a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,9 @@ * Fixed UB when freeing strings received from JS if not using the default allocator. [#3808](https://github.com/rustwasm/wasm-bindgen/pull/3808) +* Fixed temporary folder detection by `wasm-bindgen-test-runner` on MacOS. + [#3817](https://github.com/rustwasm/wasm-bindgen/pull/3817) + ## [0.2.90](https://github.com/rustwasm/wasm-bindgen/compare/0.2.89...0.2.90) Released 2024-01-06 diff --git a/crates/cli/src/bin/wasm-bindgen-test-runner/main.rs b/crates/cli/src/bin/wasm-bindgen-test-runner/main.rs index 88d5bc686d9f..5700be212c48 100644 --- a/crates/cli/src/bin/wasm-bindgen-test-runner/main.rs +++ b/crates/cli/src/bin/wasm-bindgen-test-runner/main.rs @@ -88,10 +88,10 @@ fn main() -> anyhow::Result<()> { // - a tmp directory, generated by rustdoc // we would like a directory we have write access to. if we assume cargo-like directories, // we end up with the path `/wbg-out` - let tmpdir = if wasm_file_to_test - .to_string_lossy() - .starts_with("/tmp/rustdoc") - { + let tmpdir = if { + let file = wasm_file_to_test.to_string_lossy(); + file.starts_with("/tmp/rustdoc") || file.starts_with("/var/folders") + } { wasm_file_to_test.parent() // chop off the file name and give us the /tmp/rustdoc directory } else { wasm_file_to_test