-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
replaceVars: allow exemptions #357395
replaceVars: allow exemptions #357395
Conversation
I like it. |
981783f
to
ac72d46
Compare
I like the idea, but I don’t love I would prefer (Or, semi‐serious straw proposal: |
I started to write this comment to argue for the semantics of
I like the idea, but that would open a can of worms: If |
I'm fine with either The argument in favor of Consider:
It's kind of a weak argument, and if we adopt a sentinel-based approach at all, I originally used As @wolfgangwalther points out, The really rogue sentinel value option is
There's some language that advocates against well-known sentinels in favor of these bespoke, qunine-ish beasts, but it's slipping my mind at the moment. I prefer |
FWIW, I believe the logic i had in mind could be implemented by dropping the conditional on However I agree it’s sort of weird. I like My one remaining counterproposal is just |
Me too. I was on deck to build it before Revenge of the Work Schedule dismayed my efforts. The day may yet come, it's just not now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
ac72d46
to
69712a8
Compare
I thought about that, but couldn't think of a regex to actually make this work. In any case ...
... I went with the null.
I'd leave that for a future improvement once it becomes necessary. |
Re-targeted to staging, because of quite a few rebuilds for darwin. Should be good to go from my side. |
FWIW, I don‘t think that will be possible: avoiding the pitfalls of |
Hm, I don't think I see the theoretical risk for passing optional dependencies accidentally as null with unwanted results, but (1) the build will almost certainly fail and (2) using null for optional dependencies is an anti-pattern anyway. I'd much rather see us making progress on NixOS/rfcs#169 or alternatives, than supporting that anti-pattern explicitly. |
I suppose that is true if you accept |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you update the commit message to reflect the switch from false
to null
? I'll merge after that.
replaceVars has a checkPhase to confirm that no left-over @...@ patterns remain. Since it's not possible to use "placeholder" with replaceVars, the substitution of some patterns must be delayed to a later step. By passing "null" for those keys explicitly, replaceVars can make an exemption *just for this case*, but keep checking all other references.
69712a8
to
2d64877
Compare
Done, no changes except for the commit message. |
replaceVars has a checkPhase to confirm that no left-over @...@ patterns remain. Since it's not possible to use "placeholder" with replaceVars, the substitution of some patterns must be delayed to a later step.
By passing "false" for those keys explicitly, replaceVars can make an exemption just for this case, but keep checking all other references.
This replaces the approach taken in #339303. @philiptaron
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.