hermetic test children inherit GOFLAGS, GOENV, GOWORK, GOPATH and GOMODCACHE, which the go crawler and apply read; two hosted-production Go/Deno tests can't fail
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 55/100
調査の方向性
Start in crates/socket-patch-cli/tests/common/hermetic.rs, where the Extra enum and CRAWLER_EXTRAS live, and add a Go variant that scrubs GOFLAGS, GOWORK, GOPATH and GOMODCACHE and sets GOENV=off. Then replace the process-wide set_var calls in e2e_golang_build.rs and e2e_golang_hosted_build.rs with per-Command .env(..). Done means the four Go suites pass with GOFLAGS=-modfile=/nonexistent exported in the parent shell, and the two hosted-production tests in e2e_hosted_production.rs can fail.
索引モデルが issue の本文から書いたものです。
説明
[agent] Filed by the scheduled architecture audit (audit-cli-tests). Register: register.
Kind: bug (test hermeticity). Register ID: T66.
Problem
The CLI reads Go settings from the environment and from the Go env file:
go_envreads the variable, else theGOENVfile, else$XDG_CONFIG_HOME/go/env(L110-L116).- The go crawler resolves the cache through
GOMODCACHEandGOPATH(go_crawler.rs L186-L189).`` - Go apply and vex honor
GOFLAGS=-modfile(#1799), and vendor readsGOWORK.
The test scrub has an Extra for each other crawler that reads the environment (Venv, Bundle, Composer, Pdm, Poetry), but none for Go. CRAWLER_EXTRAS is [Venv, Bundle, Composer]. Every socket-patch child therefore inherits the developer's or runner's Go environment.
Consequences found while auditing:
- Two hosted-production tests can't fail. In
e2e_hosted_production.rs:golang_hosted_redirects_only_via_goproxy_overridewrites a go.mod with norequireand no go.sum. The crawl therefore walks the ambientGOMODCACHE/$HOME/go, and on a clean runner only "scan exit 0" is asserted.deno_hosted_is_unsupportedinstalls nothing, so it gets 0 pins whether or not hosted Deno is supported.
- Process-wide env set and never restored.
e2e_golang_build.rssetsGOTOOLCHAINwithstd::env::set_varand never restores it (L198). The binary has noserial_test, so sibling tests read the environment in parallel while it is set.e2e_golang_hosted_build.rssetsGOTOOLCHAIN,GOFLAGS=-mod=modandGONOSUMDB=*the same way (L376-L378).````` Its later CLI children and in-process discovery see these values depending on test order.
- Only
GOMODCACHEis pinned.run_socketpinsGOMODCACHEonly, so an ambientGOFLAGS=-modfile=…or a usergo/envfile reachesapply/apply --check.
Proposed change
- Add
Extra::Gotohermetic.rs:- remove
GOFLAGS,GOWORK,GOPATHandGOMODCACHE; - set
GOENV=off.
- remove
- Include
Extra::GoinCRAWLER_EXTRAS. Tests that need a value set it after the scrub, as they already do. - Replace the process-wide
set_varcalls with per-Command.env(..)on the go and CLI children. Failing that, use a restoring guard under#[serial]. - In
e2e_hosted_production.rs:- Give the golang leg a
require+ go.sum and a fixtureGOMODCACHE, and assert the pin or skip code. - Install a Deno tree and assert a
hosted_skipscode, or delete the test.
- Give the golang leg a
Size
3–4 test files. About +40/−30 lines.
Acceptance criteria
- With
GOFLAGS=-modfile=/nonexistentandGOMODCACHE=/tmp/xexported in the parent shell, these suites still pass:e2e_golang,e2e_golang_build,e2e_golang_hosted_buildande2e_vendor_golang_build. - A hermetic selftest shows that the Go variables don't reach the child.
- The two production tests fail when their claimed behavior is broken.
- 主要言語
- Rust
- スター
- 9
- フォーク
- 2
- 平均マージ
- 20時間 47分
- マージ済み PR(30日)
- 681
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
SocketDev/socket-patch のほかの issue
-
agent:triaged arch-audit priority:p3 refactor
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
SocketDev/socket-patch#1860 ·
メンテナーはふだん 1 日以内に返信
-
agent:triaged arch-audit priority:p3 refactor
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
SocketDev/socket-patch#1838 ·
メンテナーはふだん 1 日以内に返信
-
arch-audit refactor
難易度 4/5 3〜5日 初心者へのやさしさ 54/100
SocketDev/socket-patch#1993 ·
メンテナーはふだん 1 日以内に返信
-
arch-audit refactor
難易度 3/5 1〜2日 初心者へのやさしさ 66/100
SocketDev/socket-patch#1992 ·
メンテナーはふだん 1 日以内に返信
-
agent:triaged arch-audit priority:p3 refactor
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
SocketDev/socket-patch#1987 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
SocketDev/socket-patch の issue をすべて見る
似ている issue
-
A-linter
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
oxc-project/oxc#28783 ·
メンテナーはふだん 1 日以内に返信
-
Substrait consumer doesn't recognise `shift_left` / `shift_right` from functions_arithmetic.yamlオープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
apache/datafusion#27059 ·
メンテナーはふだん 1 日以内に返信
-
Bump calamine to 0.38: RUSTSEC-2026-0436 (CFB/OLE2 panic and unbounded allocation) fails cargo auditオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
docling-project/docling.rs#979 ·
メンテナーはふだん 1 日以内に返信
-
llm translation
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信