Go go.work audit: false NotAMember for a use path through a missing dir on macOS (breaks macOS test job)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 76/100
調査の方向性
まず crates/socket-patch-core/src/vendor/go_consumer_sync.rs の same_dir_key から始め、そのドキュメントコメントを失敗しているテスト go_work_that_does_not_use_the_project_makes_the_replace_inert と併せて読みます。失敗を再現するため、TMPDIR がシンボリックリンク先のディレクトリを指す状態で、対象を絞った go_consumer_sync のテストを実行します。存在しないディレクトリを経由する使用パスがプロジェクトルートと一致し、macOS で誤って発生する NotAMember の競合がテストでカバーされれば完了です。
索引モデルが issue の本文から書いたものです。
説明
[agent] Found while checking the full-scope CI run for #1407. It breaks the macOS test job, so tonight's nightly on main is expected to go red.
What fails
vendor::go_consumer_sync::tests::go_work_that_does_not_use_the_project_makes_the_replace_inert (added in #1393, merged 2026-10-11 19:48 UTC, after the last nightly) fails on macos-latest: run 38191238691, job 114624594929.
panicked at crates/socket-patch-core/src/vendor/go_consumer_sync.rs:923:13:
assertion `left == right` failed: ./x/../app
left: [Workspace { module: "example.com/upstream", version: "v1.0.0", conflict: NotAMember { work_file: "/private/var/folders/.../go.work" } }]
right: []
The spellings ./app, app, ./app/ and "./app" all pass. Only ./x/../app fails.
Root cause
same_dir_key (go_consumer_sync.rs:468) calls std::fs::canonicalize on the raw joined path <ws>/x/../app. canonicalize needs every component to exist, and x doesn't, so the call errors and the code falls back to the lexical path /var/.../app. The project root does exist and canonicalizes to /private/var/.../app, because /var is a symlink on macOS. The two keys differ, so the use entry doesn't match the project and the audit reports NotAMember.
It isn't only a test problem. Any user whose go.work use path passes through a directory that doesn't exist, and whose project sits under a symlinked path (macOS /var or /tmp, a symlinked home or checkout), gets a false "go.work does not use this project" conflict. Go itself resolves use paths lexically (filepath.Clean), so ./x/../app is a valid member for go.
Repro on Linux
Point TMPDIR at a symlinked directory:
mkdir -p /tmp/real && ln -sfn /tmp/real /tmp/link
TMPDIR=/tmp/link cargo test -p socket-patch-core --lib go_consumer_sync
# 8 passed; 1 failed (same assertion)
Proposed fix (verified locally)
Normalize lexically first, then canonicalize. This matches go's filepath.Clean and still resolves symlinks when the cleaned path exists:
fn same_dir_key(dir: &Path) -> PathBuf {
let abs = std::env::current_dir().unwrap_or_default().join(dir);
- std::fs::canonicalize(&abs)
- .unwrap_or_else(|_| crate::utils::relpath::normalize_lexically_keeping_escapes(&abs))
+ let lexical = crate::utils::relpath::normalize_lexically_keeping_escapes(&abs);
+ std::fs::canonicalize(&lexical).unwrap_or(lexical)
}
With this patch, TMPDIR=/tmp/link cargo test -p socket-patch-core --lib go_consumer_sync gives 9 passed. The rest of vendor:: matches main: the only two failures, pypi_poetry::...wire_write_failure... and pypi_requirements::...wire_failure_rolls_back..., fail on unpatched main too when run as root in the agent sandbox.
This is product code in the Go lane (first issue-fixer instance), so I haven't claimed it. The doc comment above same_dir_key should be updated with the fix.
Generated by Claude Code
- 主要言語
- Rust
- スター
- 8
- フォーク
- 1
- 平均マージ
- 18時間 19分
- マージ済み PR(30日)
- 504
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
SocketDev/socket-patch のほかの issue
-
agent:triaged bug bughunt pm:npm priority:p3 ux
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
SocketDev/socket-patch#1072 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
agent:triaged bug bughunt pm:yarn-berry priority:p1
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
SocketDev/socket-patch#783 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Vendored cargo warns cargo_multi_version_old_cargo ("declares no rust-version") when the root package inherits rust-version from [workspace.package]対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンagent:triaged bug bughunt pm:cargo priority:p2
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
SocketDev/socket-patch#651 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
bug bughunt pm:npm
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
SocketDev/socket-patch#1481 ·
メンテナーはふだん 1 日以内に返信
-
Hosted gem scan ignores a Gemfile `lockfile "custom.lock"` DSL call (Bundler 4), so it pins the unused Gemfile.lock, leaves the real lock untouched, and every frozen install fails対応中かも @mikolalysenko が今日担当しました。 オープンagent:claimed agent:triaged bug bughunt pm:bundler priority:p1
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
SocketDev/socket-patch#1477 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
SocketDev/socket-patch の issue をすべて見る
似ている issue
-
Add Mimirオープン
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
slavakurilyak/awesome-ai-agents#759 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
compiler-explorer/compiler-explorer#9272 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 63/100
pop-os/cosmic-files#2117 ·
メンテナーはふだん 2 日以内に返信
-
L: java:gradle L: java:maven L: ruby:bundler T: bug 🐞
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
dependabot/dependabot-core#16547 ·
メンテナーはふだん 1 日以内に返信
-
bug status:ready-for-test
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
UniClipboard/UniClipboard#1985 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信