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
Because the configure script hasn't been update to work with Python 3.10
and never will. Spidermonkey 78 is EOL.
Traceback (most recent call last):
File "/build/firefox-78.15.0/obj/../js/src/../../configure.py", line 25, in <module>
from mozbuild.configure import (
File "/build/firefox-78.15.0/python/mozbuild/mozbuild/configure/__init__.py", line 33, in <module>
from mozbuild.util import (
File "/build/firefox-78.15.0/python/mozbuild/mozbuild/util.py", line 760, in <module>
class HierarchicalStringList(object):
File "/build/firefox-78.15.0/python/mozbuild/mozbuild/util.py", line 785, in HierarchicalStringList
class StringListAdaptor(collections.Sequence):
AttributeError: module 'collections' has no attribute 'Sequence'
Split the argument list into build and runtime dependencies and sort
everything alphabetically.
Unpin icu, it works with icu70, which is the latest version at this
time.
Remove yasm, it's not needed in firefox either.
Spidermonkey depends on rustc, so we have the best chance at only
having a single LLVM in the build closure if we use the same LLVM that
rustc depends on.
cc-rs is hardcoded to use the soft-float ABI for riscv64, while
the rest of the system is double-float. This is not just a missing
stub header file - You can't link object files using different
ABIs.
The configurePlatforms mkDerivation parameter needs to be an empty list
to avoid bogus defaults from breaking cross compilation.
Document the parameter to prevent it from being cleaned up.