[Nix-dev] gcc for MacOS X

Konrad Hinsen konrad.hinsen at fastmail.net
Wed Apr 4 18:23:15 CEST 2012


I have made some progress analyzing the build failures with gfortran I
see under 64-bit MacOS X.

The derivation whose build fails is gcc-apple-4.2.1.5666.3. I have the
basic version (no Fortran etc.) installed from the nix_unstable as a
binary, but when I request gfortran, it is built again with langF77
active. That seems quite reasonable.

However, the build fails for a reason completely unrelated to Fortran:
the patch file no-sys-dirs.patch, apparently made for gcc-4.1.0,
refers to files that don't exist in gcc-4.2.1. Closer inspection shows
more strangeness: the derivation downloads two source tar files, one
for gcc and one for libstdcxx, but the latter contains another copy of
the gcc sources and in fact seems to have the right structure for
applying the patches.

I tried to build (using nix-build) the very same gcc-4.2.1 that I
installed as a binary package, i.e. gcc without Fortran. As expected,
it fails. Which makes me wonder how the binary package I installed
could ever have been compiled.

One idea I had is that maybe the binaries were built from an earlier
versions of the nixpkgs sources. If my understanding of Nix is right,
this should not be possible because the cryptographic hashes should
then be different. Just in case, I tried to go back to earlier
revisions, before recent changes to gcc/4.2-apple64. Those builds all
fail for other reasons, which I don't really want to explore.

Is there any regular test of the build scripts in nixpkgs? The gcc for
darwin looks like no one tried to build it for a very long time.

Konrad.


More information about the nix-dev mailing list