Skip to content

build issues with nix on macOS Mojave #677

Open
@tscholak

Description

@tscholak

I just cloned the repo and tried to build it with nix on macOS but to no avail:

$ git clone [email protected]:dhall-lang/dhall-haskell.git

$ cd dhall-haskell

$ git --no-pager log -1 --pretty=oneline
5db1051311c34c7709b3a11803e54ce4c911f272 (HEAD -> master, origin/master, origin/HEAD) Update stack/cabal config to sync with new structure (#671)

$ uname -a
Darwin futumorphism.local 18.0.0 Darwin Kernel Version 18.0.0: Wed Aug 22 20:13:40 PDT 2018; root:xnu-4903.201.2~1/RELEASE_X86_64 x86_64

$ xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates

$ echo $NIX_CFLAGS_COMPILE
-idirafter /usr/include

$ echo $NIX_CFLAGS_LINK
-L/usr/lib

$ nix-build
building '/nix/store/67p58mwal0lxmy16z77l6skh2p4w4z3k-cabal2nix-2.10.2.drv'...
setupCompilerEnvironmentPhase
Build with /nix/store/79qa9dkrjqh485pa888q0p2dfqznwdyp-ghc-8.4.3.
ignoring (possibly broken) abi-depends field for packages
ignoring (possibly broken) abi-depends field for packages
unpacking sources
unpacking source archive /nix/store/62hrfkr64piwp10q9pzxirvqk6n33v1f-cabal2nix-2.10.2.tar.gz
source root is cabal2nix-2.10.2
setting SOURCE_DATE_EPOCH to timestamp 1533552458 of file cabal2nix-2.10.2/test/golden-test-cases/zlib.nix.golden
patching sources
compileBuildDriverPhase
setupCompileFlags: -package-db=/private/var/folders/2y/4nx786m95275s94z8vpk5y_00000gn/T/nix-build-cabal2nix-2.10.2.drv-0/setup-package.conf.d -j8 -threaded
[1 of 1] Compiling Main             ( Setup.hs, /private/var/folders/2y/4nx786m95275s94z8vpk5y_00000gn/T/nix-build-cabal2nix-2.10.2.drv-0/Main.o )
Linking Setup ...
clang-5.0: warning: argument unused during compilation: '-nopie' [-Wunused-command-line-argument]

In file included from /private/var/folders/2y/4nx786m95275s94z8vpk5y_00000gn/T/nix-build-cabal2nix-2.10.2.drv-0/ghc58514_0/ghc_4.c:1:0: error:


In file included from /nix/store/79qa9dkrjqh485pa888q0p2dfqznwdyp-ghc-8.4.3/lib/ghc-8.4.3/include/Rts.h:29:0: error:


/nix/store/79qa9dkrjqh485pa888q0p2dfqznwdyp-ghc-8.4.3/lib/ghc-8.4.3/include/Stg.h:77:10: error:
     fatal error: 'math.h' file not found
   |
77 | #include <math.h>
   |          ^
#include <math.h>
         ^~~~~~~~
1 error generated.
`cc' failed in phase `C Compiler'. (Exit code: 1)
builder for '/nix/store/67p58mwal0lxmy16z77l6skh2p4w4z3k-cabal2nix-2.10.2.drv' failed with exit code 1
cannot build derivation '/nix/store/cjy2rkd5qdqzpkqkgrdgl92vn3qlmyfh-cabal2nix-dhall.drv': 1 dependencies couldn't be built
error: build of '/nix/store/cjy2rkd5qdqzpkqkgrdgl92vn3qlmyfh-cabal2nix-dhall.drv' failed
(use '--show-trace' to show detailed location information)

Is there a workaround for this other than https://hydra.nixos.org/build/83911384/download/1/nixpkgs/manual.html#builds-on-darwin-fail-with-math.h-not-found? It doesn't seem that this workaround actually works...

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildBuilding, testing, installing, packaging, etc

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions