diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 62b45485..2131305f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -74,10 +74,7 @@ jobs: run: | printf 'EMSCRIPTEN_VERSION=%s\n' "$(> $GITHUB_ENV - if [[ '${{ matrix.platform }}' =~ ^windows ]]; then - # Prevent race condition (see #2041) - printf 'RUST_TEST_THREADS=1\n' >> $GITHUB_ENV - elif [[ '${{ matrix.cross }}' == true ]]; then + if [[ '${{ matrix.cross }}' == true ]]; then for target in armv7-unknown-linux-gnueabihf i686-unknown-linux-gnu powerpc64-unknown-linux-gnu; do camel_target=${target//-/_}; target_cc=${target/-unknown/} printf 'CC_%s=%s\n' "$camel_target" "${target_cc/v7/}-gcc" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f10394b2..a4452316 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,7 @@ on: - LICENSE - cli/src/templates push: - branches: [master] + # branches: [master] paths-ignore: - docs/** - "**/README.md" diff --git a/crates/loader/src/loader.rs b/crates/loader/src/loader.rs index cbff2fc6..b2d424a7 100644 --- a/crates/loader/src/loader.rs +++ b/crates/loader/src/loader.rs @@ -908,7 +908,23 @@ impl Loader { let out = format!("-out:{}", output_path.to_str().unwrap()); command.arg(if self.debug_build { "-LDd" } else { "-LD" }); command.arg("-utf-8"); + + // Use output directory for object files to avoid conflicts in parallel tests + let output_dir = output_path.parent().unwrap(); + let pid = std::process::id(); + let tid = format!("{:?}", std::thread::current().id()) + .replace("ThreadId(", "") + .replace(")", ""); + + // Create a unique subdirectory for this compilation to avoid conflicts + let obj_dir = output_dir.join(format!("obj_{pid}_{tid}")); + std::fs::create_dir_all(&obj_dir).unwrap(); + + // Use /Fo with directory path (must end with \) for multiple source files + let fo_arg = format!("/Fo{}\\", obj_dir.to_str().unwrap()); + command.arg(fo_arg); command.args(cc_config.get_files()); + command.arg("-link").arg(out); } else { command.arg("-Werror=implicit-function-declaration");