mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-10-03 13:30:36 +00:00
dmd: improve eval failure on pkgsLLVM package set
`dmd` requires `libgcc` to be able to run `dmd` binary. As a result
`pkgsLLVM.dmd` fails the eval as:
$ nix build -f. pkgsLLVM.dmd
error: attribute 'libgcc' missing
at pkgs/development/compilers/dmd/binary.nix:31:5:
30| glibc
31| stdenv.cc.cc.libgcc
| ^
Such reference to non-existent attributes is an unrecoverable exception.
The change turns it into recoverable `assert`:
$ nix build --no-link -f. pkgsLLVM.dmd
error: assertion '((hostPlatform).isLinux -> (((stdenv).cc.cc) ? libgcc))' failed
at pkgs/development/compilers/dmd/binary.nix:12:1:
11| # and can't build `dmd`.
12| assert hostPlatform.isLinux -> (stdenv.cc.cc ? libgcc);
| ^
This commit is contained in:
@@ -5,7 +5,12 @@ let
|
||||
inherit (stdenv) hostPlatform;
|
||||
OS = if hostPlatform.isDarwin then "osx" else hostPlatform.parsed.kernel.name;
|
||||
MODEL = toString hostPlatform.parsed.cpu.bits;
|
||||
in stdenv.mkDerivation {
|
||||
in
|
||||
|
||||
# On linux pargets like `pkgsLLVM.dmd` `cc` does not expose `libgcc`
|
||||
# and can't build `dmd`.
|
||||
assert hostPlatform.isLinux -> (stdenv.cc.cc ? libgcc);
|
||||
stdenv.mkDerivation {
|
||||
pname = "dmd-bootstrap";
|
||||
inherit version;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user