plugin: add API_LEVEL guard between nix expr and resolver .so#130
Merged
Conversation
f45efde to
c94b832
Compare
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.
c94b832 to
b1f0c4e
Compare
Benchmark Regression Check
Baseline: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.