Skip to content

Scope go:generate, cgo, assembly and plugin fallbacks to the affected package #78

Open

Description

@adityankale190895

Part of #76.

analyzeGoMetadata in src/repo/adapters/go.ts pushes these to the global blockers list:

  • Go <pkg>: cgo dependencies require full validation
  • Go <pkg>: native assembly/object dependencies require full validation
  • Go <pkg>: runtime plugins require full validation
  • Go <file>: generated or linked dependencies require full validation

A global blocker makes every change fall back, so one //go:generate stringer or mockgen line anywhere disables selection for the whole repository. Most medium-sized Go repositories have at least one.

Proposal

  • Report these through subjectBlockers / fileBlockers (see AdapterContribution in src/repo/adapters/types.ts and how vue.ts uses them). Changes that can't reach the package then stay selective.
  • //go:generate: the generated output is usually committed, so go list already sees it as a normal source. Fall back only when the file with the directive, or the generator's inputs, change.
  • //go:linkname: keep a global blocker. It can reach into any package, so scoping isn't safe.

Must fall back (blocker)

  • A change to a package with cgo/assembly/plugin, or to anything that reaches it.
  • Any //go:linkname use (still global).

Done when

  • Fixtures show that a change in package a stays selective when unrelated package b has a //go:generate line or cgo files, and that a change in b (or a package b imports) still falls back.

Activity

  1. added
    enhancement
    help wanted
    on Nov 9, 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

    adapterenhancementhelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions