From a24161c93473e4fb5b532d2af48cb1f5d0ac4da9 Mon Sep 17 00:00:00 2001 From: cflmy Date: Sat, 21 Nov 2026 18:49:05 +0800 Subject: [PATCH] fix(foreign): keep Windows temp paths non-verbatim fs::canonicalize on Windows returns a \\?\C:\... path. Node's module loader lstats the working/script path and rejects the verbatim form, so all Node foreign-kernel tests failed on windows-latest. Use the native temp directory on Windows and retain canonicalization on Unix for symlink safety; widen the CI annotator so any remaining native failure shows a full assertion block. --- crates/marqdo-foreign/src/lib.rs | 8 ++++++++ tools/ci/annotate_workspace_tests.py | 7 +++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/crates/marqdo-foreign/src/lib.rs b/crates/marqdo-foreign/src/lib.rs index 6bebc32..e34155c 100644 --- a/crates/marqdo-foreign/src/lib.rs +++ b/crates/marqdo-foreign/src/lib.rs @@ -1058,6 +1058,14 @@ struct TempArtifacts { impl TempArtifacts { fn create(extension: &str) -> Result { + // `fs::canonicalize` on Windows returns a verbatim `\\?\C:\...` + // path. Node's module loader uses the working directory/script path + // with `lstat` and rejects that form (`node:fs` ENOENT/UNKNOWN), even + // though Rust can open it. Use the native temp path on Windows and + // keep canonicalization for Unix symlink safety. + #[cfg(windows)] + let base = std::env::temp_dir(); + #[cfg(not(windows))] let base = fs::canonicalize(std::env::temp_dir()).unwrap_or_else(|_| std::env::temp_dir()); let mut last_error: Option = None; for _ in 0..16 { diff --git a/tools/ci/annotate_workspace_tests.py b/tools/ci/annotate_workspace_tests.py index fe5ab1d..3b503bb 100755 --- a/tools/ci/annotate_workspace_tests.py +++ b/tools/ci/annotate_workspace_tests.py @@ -31,8 +31,11 @@ def interesting_lines(lines: list[str]) -> list[tuple[int, str]]: if "panicked at" in line: for offset in range(-2, 19): add(index + offset) - elif line.startswith("failures:") or line.startswith("---- "): - for offset in range(0, 6): + elif line.startswith("failures:"): + for offset in range(0, 8): + add(index + offset) + elif line.startswith("---- "): + for offset in range(0, 30): add(index + offset) elif re.match(r"^error(\[|:)", line): for offset in range(-1, 7):