GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Fix Go patches ignoring GOFLAGS=-modfile (#1799) by mikolalysenko · Pull Request #1800 · SocketDev/socket-patch Conversation
|
| Case | Test | before | after |
|---|---|---|---|
#1799 end to end, real go 1.24.7: the dry run and the real apply refuse and write nothing; a replace written earlier fails --check and is omitted from vex with -modfile from the env or a GOENV file; -modfile=go.mod stays in sync |
e2e_golang_build::goflags_modfile_keeps_the_go_mod_replace_from_the_build |
fails on main (apply exits 0) |
pass |
GOFLAGS parsing: last wins, quoting, --, refused settings |
go_env::goflags_modfile_reads_the_last_modfile |
n/a (new) | pass |
Own go.mod (relative/absolute/./) vs other file; workspace mode; relative GOWORK |
go_workspace::goflags_modfile_conflicts_unless_it_names_the_own_go_mod |
n/a | pass |
| VEX discovery withholds refs | discover::golang::goflags_modfile_naming_another_go_mod_attests_nothing |
n/a | pass |
Tracked snapshot keeps recording under -modfile (Bugbot) |
discover::golang::goflags_modfile_probe_keeps_a_snapshot_recording |
fails at 0b99e93 | pass |
| Hosted rewriter refuses the pin | redirect::golang_goflags_modfile_refuses_the_pin |
n/a | pass |
Per-issue checklist:
apply (and its dry run), apply --check, vex (env and go env -w), all in the e2e test above. The vendored and hosted writers go through the same gate, covered by replace_refusal and golang_goflags_modfile_refuses_the_pin.Local runs (0b99e93, then re-run at 801d50f):
cargo fmt --all -- --check and cargo clippy --workspace --all-features -- -D warnings: clean.cargo test -p socket-patch-core --all-features --lib: 6928 passed. 4 failed, all chmod-based write-failure tests that can't fail as root in this container: copy_tree::relax_loop…, vlt_heal::an_unremovable…, pypi_poetry::wire_write_failure… and pypi_requirements::wire_failure…. None of them touch Go. hosted::engine::tests::a_writing_pass_hands_back_the_discovery_of_its_writes passes.socket-patch-core integration suites: 32 suites, 656 passed.SOCKET_PATCH_GO_E2E_REQUIRED=1 --include-ignored (go 1.24.7): e2e_golang_build 30, e2e_golang_workspace_build 28, e2e_golang_hosted_build 25, e2e_golang_hosted_state 30, e2e_vendor_golang_build 44, e2e_golang 23. All pass.e2e_vex, e2e_vex_redirect, e2e_vex_vendor, hosted_memory_engine, hosted_memory_parity, in_process_remote_ecosystems_apply, in_process_rollback_all_ecosystems, in_process_vendor, cli_apply_silent and ecosystem_dispatch_e2e: all pass.cargo test --workspace locally because the sandbox disk filled while linking every CLI test binary. CI runs it.Fixed in 0b99e93:
disk_root() read.quoted.Split.GOFLAGS fields weren't treated as a setting go refuses.go.mod for a go.work replace.GOWORK was counted as workspace mode.Not changed:
go_workspace::load/Loaded. Loaded describes the go.work in effect, and -modfile matters in module mode too. Mapping it to Loaded::Invalid/None would change every resolve() != GoWork::None "is this a workspace" check (selection gates, modules.txt location). I kept the rule in one function (modfile_setting_with) and called it at the existing fail-closed boundaries.audit, and GOFLAGS re-read per module. Each is one small file read per module, only on --check/apply runs. I didn't think threading a resolved setting through every signature was worth it.-modfile=go.mod still took the raw root read). Fixed in 801d50f, with a regression test.https://claude.ai/code/session_011f9aePoQ9gtsKv1zP8Rxsg
Generated by Claude Code
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Assisted-by: Claude Code:claude-opus-5-5
With -modfile in GOFLAGS (set in the environment or with go env -w), go builds from that file and ignores go.mod's replaces. socket-patch never read GOFLAGS, so apply wrote a go.mod replace and reported the patch applied, apply --check called it in sync, and vex attested not_affected while the build linked the unpatched module. GOFLAGS is now read the way go reads it. A -modfile naming any file other than the project's go.mod (or any -modfile in workspace mode, which go refuses) is treated like a go.work that overrides the replace: apply, vendor and scan --mode hosted write nothing, a replace already written fails apply --check and vendor --check, and vex attests none of the project's Go patches. Fixes #1799. Assisted-by: Claude Code:claude-opus-5-5
Review fixes for the -modfile gate: - A GOFLAGS that go refuses (a non-flag field, a bare -modfile, an unterminated quote) is reported as such, and a quoted field may run straight into the next one, as in go's own parser. - VEX discovery only looks at the project root when GOFLAGS names -modfile, so hosted passes keep their read-tracking, and it skips in-memory projects, as the hosted engine does. - A relative GOWORK is go's own refusal, not workspace mode, so it no longer hides behind a -modfile message. - apply --check names go.work, not go.mod, for a go.work replace. Assisted-by: Claude Code:claude-opus-5-5
|
BugBot review Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Stale Bugbot comment from a previous run.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
The VEX -modfile check took the project root through a raw read whenever GOFLAGS named -modfile, even -modfile=go.mod, which voided a tracked snapshot's recording for every hosted writing pass. The check now declares the files it reads (the go.work candidates, go.mod and the named file), so the recording survives. Assisted-by: Claude Code:claude-opus-5-5
|
BugBot review Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
✅ 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 801d50f. Configure here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Burn-down agent: labeled Ready for review at
Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Final review briefWhat it does. When Risk: low. The PR only adds refusals and never adds writes. Every gate does nothing unless Look here
Verified
Changes I made. None. Notes (non-blocking).
Auto-merge (squash) is armed, so approving sends this straight to the merge queue. Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Go apply, apply --check and vex ignore GOFLAGS=-modfile, so they report a patch as applied while go builds from another go.mod and links the unpatched module
There was an error while loading. Please reload this page.