config.{allow,block}listedLicenses: fixups#457038
config.{allow,block}listedLicenses: fixups#457038ConnorBaker wants to merge 3 commits intoNixOS:masterfrom
Conversation
|
This fixes my problem in #456994. Thank you! |
|
Having done a bit of digging into why this is causing infinite recursion (I got nerd-sniped by the "for reasons which aren't immediately clear" comment...) I've identified the problem and proposed a somewhat scarier but possibly more "correct" fix at #457120. |
emilazy
left a comment
There was a problem hiding this comment.
Seems like a reasonable quick fix if the original commit is not reverted.
| # NOTE: The type should be `types.listOf (types.attrsOf types.anything)` -- however, this causes infinite | ||
| # recursion when `config` is a function for reasons which aren't immediately clear. | ||
| # For now, we use types.raw, the same type used by `freeformType`. |
There was a problem hiding this comment.
It seems clear to me: the available attributes of pkgs depend on at least config.allowAliases, so pkgs.lib cannot be resolved without considering at least some of config?
There was a problem hiding this comment.
That would make sense for why config.allowAliases cannot depend on pkgs, but that doesn't make sense for licenses (the value of which should not add or remove packages, but determine whether they evaluate).
There was a problem hiding this comment.
Updated the wording to be less ambiguous -- thank you @me-and for diving into the call stack in #457120 (comment)!
…finite recursion Signed-off-by: Connor Baker <ConnorBaker01@gmail.com>
…leWith Signed-off-by: Connor Baker <ConnorBaker01@gmail.com>
Signed-off-by: Connor Baker <ConnorBaker01@gmail.com>
6b94fcd to
d479586
Compare
|
Well, error: The option `allowlistedLicenses' is defined multiple times while it's expected to be unique.
Definition values:
- In `/nix/store/ys7j7kdp249w2mcbxcppnmna01vq7693-source/pkgs/top-level/config.nix': [ ]
- In `nixpkgs.config': [ ]I'm closing this PR and introducing another which reverts this change entirely. |
This reverts commit f5deefd. See: - NixOS#437723 (introduced commit) - NixOS#456994 (reported breakage) - NixOS#457038 (attempted fix, closed in favor of this revert) - NixOS#457120 (fix which would require more breaking changes)
As title.
Hot-fix for #456994.
Ideally this wouldn't cause infinite recursion, but I don't have the bandwidth to investigate that right now. Using
types.rawis fine (that's the default for values which don't have an option here) and lets us keep the module documentation.Additionally, introduces module options for
blacklistedLicensesandwhitelistedLicensesthroughmkRenamedOptionModuleWith, continuing the work started in #114127 by creating warnings when used in future releases. This also reverts the unintentional breaking change introduced by f5deefd which removed usage ofblacklistedLicensesandwhitelistedLicensesfromcheck-meta.nix.EDIT:
mkRenamedOptionModuleWithis incompatible withtypes.rawwhen the aliased module supplies a default becausetypes.rawprevents merging: #457038 (comment).Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.Add a 👍 reaction to pull requests you find important.