stdenv: start deprecating non-list cmakeFlags#180067
Conversation
magnetophon
left a comment
There was a problem hiding this comment.
At least the faust part LGTM.
|
magnetophon
left a comment
There was a problem hiding this comment.
Not sure why my review was requested again, but I'll appease ofborg.
|
I'm being stalked by ofborg! ;) |
There was a problem hiding this comment.
The indentation here is weird – almost looks like it belongs to the else branch.
There was a problem hiding this comment.
Maybe something like the following to get rid of the alignment, which looks ugly with proportional fonts:
cmakeFlags =
let
inherit (lib) optionals;
explicitFlags =
if lib.isString cmakeFlags then
lib.warn
"String 'cmakeFlags' is deprecated and will be removed in release 23.05. Please use a list of strings. Derivation name: ${derivationArg.name}, file: ${pos.file or "unknown file"}"
[cmakeFlags]
else if cmakeFlags == null then
lib.warn
"Null 'cmakeFlags' is deprecated and will be removed in release 23.05. Please use a empty list instead '[]'. Derivation name: ${derivationArg.name}, file: ${pos.file or "unknown file"}"
[]
else
cmakeFlags;
crossFlags = [
"-DCMAKE_SYSTEM_NAME=${lib.findFirst lib.isString "Generic" (lib.optional (!stdenv.hostPlatform.isRedox) stdenv.hostPlatform.uname.system)}"
] ++ optionals (stdenv.hostPlatform.uname.processor != null) [
"-DCMAKE_SYSTEM_PROCESSOR=${stdenv.hostPlatform.uname.processor}"
] ++ optionals (stdenv.hostPlatform.uname.release != null) [
"-DCMAKE_SYSTEM_VERSION=${stdenv.hostPlatform.uname.release}"
] ++ optionals (stdenv.hostPlatform.isDarwin) [
"-DCMAKE_OSX_ARCHITECTURES=${stdenv.hostPlatform.darwinArch}"
] ++ optionals (stdenv.buildPlatform.uname.system != null) [
"-DCMAKE_HOST_SYSTEM_NAME=${stdenv.buildPlatform.uname.system}"
] ++ optionals (stdenv.buildPlatform.uname.processor != null) [
"-DCMAKE_HOST_SYSTEM_PROCESSOR=${stdenv.buildPlatform.uname.processor}"
] ++ optionals (stdenv.buildPlatform.uname.release != null) [
"-DCMAKE_HOST_SYSTEM_VERSION=${stdenv.buildPlatform.uname.release}"
];
in
explicitFlags
++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) crossFlags;There was a problem hiding this comment.
The lists were on the different lines before Sandro suggested they be on the same line
Also luckily everyone uses monospace fonts for programming
Will try applying your suggestion
There was a problem hiding this comment.
Also luckily everyone uses monospace fonts for programming
There's a good chance that they aren't if they noticed it :P
There was a problem hiding this comment.
applied the suggestion but reduced the vertical space need
There was a problem hiding this comment.
Also luckily everyone uses monospace fonts for programming
yes, JetBrains Mono
I don't like really like the code below. Its just a giant block and before we could easily see what happens but we bikesheeded enough here.
crossFlags = [
"-DCMAKE_SYSTEM_NAME=${lib.findFirst lib.isString "Generic" (lib.optional (!stdenv.hostPlatform.isRedox) stdenv.hostPlatform.uname.system)}"
] ++ optionals (stdenv.hostPlatform.uname.processor != null) [
"-DCMAKE_SYSTEM_PROCESSOR=${stdenv.hostPlatform.uname.processor}"
] ++ optionals (stdenv.hostPlatform.uname.release != null) [
"-DCMAKE_SYSTEM_VERSION=${stdenv.hostPlatform.uname.release}"
] ++ optionals (stdenv.hostPlatform.isDarwin) [
"-DCMAKE_OSX_ARCHITECTURES=${stdenv.hostPlatform.darwinArch}"
] ++ optionals (stdenv.buildPlatform.uname.system != null) [
"-DCMAKE_HOST_SYSTEM_NAME=${stdenv.buildPlatform.uname.system}"
] ++ optionals (stdenv.buildPlatform.uname.processor != null) [
"-DCMAKE_HOST_SYSTEM_PROCESSOR=${stdenv.buildPlatform.uname.processor}"
] ++ optionals (stdenv.buildPlatform.uname.release != null) [
"-DCMAKE_HOST_SYSTEM_VERSION=${stdenv.buildPlatform.uname.release}"
];the motivation for this is to simplify stdenv and ease the job of reviewers due to them needing to tell contributors about the defacto rule that cmakeFlags should be a list of strings
|
no more style changes please :P |

the motivation for this is to simplify stdenv and ease the job of
reviewers due to them needing to tell contributors about the defacto
rule that cmakeFlags should be a list of strings
Description of changes
continuation of #173172
this is why I made the deprecation release of them
23.05meson will be done in a pr after this one is merged
Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)nixos/doc/manual/md-to-db.shto update generated release notes