Skip to content

linkbinary,dag: pass module list via link manifest so lockfile-free builds emit dep lines#80

Merged
aldoborrero merged 1 commit intomainfrom
aldo/fix-modinfo-deps-lockfree
Apr 10, 2026
Merged

linkbinary,dag: pass module list via link manifest so lockfile-free builds emit dep lines#80
aldoborrero merged 1 commit intomainfrom
aldo/fix-modinfo-deps-lockfree

Conversation

@aldoborrero
Copy link
Copy Markdown
Member

Summary

go version -m showed zero dep lines for lockfile-free builds (goLock = null): link-binary only populated deps from lockfile.Read(*m.Lockfile), so debug.BuildInfo.Deps was empty and govulncheck/SBOM tooling saw nothing.

linkManifestJSON now carries a modules list (built from the same allModules + replacements that nix/dag already has from the plugin, regardless of lockfile), and link-binary consumes it directly. The lockfile-read path is removed — the manifest is the actual build set, and the lockfile is still used for mvscheck.CheckLockfile.

Replacement-target keys are filtered so a fork replace records one dep + => line rather than two dep lines.

Regression checks

  • test-fixture-torture-app-replace (lockfile-free, fork replace): asserts dep go.uber.org/atomic v1.11.0 + => github.com/uber-go/atomic
  • test-fixture-testify-basic (lockfile): asserts ≥1 dep line + dep github.com/stretchr/testify

Test plan

  • go test ./... (14 pkgs), go vet
  • Both fixture wrappers' new assertions pass against built binaries (output above)
  • nix flake check (formatting)

…uilds emit dep lines

link-binary populated debug.BuildInfo.Deps only by reading the
lockfile, so lockfile-free builds (goLock = null) embedded zero
`dep` lines and `go version -m` showed only path/mod/build.

The Nix build graph already has the resolved module set
(allModules + replacements), so thread it as `modules` in the
link manifest and consume that instead. Replacement targets are
filtered so a fork-style replace records `dep <orig> => <repl>`
rather than a spurious second dep entry.

The lockfile-read fallback is removed: nix/dag is the only
manifest producer and now always emits modules; the lockfile is
still passed for mvscheck.CheckLockfile.

Both wrapper tests now assert `go version -m` contains dep lines
(testify-basic for lockfile mode, torture-app-replace for
lockfile-free + replace).

:house: Remote-Dev: homespace
@aldoborrero aldoborrero added this pull request to the merge queue Apr 10, 2026
Merged via the queue into main with commit 6205ec9 Apr 10, 2026
2 checks passed
@aldoborrero aldoborrero deleted the aldo/fix-modinfo-deps-lockfree branch April 10, 2026 14:41
aldoborrero added a commit that referenced this pull request Apr 13, 2026
Seeds backlog/ with known deferred items for the grind workflow
(.claude/commands/grind.md, untracked):

- refactor: dead .has_cgo/.has_cxx markers (post-#85)
- refactor: pkg/lockfile/ dead-code audit (post-#80/#81/#106)
- refactor: filter *_test.go from CLI src so canary doesn't cascade
- coverage: pie buildmode fixture
- coverage: second dynamic-mode pkg-config fixture
- feat: GOFIPS140 snapshot mode (stdlib importcfg remap)
- feat: vendor/ directory support
- perf: #48 DAG cache revival (blocked, needs-human gate)

backlog/tried/ seeded with shipped Tier 1-3 perf work so it's not
re-attempted.

:house: Remote-Dev: homespace
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant