When building rust-src like in
```
nix build --impure -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/refs/tags/23.05.tar.gz --argstr PWD $PWD --expr '{ PWD }:(import <nixpkgs> { overlays = (builtins.getFlake PWD).overlays.rust ];}).latest.rustChannels.stable.rust-src' -L --out-link rust-src-stable
```
after fixing the previous error the build failed since commit f6fe8508b0 with an error like
```
realpath: missing operand
```
because, bash shopt nullglob is enabled during build which leads to a
non-existing glob matching pattern to be a null string and therefore
the check with `ls $out/lib/librustc_driver-*.so` lists the whole
directory and succeeds.
```
bash -c 'shopt -s nullglob; if ls $PWD/rust-o*.nixxxxxxxxxxx &> /dev/null ; then echo yes ; else echo no ; fi'
yes
```
This commit changes the check to compare the null string resulting
from glob pattern match with nullglob enabled against another null
string.
When building rust-src like in
```
nix build --impure -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/refs/tags/23.05.tar.gz --argstr PWD $PWD --expr '{ PWD }:(import <nixpkgs> { overlays = (builtins.getFlake PWD).overlays.rust ];}).latest.rustChannels.stable.rust-src' -L --out-link rust-src-stable
```
the build failed since commit f6fe8508b0 with an error like
```
chmod: cannot access '/nix/store/rawpkwl6b5h2qqv41w8yqgpayp89q9xa-rust-src-1.71.0-2023-07-12-8ede3aae2/bin/rustc': No such file or directory
```
because, indeed this file is not present in rust-src build output.
This commit moves the failing commands inside the conditional block
so that they are only executed when the file is present.
Rust changed the way the SYSROOT is determined in: https://github.com/rust-lang/rust/pull/103660
Before this change the SYSROOT was determined based on the rustc
executable. Now it is determined based on the librustc_driver-*.so file.
This pr fixes the detection by copying the library to the derivation as
we have done it for the rustc executable.
verifyFileAuthenticity now asserts that the checksums it’s verifying
really contain the file to be verified. Also, it now accepts SHA-256
hashes of the checksum files themselves, so that after storing the
result of an impurely evaluated versionInfo call, one can build
firefoxVersion in pure evaluation mode. This is necessary for
flake-firefox-nightly:
https://github.com/colemickens/flake-firefox-nightly/issues/3
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
The `rustToolchain` option can now by given a path to a TOML-formatted
toolchain file, which is expected to have the extension `.toml`. We
parse it and extract the `channel` and `date`.
Fixes this error on current nixos-unstable:
$ nix build -Lf '<nixpkgs>' latest.firefox-bin
error: 'wrapper' at /nix/store/bgamkl5agk73pncifps984yil4hfhvkk-nixos-21.11pre308541.6fc5211eddd/nixos/pkgs/applications/networking/browsers/firefox/wrapper.nix:23:5 called with unexpected argument 'browserName', at /nix/store/bgamkl5agk73pncifps984yil4hfhvkk-nixos-21.11pre308541.6fc5211eddd/nixos/lib/customisation.nix:69:16
See
711d674e13.
Signed-off-by: Anders Kaseorg <andersk@mit.edu>