We are migrating packages that meet below requirements:
1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration
The tool is here: https://github.com/Aleksanaa/by-name-migrate.
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"
```
Prior to August 2023, any config.guess generated by autoconf will
include a hardcoded /usr/bin/uname invocation for FreeBSD on any
architecture other than arm. This clearly doesn't work under nix.
We must then update or otherwise patch each old config.guess.
The nixpkgs-unstable channel's programs.sqlite was used to identify
packages producing exactly one binary, and these automatically added
to their package definitions wherever possible.
`binutils` for darwin was added in (add binutils to bash build for size)[9c153e2227].
The override was added in (bash: provide a working binutils)[9e05276949].
TIme to time I bump into pathological behaviour of `bash` memory
allocator. Today's example:
$ time { ls /nix/store/ > /dev/null; }
real 0m0,965s user 0m0,876s sys 0m0,087s
$ time { echo /nix/store/* > /dev/null; }
real 2m18,287s user 2m17,946s sys 0m0,125s
$ time { echo /nix/store/* > /dev/null; }
real 0m1,764s user 0m1,712s sys 0m0,048s
Note how initial `echo` takes alsmot 2 minutes to finish.
Let's rely on system's allocator instead.
After the change initial run is fast again:
$ time { echo /nix/store/* > /dev/null; }
real 0m1,328s user 0m1,264s sys 0m0,063s
As reported by Robert Scott in https://github.com/NixOS/nixpkgs/pull/245066
without the change `make -j8` build of `make` occasionally fails to
buildin parallel. The simplest reproducer is:
$$ ./configure
$$ make unwind_prot.o
...
In file included from unwind_prot.c:51:
In file included from ./bashintl.h:30:
./include/gettext.h:27:11: fatal error: 'libintl.h' file not found
# include <libintl.h>
^~~~~~~~~~~
1 error generated.
make: * [Makefile:106: unwind_prot.o] Error 1
The change adds missing ttransitive `${LIBINTL_H}` dependency for
unwind_prot.o.
with structuredAttrs lists will be bash arrays which cannot be exported
which will be a issue with some patches and some wrappers like cc-wrapper
this makes it clearer that NIX_CFLAGS_COMPILE must be a string as lists
in env cause a eval failure
checkInputs used to be added to nativeBuildInputs. Now we have
nativeCheckInputs to do that instead. Doing this treewide change allows
to keep hashes identical to before the introduction of
nativeCheckInputs.
See https://github.com/hedning/nix-bash-completions/issues/20.
Even with the low priority on this package, completing `nix-build` will
load the nix-bash-completion for the `nix` command, which is undesirable
since Nix provides its own completion since 2.4.
The maintainer seems unresponsive.