Repository navigation
Fix Go GOWORK test failing on macOS nightly - #1894
Open
Mikola Lysenko (mikolalysenko) wants to merge 1 commit into
Open
Mikola Lysenko (mikolalysenko) wants to merge 1 commit into
Mikola Lysenko (mikolalysenko) wants to merge 1 commit into
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
Collaborator
Author
|
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.
This was referenced Oct 30, 2026
Collaborator
Author
|
[burn-down agent] Labeled Ready for review at 15cf91e.
Generated by Claude Code |
This was referenced Oct 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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