Skip to content

Add opt-in Go package resolution - #4

Draft
ryantm wants to merge 1 commit into
fix/duplex-store-uploadsfrom
feat/go-package-resolver
Draft

ryantm wants to merge 1 commit into
fix/duplex-store-uploadsfrom
feat/go-package-resolver

Conversation

@ryantm

@ryantm ryantm commented Nov 24, 2026 •

Copy link
Copy Markdown

Summary

Add an opt-in builtins.resolveGoPackages adapter for hybrid discovery:

  • The host supplies an absolute IETS_GO2NIX_RESOLVER executable. Flakes and project settings cannot choose the executable, and the builtin stays absent by default.
  • Materialize the exact filtered source from the virtual store before sending go2nix's JSON request to the helper. Return its JSON object without reimplementing Go dependency resolution.
  • Reject derivation-backed arguments rather than building during evaluation. Disable the tracing cache when the adapter is enabled because the resolver can read the host's module cache and environment.
  • Provide lib.mkGo2nixResolver to package an existing, ABI-matched Nix/go2nix plugin as the helper. Only that resolver call uses Nix; iets still evaluates the flake and its derivations.

The PR targets the existing upload-fix branch so that adopting the adapter preserves the upload correction.

Why

iets does not load native Nix plugins. A flake using go2nix's resolveGoPackages therefore falls back to Nix for every affected output. This adapter supplies the missing operation while keeping the existing resolver and toolchain under the host's control.

Validation

  • Eight focused tests passed, including virtual-source filtering, pure source access, no-IFD rejection, host opt-in, helper errors and cache safety.
  • The final stacked-branch library suite passed: 1,375 tests, four ignored.
  • A real Go module with tests returned identical resolver JSON through the native plugin and the adapter. The packaged helper built successfully.
  • A locked workload previously produced 1,091 iets jobs and 196 missing-builtin errors. The adapter replay produced 1,287 jobs with zero errors. All 1,091 existing local derivation paths stayed unchanged, and all 196 newly handled paths matched the Nix-produced paths.
  • Formatting, structural lint, Clippy with warnings denied, the release build and doctests passed on the stacked branch.
  • The broad integration run failed four cases across classic_build, classic_shell and e2e_daemon. All four failures were reproduced on the unchanged upload-fix parent. Other test targets passed.

The workload replay used eval-jobs --no-instantiate; it verifies evaluation results, not daemon uploads, builds or a production rollout. No production timing claim is included.

Post-publication: the remote head matches the locally tested commit. macOS and both Windows jobs passed; policy review is pending.

Revertibility

Safe to revert. The adapter is off by default; a host can also unset IETS_GO2NIX_RESOLVER to return to the previous missing-builtin/fallback behavior. No data or protocol migration is involved.

Chat about this change

~ written by ⠕ Replit

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