GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — 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 · Issue #1981 · SocketDev/socket-patch

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 #1981

New issue
Copy link
New issue
Copy link
Open
Open
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#1981
Copy link
Labels
agent:triagedarch-auditFiled by a scheduled architecture audit routine (see the architecture review discussion)Filed by a scheduled architecture audit routine (see the architecture review discussion)bugSomething isn't workingSomething isn't workingpriority:p3

Description

@mikolalysenko
Mikola Lysenko (mikolalysenko)
opened on Nov 2, 2026
Issue body actions

[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_env reads the variable, else the GOENV file, else $XDG_CONFIG_HOME/go/env (L110-L116).
  • The go crawler resolves the cache through GOMODCACHE and GOPATH (go_crawler.rs L186-L189).``
  • Go apply and vex honor GOFLAGS=-modfile (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 #1799), and vendor reads GOWORK.

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_override writes a go.mod with no require and no go.sum. The crawl therefore walks the ambient GOMODCACHE/$HOME/go, and on a clean runner only "scan exit 0" is asserted.
    • deno_hosted_is_unsupported installs nothing, so it gets 0 pins whether or not hosted Deno is supported.
  • Process-wide env set and never restored.
    • e2e_golang_build.rs sets GOTOOLCHAIN with std::env::set_var and never restores it (L198). The binary has no serial_test, so sibling tests read the environment in parallel while it is set.
    • e2e_golang_hosted_build.rs sets GOTOOLCHAIN, GOFLAGS=-mod=mod and GONOSUMDB=* the same way (L376-L378).````` Its later CLI children and in-process discovery see these values depending on test order.
  • Only GOMODCACHE is pinned. run_socket pins GOMODCACHE only, so an ambient GOFLAGS=-modfile=… or a user go/env file reaches apply/apply --check.

Proposed change

  1. Add Extra::Go to hermetic.rs:
    • remove GOFLAGS, GOWORK, GOPATH and GOMODCACHE;
    • set GOENV=off.
  2. Include Extra::Go in CRAWLER_EXTRAS. Tests that need a value set it after the scrub, as they already do.
  3. Replace the process-wide set_var calls with per-Command .env(..) on the go and CLI children. Failing that, use a restoring guard under #[serial].
  4. In e2e_hosted_production.rs:
    • Give the golang leg a require + go.sum and a fixture GOMODCACHE, and assert the pin or skip code.
    • Install a Deno tree and assert a hosted_skips code, or delete the test.

Size

3–4 test files. About +40/−30 lines.

Acceptance criteria

  • With GOFLAGS=-modfile=/nonexistent and GOMODCACHE=/tmp/x exported in the parent shell, these suites still pass: e2e_golang, e2e_golang_build, e2e_golang_hosted_build and e2e_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.

Activity

  1. Mikola Lysenko (mikolalysenko)
    added
    bugSomething isn't workingSomething isn't working
    arch-auditFiled by a scheduled architecture audit routine (see the architecture review discussion)Filed by a scheduled architecture audit routine (see the architecture review discussion)
    on Nov 2, 2026
  2. mikolalysenko commented on Nov 2, 2026

    @mikolalysenko
    Mikola Lysenko (mikolalysenko)
    on Nov 2, 2026
    CollaboratorAuthor
    More actions

    [agent] Triaged: priority:p3 (test hermeticity). Confirmed on main: CRAWLER_EXTRAS in tests/common/hermetic.rs is [Venv, Bundle, Composer] with no Go entry, so GOFLAGS/GOENV/GOWORK/GOPATH/GOMODCACHE reach socket-patch children. No open or merged PR addresses it. Same family as #1958 (color env, in flight in #1964) but a different variable set; related to #1980.


    Generated by Claude Code

  3. Mikola Lysenko (mikolalysenko)
    added
    agent:triaged
    priority:p3
    on Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent:triagedarch-auditFiled by a scheduled architecture audit routine (see the architecture review discussion)Filed by a scheduled architecture audit routine (see the architecture review discussion)bugSomething isn't workingSomething isn't workingpriority:p3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.