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"
```
The build for Sapling's isl package has changed:
* Instead of being a bunch of .js files installed along-side the main
executable, isl is now one isl-dist.tar.xz file extracted at
run-time by the 'sl web' command.
* To configure the 'node' executable used by 'sl web', set the
web.node-path Sapling setting by changing the default configs
embedded in the sl executable.
Upstream Sapling does not maintain a Cargo.lock file, so Nixpkgs has its
own. Teach the gen-deps.py script to update Nixpkgs' Cargo.lock whenever
the Cargo.toml files change.
Nixpkgs commit 451c6321 upgraded setuptools from version 65.0.3 to
version 67.4.0. This upgrade introduced a breaking change in
setuptools [1] which causes the Sapling package's build to fail:
setuptools.extern.packaging.version.InvalidVersion: Invalid version: '0.2.20230124-180750-hf8cd450a'
This is an upstream issue [2]. For now, work around this issue in
Nixpkgs by truncating Sapling's version number.
Before 451c6321:
$ nix-env -q sapling
sapling-0.2.20230228-144002-h9440b05e
$ sl --version
Sapling 0.2.20230228-144002-h9440b05e
After this patch:
$ nix-env -q sapling
sapling-0.2.20230228-144002-h9440b05e
$ sl --version
Sapling 0.2.20230228
Refs: 451c632147
[1] be6c0218bc/CHANGES.rst (v6600)
[2] https://github.com/facebook/sapling/issues/571
The build for the sapling package happens in three steps:
1. build sapling-isl
2. build sapling-main, copying files from sapling-isl
3. build sapling, copying files from sapling-main
I don't see a reason for splitting sapling-main and sapling. The problem
with splitting is that it makes it hard to use a package override to
patch sapling-main.
Merge sapling-main and sapling so I can easily apply patches with my
nixpkgs/config.nix.
This change fixes the path to 'nodejs' in the Sapling scripts, so that
the 'sl web' command works OOTB even if the user has a fresh `$PATH`
without node itself.
However, this is really a developer-only tool, and isn't needed just to
e.g. clone repositories. In particular, a 'fetchSapling' codepath would
not need it; therefore we make it optional, but turned on by default.
The intention is to have a 'saplingMinimal' expression which can be used
for that path.
NOTE: this does NOT add a 'saplingMinimal' expression to
all-packages.nix; that would just result in more Hydra churn, so we
avoid it for now.
Signed-off-by: Austin Seipp <aseipp@pobox.com>
There were two factors here: our cargo hook was messing up the cargo
config, which broke the build, and also an upstream bug where Sapling
didn't work on Python 3.10.
The upstream issue was filed as https://github.com/facebook/sapling/issues/279
We can get rid of the python 3.8 override as soon as this patch gets
into a released version.
Without this, `sl` simply fails on any non-NixOS machine with an
immediate failure, as it can't set the locale properly.
As usual, this can be fixed by setting LOCALE_ARCHIVE for glibc
explicitly. With this, `sl` works out of the box on NixOS and non-NixOS
machines.
Also add myself as a maintainer.
Signed-off-by: Austin Seipp <aseipp@pobox.com>