-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
stdenv: Deprecate string configureFlags #45886
stdenv: Deprecate string configureFlags #45886
Conversation
e1bde0a
to
64c77fa
Compare
Success on x86_64-linux (full log) Attempted: stdenv Partial log (click to expand)
|
Success on aarch64-linux (full log) Attempted: stdenv Partial log (click to expand)
|
Qt 3 part moved to #45888 |
Success on x86_64-darwin (full log) Attempted: stdenv Partial log (click to expand)
|
Doesn't the title suggest the exact opposite? If we deprecate non-string configureFlags, all configureFlags would be strings. |
Yes, when we get to use the feature this will make sense. But currently we do not, and as the code for using it doesn't exist, it obviously won't make it to 18.09. And if/when we do it, it doesn't make sense to single out just So as such, the situation as in @edolstra's comment seems to still hold: #15799 (comment) |
Isn't something like this necessary as a first step to get nixpkgs ready for structured builder attributes? |
(/**/ if lib.isString configureFlags then builtins.trace | ||
"String `configureFlags` is deprecated since 18.09. Please use a list of flags, each a string." | ||
[configureFlags] | ||
else if configureFlags == null then builtins.trace |
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.
I'm not sure null
should be disallowed, since it has a special meaning because of the __ignoreNulls
feature in Nix. For example, you can add an attribute like
configureFlags = if stdenv.isDarwin then ["blabla"] else null;
and this won't change the derivation on non-Darwin platforms (so doesn't cause a rebuild).
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.
@edolstra Currently because of the way configurePlatforms is handled, it's already a list anyways, so there is no risk of mass rebuilds.
In general, I rather default everything to []
, false
, etc (or conversely filter out everything that isn't needed) so that the no-rebuild trick happens automatically without needing to write awkward things at the package level.
Well, for one we first need a transition plan for not silently breaking code which has list elements |
@dezgeg We can additionally deprecate spaces unless the Nix 2.0 thing is in use. (I recall being able to use it on a derivation-by-derivation basis.) If someone tells me how to do that structured attractive check, I'll add it and fix the title (should be "non-list"), and then I think this is ready to go. |
@dezgeg Ah, good point that set of packages is probably much bigger. |
At some point it would be nice to remove suppport for this altogether.
64c77fa
to
7c82eff
Compare
Success on x86_64-linux (full log) Attempted: stdenv Partial log (click to expand)
|
Success on aarch64-linux (full log) Attempted: stdenv Partial log (click to expand)
|
Success on x86_64-darwin (full log) Attempted: stdenv Partial log (click to expand)
|
I don't feel like putting such a thing into 18.09 this late (especially when a consensus isn't really clear yet). I don't see a problem with postponing this, with master branch (perhaps) getting stricter than stable. |
There's not really an advantage to doing this now rather than if/when we ever switch to structured attributes. |
@edolstra if we wait until when we actually make the transition, then there's no time to deprecate. The whole point of depreciations is to clear the way for breaking changes that happen later; they must happen in advance to provide any benefit. |
@vcunat certainly we should have concensus before doing anything, but I don't think "last-minute" depreciations are bad in and of themselves in that they are purely cautionary: there's no corresponding last minute action the user is forced to take. The slight downside with a post-release deprecation is we effectively wait another cycle before doing anything. I.e people that only use stable wouldn't see it until 19.03, and I think we all agree that the minimum warning time before some breaking change should be counted for them, not the unstable users that get the head start. |
(triage) Given there is certainly a need for consensus here, I think this should be made into a proper RFC. |
Thank you for your contributions.
|
I marked this as stale due to inactivity. → More info |
Let's do this after 22.05 branch off so we do this at some point instead of procrastinating until we have to do this there's been about 8 releases since 2018 so.. |
Motivation for this change
This is better style, especially once we use the Nix 2.0 feature to go directly to bash arrays. #44423 already made nixpkgs largely conforming.
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)