Repository navigation
fix: mkInstanceRegistry supplies lib to its modules - #768
Merged
Merged
Conversation
den wrapped gen-schema's mkInstanceType and mkSchemaOption with withLib
(and mkInstanceType with withResolved), but passed mkInstanceRegistry
through, so a registry module taking { lib, ... } was refused. Wrap it
the same way as mkInstanceType.
Reported in GitHub #766.
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.
Summary
Reported by @AlexLov in #766: a module in
extraModulesthat takeslibworks withden.lib.schema.mkInstanceType, but fails withden.lib.schema.mkInstanceRegistry:den wraps gen-schema's
mkInstanceTypeandmkSchemaOptionso that every module gets nixpkgs'libthroughspecialArgs(withLibinnix/lib/schema.nix), and so that entity kinds get theresolvedcontext module (withResolved).mkInstanceRegistrycame through from gen-schema unwrapped, so a module asking forlibgot nothing, and gen-merge's guard reported it as a declaration-stratum read.This wraps
mkInstanceRegistrythe same waymkInstanceTypeis wrapped. A caller's ownspecialArgsstill win, as with the other two.The misleading message itself is gen-merge's; a clearer one is being worked on separately.
Validation
New cells,
templates/ci/modules/deadbugs/instance-registry-lib.nix:lib;name;specialArgsreaching the module alongsidelib.All three fail on main with attribute 'deprecationMessage' missing when using `den.lib.schema.mkInstanceRegistry` #766's error and pass here.
Full suite (
ci.bash, 4 workers): 2203/2203 (the 2200 on main plus the three new cells).