Co-authored-by: Simon Bruder <simon@sbruder.de>
Co-authored-by: Abdullah Imad <me@imad.nyc>
Co-authored-by: Alberto Merino <amerinor01@gmail.com>
Co-authored-by: Enric Morales <me@enric.me>
Co-authored-by: Jack Leightcap <jack@leightcap.com>
Co-authored-by: Roland Coeurjoly <rolandcoeurjoly@gmail.com>
Without the change the eval fails as:
$ nix build --no-link -f. nix-plugin-pijul.tests
error:
… while calling the 'derivationStrict' builtin
at <nix/derivation-internal.nix>:34:12:
33|
34| strict = derivationStrict drvAttrs;
| ^
35|
… while evaluating derivation 'localRepoCheck-nix-2.25.0pre20240920_ca3fc169'
whose name attribute is located at pkgs/stdenv/generic/make-derivation.nix:336:7
… while evaluating attribute 'buildCommand' of derivation 'localRepoCheck-nix-2.25.0pre20240920_ca3fc169'
at pkgs/build-support/trivial-builders/default.nix:59:17:
58| enableParallelBuilding = true;
59| inherit buildCommand name;
| ^
60| passAsFile = [ "buildCommand" ]
(stack trace truncated; use '--show-trace' to show the full, detailed trace)
error: function 'anonymous lambda' called with unexpected argument 'nix'
at pkgs/by-name/ni/nix-plugin-pijul/package.nix:1:1:
1| {
| ^
2| lib,
Did you mean lib?
In preparation for the deprecation of `stdenv.isX`.
These shorthands are not conducive to cross-compilation because they
hide the platforms.
Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way
One example of why this is bad and especially affects compiler packages
https://www.github.com/NixOS/nixpkgs/pull/343059
There are too many files to go through manually but a treewide should
get users thinking when they see a `hostPlatform.isX` in a place where it
doesn't make sense.
```
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is"
fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is"
```