Skip to content
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

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions pkgs/stdenv/generic/make-derivation.nix
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,12 @@ rec {

# This parameter is sometimes a string, sometimes null, and sometimes a list, yuck
configureFlags = let inherit (lib) optional elem; in
(/**/ if lib.isString configureFlags then [configureFlags]
else if configureFlags == null then []
(/**/ 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
Copy link
Member

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).

Copy link
Member Author

@Ericson2314 Ericson2314 Sep 1, 2018

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.

"Null `configureFlags` is deprecated since 18.09. Please use the empty list, `[]`"
[]
else configureFlags)
++ optional (elem "build" configurePlatforms) "--build=${stdenv.buildPlatform.config}"
++ optional (elem "host" configurePlatforms) "--host=${stdenv.hostPlatform.config}"
Expand Down