This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.
Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
This still does not build.
> DEBUG: Executing: `/nix/store/k4mvgh65zn6xb4f6zs9kypz4lq8sgmk3-clang-wrapper-19.1.7/bin/clang -isysroot /nix/store/qvbwadc5f7akpzaf3psd41wjl5jq8333-apple-sdk-14.4/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.sdk -mmacosx-version-min=11.3 -std=gnu99 -fuse-ld=lld -Wl,--version`
> ERROR: Failed to find an adequate linker
It has been EOL for several years now, and the last dependant(couchdb3)
no longer requires it as of #436932.
I've also removed all conditionals in the common.nix build file that
were for versions older than 115, since we no longer ship any versions
older than that. I would like to remove 115 and 128 soon as well, since
as of commit, they reach end of life in 3 weeks(in fact, 115 is EOL for
all platforms we support afaik)
This was done with booxter’s fantastic [nix-clean-apple_sdk] tool,
simply modified to look for `libobjc` rather than the existing list he
already used in <https://github.com/NixOS/nixpkgs/pull/398707>. Some
manual work was applied, including cleaning up a string interpolation
in the terrifying MacVim derivation, stray comments, empty lists,
function parameters, and `inherit`s, including all of the references in
`all-packages.nix`.
[nix-clean-apple_sdk]: https://github.com/booxter/nix-clean-apple_sdk
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.
Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.
A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.
This commit was automatically created and can be verified using
nix-build a08b3a4d19.tar.gz \
--argstr baseRev b32a094368
result/bin/apply-formatting $NIXPKGS_PATH
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"
```
rustc 1.73.0 introduced a new x86_64-unikraft-linux-musl target. This
triple is a bit of a lie — the kernel in this case is unikraft, which
isn't Linux, it just tries to be compatible with it. But this
User-Agent-like string of a triple now exists, and with it comes some
fallout.
Spidermonkey asks rustc for the list of supported targets, then picks
the one that best matches the GNU triple it's building for, which in
the native case config.guess will say is x86_64-pc-linux-musl. Prior
to rustc 1.73.0, all was well, because there was only one x86_64 musl
triple, but now there are two: x86_64-unknown-linux-musl, and
x86_64-unikraft-linux-musl, and neither of those are obviously closer
than the other to x86_64-pc-linux-musl to Spidermonkey's build system.
As a result, it can't decide which target to pass to rustc, and bails
out.
We can fix this by telling Spidermonkey what platform it should be
building for, rather than letting it guess, which previously we did
only when cross compiling. This approach is already used in the
Firefox derivation (which is why it was not affected by the rustc
update), so it's been well tested already.
Closes: https://github.com/NixOS/nixpkgs/pull/266560
Closes: https://github.com/NixOS/nixpkgs/pull/282923
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