From c350a61ff731573c44788e88970e42fc0edf971a Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 29 Oct 2026 07:07:49 +0000 Subject: [PATCH 1/2] Fix Go workspace tests failing on Windows Three Go workspace unit tests failed on the nightly Windows run, keeping main's nightly CI red. Their fixtures used /elsewhere and /nonexistent as absolute GOWORK paths, but on Windows a path with no drive is relative, so the code (like go itself) rejected them. A third test expected a forward-slash path where Windows prints a native one. Build the GOWORK fixtures under the test's temp dir so they are absolute on every platform, and match the member path with the platform separator. No product code changes. Fixes #1815 Assisted-by: Claude Code:claude-opus-5-5 --- crates/socket-patch-core/src/vendor/go_workspace.rs | 12 +++++++++--- crates/socket-patch-core/src/vex/discover/golang.rs | 4 +++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/crates/socket-patch-core/src/vendor/go_workspace.rs b/crates/socket-patch-core/src/vendor/go_workspace.rs index 50e3baf86..402d51ded 100644 --- a/crates/socket-patch-core/src/vendor/go_workspace.rs +++ b/crates/socket-patch-core/src/vendor/go_workspace.rs @@ -1138,9 +1138,12 @@ mod tests { ); } assert_eq!(resolve_with(&project, Some("off")), GoWork::None); + // Absolute on this platform (`/x` has no drive on Windows, where go + // rejects it as relative too). + let elsewhere = tmp.path().join("elsewhere").join("go.work"); assert_eq!( - resolve_with(&project, Some("/elsewhere/go.work")), - GoWork::File(PathBuf::from("/elsewhere/go.work")) + resolve_with(&project, Some(&elsewhere.to_string_lossy())), + GoWork::File(elsewhere.clone()) ); for relative in ["go.work", "../go.work"] { assert!( @@ -1476,7 +1479,10 @@ mod tests { )); match ws.conflict(&root.join("a"), DEP, "v1.0.0", &ours) { Some(c @ WorkspaceConflict::MainModule { .. }) => { - assert!(c.consequence(DEP, "v1.0.0").contains("ws/dep"), "{c:?}"); + // Outside the project the member shows as a native path. + let member = Path::new("ws").join("dep"); + let member = member.to_string_lossy(); + assert!(c.consequence(DEP, "v1.0.0").contains(&*member), "{c:?}"); } other => panic!("{other:?}"), } diff --git a/crates/socket-patch-core/src/vex/discover/golang.rs b/crates/socket-patch-core/src/vex/discover/golang.rs index 2d763b8e9..e1db1fbb1 100644 --- a/crates/socket-patch-core/src/vex/discover/golang.rs +++ b/crates/socket-patch-core/src/vex/discover/golang.rs @@ -1836,9 +1836,11 @@ mod tests { ); } let elsewhere = p.root().join("a").join("go.work"); + // Absolute on this platform: `/nonexistent` has no drive on Windows. + let missing = p.root().join("nonexistent").join("go.work"); for (gowork, why) in [ ("go.work".to_string(), "not an absolute path"), - ("/nonexistent/go.work".to_string(), "other than"), + (missing.to_string_lossy().into_owned(), "other than"), (elsewhere.to_string_lossy().into_owned(), "other than"), ] { let out = extract(Some(gowork.clone())).await; From a750d284923b74ca8354418824f4a962bd7e9ce9 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 29 Oct 2026 07:16:27 +0000 Subject: [PATCH 2/2] Keep remaining GOWORK test paths portable The Go crawler test still set GOWORK to /elsewhere/go.work, which on Windows is relative, so its "file elsewhere" case quietly checked an invalid GOWORK instead. Point it at an absolute path beside the project. Keep the VEX test's missing go.work outside the project, as the original /nonexistent path was. Refs #1815 Assisted-by: Claude Code:claude-opus-5-5 --- crates/socket-patch-core/src/crawlers/go_crawler.rs | 6 ++++-- crates/socket-patch-core/src/vex/discover/golang.rs | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/crates/socket-patch-core/src/crawlers/go_crawler.rs b/crates/socket-patch-core/src/crawlers/go_crawler.rs index b87773064..79784f1dc 100644 --- a/crates/socket-patch-core/src/crawlers/go_crawler.rs +++ b/crates/socket-patch-core/src/crawlers/go_crawler.rs @@ -1426,8 +1426,10 @@ mod tests { } std::fs::remove_file(f.project.join("go.work")).unwrap(); - // GOWORK naming a file elsewhere. - let _gowork = EnvGuard::set("GOWORK", "/elsewhere/go.work"); + // GOWORK naming a file elsewhere (absolute on every platform: + // `/x` has no drive on Windows, so go rejects it as relative). + let elsewhere = f.project.parent().unwrap().join("elsewhere/go.work"); + let _gowork = EnvGuard::set("GOWORK", &elsewhere.to_string_lossy()); assert_eq!(f.crawl().await, walked); } diff --git a/crates/socket-patch-core/src/vex/discover/golang.rs b/crates/socket-patch-core/src/vex/discover/golang.rs index e1db1fbb1..7ab38e132 100644 --- a/crates/socket-patch-core/src/vex/discover/golang.rs +++ b/crates/socket-patch-core/src/vex/discover/golang.rs @@ -1836,8 +1836,10 @@ mod tests { ); } let elsewhere = p.root().join("a").join("go.work"); - // Absolute on this platform: `/nonexistent` has no drive on Windows. - let missing = p.root().join("nonexistent").join("go.work"); + // Outside the project and absolute on this platform (`/nonexistent` + // has no drive on Windows, so go rejects it as relative). + let outside = tempfile::tempdir().unwrap(); + let missing = outside.path().join("nonexistent").join("go.work"); for (gowork, why) in [ ("go.work".to_string(), "not an absolute path"), (missing.to_string_lossy().into_owned(), "other than"),