`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 reverts commit 7c73d1e025.
commit 8c80bd08b7
("build-support/cc-wrapper: pass in non-existent --sysroot= to untangle
from libc") was reverted. We can drop the workaround.
After https://github.com/NixOS/nixpkgs/pull/210004 `dmd` started failing
build as:
ld: warning: libm.so.6, needed by ./generated/linux/release/64/lib.so, not found (try using -rpath or -rpath-link)
ld: /build/druntime/generated/linux/release/64/libdruntime.so: undefined reference to `log10@GLIBC_2.2.5'
This happens because --sysroot=/nix/store/does/not/exist removes not
just include headers by prefixing wrong path, but also removes RUNPATH
dependencies of linked libraries. It's an unintended effect.
Restore the build by reversing the effect with --sysroot=/.
checkInputs used to be added to nativeBuildInputs. Now we have
nativeCheckInputs to do that instead. Doing this treewide change allows
to keep hashes identical to before the introduction of
nativeCheckInputs.
Without the change two tests fail on `binutils-2.39` due to whitespace
change in `objdump` output as:
FAILED targets:
- runnable/cdvecfill.sh
- compilable/cdcmp.d
Let's disable the tests until they are fixed upstream:
https://issues.dlang.org/show_bug.cgi?id=23317
It is building fine locally, tested by myself and @SuperSandro2000 (who had added the broken tag).
Should this be tested on hydra before removing it? I don't know if that is even possible.
This reverts commit c778945806.
I believe this is exactly what brings the staging branch into
the right shape after the last merge from master (through staging-next);
otherwise part of staging changes would be lost
(due to being already reachable from master but reverted).