Repository navigation
Fix Go GOWORK test failing on macOS nightly - #1894
Conversation
The nightly macOS test leg has failed since #1812 added apply_never_writes_go_work_when_gowork_names_a_sibling_file. The test sets GOWORK to a file under the tempdir and then runs go in a member. go takes its working directory with symlinks resolved, so on macOS (/var -> /private/var) the member sits outside the workspace GOWORK names and go refuses it: "directory a is contained in a module that is not one of the workspace modules listed in go.work". Stage the test under the canonical tempdir on Unix. Windows keeps the plain path, where canonicalize would give a \\?\ path go can't use. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011f9aeT7Z8SgtvNfjPY7zCb
|
bugbot run Generated by Claude Code |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 15cf91e. Configure here.
|
[burn-down agent] Labeled Ready for review at 15cf91e.
Generated by Claude Code |
Final review briefWhat it does: This is a test-only fix for the GOWORK e2e test that fails on macOS nightly. On Unix the test now stages its workspace under the canonicalized tempdir. go resolves its cwd to Risk: low. Only one test file changes, and no assertion is removed or loosened. The product code already canonicalizes paths ( Look here
Verified: I read the diff and the root cause holds: Changes I made: none. Open questions (non-blocking): if a second test ever sets an absolute Auto-merge is armed, so approving sends this straight to the merge queue. Generated by Claude Code |
Wenxin Jiang (Wenxin-Jiang)
left a comment
There was a problem hiding this comment.
[agent] Reviewed 15cf91eb3274310a4045bfa928b5ebee0bb27f8b. Checked canonical temporary paths through Go workspace staging, download and member execution. No major correctness issues found. Validation: source and regression-test review plus the available exact-head CI checks; no local test pass is claimed.
Problem
The nightly
CIrun on main (41009903891) failedtest (macos-latest, 2)with-p socket-patch-cli --test e2e_golang_workspace_build. It is the first nightly after #1812 (merged 2026-10-29 13:24 UTC), which addedapply_never_writes_go_work_when_gowork_names_a_sibling_file. The 10-29 nightly passed on macOS. The test is deterministic, so every nightly will fail until it's fixed. Nightly CI on main has been red for 8 days in a row; the other failing leg (Windowscrawler_maven_e2e) is handled by #1852.Root cause
The test sets
GOWORKto<tempdir>/ws/ci.workand then runsgo run ./awith its working directory set inside that tempdir. go reads its working directory with symlinks resolved. On macOS the tempdir is under/var, which is a symlink to/private/var, so go sees the member at/private/var/...and the workspace at/var/.... It refuses the member:This is a test harness problem. socket-patch's own checks (
same_dir_key) already canonicalize paths. Linux PR and merge-queue legs never caught it because their tempdir has no symlink.Fix
On Unix, stage this test under the canonicalized tempdir. Windows keeps the plain path, because
canonicalizethere returns a\\?\path that go can't use. The Windows leg passes today.Proof
Reproduced on Linux by pointing
TMPDIRat a symlink, which mimics macOS:TMPDIRsymlinkedTMPDIRrustfmt --checkis clean on the touched file.cargo clippy --test e2e_golang_workspace_buildreports no findings in this file. The only findings are pre-existing ones intests/prebuilt_common/mod.rs, and main has the same ones on the local 1.93 toolchain.No tests were removed or moved.
Generated by Claude Code
Note
Low Risk
Test-only harness change in one e2e; no production code paths modified.
Overview
Fixes macOS nightly failures in
apply_never_writes_go_work_when_gowork_names_a_sibling_fileby staging the workspace under a canonical temp path on Unix instead of the rawtempfilepath.The test sets
GOWORKto a siblingci.workand runsgofrom member dirs; Go resolves the working directory through symlinks, so on macOS (/var→/private/var) the workspace file and member paths no longer matched andgo runfailed. Windows is unchanged—still uses the non-canonical path becausecanonicalizeyields\\?\paths Go rejects.Staging and
run_membernow use thisbasepath; assertions and product behavior under test are the same.Reviewed by Cursor Bugbot for commit 15cf91e. Configure here.
Generated by Claude Code