Skip to content

plugin: add API_LEVEL guard between nix expr and resolver .so#130

Merged
Mic92 merged 1 commit intomainfrom
aldo/plugin-api-level
May 4, 2026
Merged

plugin: add API_LEVEL guard between nix expr and resolver .so#130
Mic92 merged 1 commit intomainfrom
aldo/plugin-api-level

Conversation

@Mic92
Copy link
Copy Markdown
Member

@Mic92 Mic92 commented May 4, 2026

A Nix that statically links one go2nix-nix-plugin revision while
evaluating a different nix/ tree surfaces today as an obscure
attribute-missing failure deep in the dag builder, after a successful
resolveGoPackages call returns a JsonOutput shape the consumer no
longer understands.

Stamp a contract version on both sides. The resolver exposes API_LEVEL
via a new __go2nixApiLevel primop (bound as builtins.go2nixApiLevel
since Nix strips the leading underscores); nix/dag/default.nix asserts
equality before calling resolveGoPackages and warns with both numbers
on mismatch. Mirrors cargo-nix-plugin so any future incompatible
JsonOutput change just bumps both constants in lockstep. The
experimental mode runs go list at build time and is unaffected.

@Mic92 Mic92 force-pushed the aldo/plugin-api-level branch from f45efde to c94b832 Compare May 4, 2026 12:19
A Nix that statically links one go2nix-nix-plugin revision while
evaluating a different nix/ tree surfaces today as an obscure
attribute-missing failure deep in the dag builder, after a successful
resolveGoPackages call returns a JsonOutput shape the consumer no
longer understands.

Stamp a contract version on both sides. The resolver exposes API_LEVEL
via a new __go2nixApiLevel primop (bound as builtins.go2nixApiLevel
since Nix strips the leading underscores); nix/dag/default.nix asserts
equality before calling resolveGoPackages and warns with both numbers
on mismatch. Mirrors cargo-nix-plugin so any future incompatible
JsonOutput change just bumps both constants in lockstep. The
experimental mode runs go list at build time and is unaffected.
@Mic92 Mic92 force-pushed the aldo/plugin-api-level branch from c94b832 to b1f0c4e Compare May 4, 2026 12:23
@Mic92 Mic92 added this pull request to the merge queue May 4, 2026
Merged via the queue into main with commit 59bf3f8 May 4, 2026
3 checks passed
@Mic92 Mic92 deleted the aldo/plugin-api-level branch May 4, 2026 12:28
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

Benchmark Regression Check

Scenario Tool Base (s) Current (s) Change Drvs (base) Drvs (curr) Status
no_change nix-ca-nocgo 0.68 0.68 -0.2% 0 0 ok
no_change nix-nocgo 0.68 0.68 +0.1% 0 0 ok
leaf-private nix-ca-nocgo 2.36 2.27 -4.0% 2 2 ok
leaf-private nix-nocgo 1.62 1.60 -1.3% 2 2 ok
mid-private nix-ca-nocgo 2.49 2.42 -2.7% 2 2 ok
mid-private nix-nocgo 1.72 1.74 +1.4% 4 4 ok
deep-private nix-ca-nocgo 2.92 2.56 -12.3% 3 3 ok
deep-private nix-nocgo 1.93 1.96 +1.7% 8 8 ok

Baseline: main | Current: 41f5ea8c04bee0375ec93a81e9263659390b232a

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