cdepillabout / cdepillabout/termonad

error when building on Mac OS X with nix

Open
#80 3 comments 1 reaction 0 assignees View on GitHub
bug help wanted high-priority
Dominant language
Haskell
Stars
418
Forks
51
PR merge metrics
No merged PRs in 30d

Description

There is an error when building on Mac OS X with `nix-build`:

```sh
$ nix-build
these derivations will be built:
/nix/store/i9bshwz2c399kp7l4lx250pbmfmhybwg-gi-gdk-3.0.16.drv
/nix/store/9jbrqdyyn8pv2sqyq6nji8czrn1asgj4-gi-gtk-3.0.25.drv
/nix/store/z6avnj4m301v98gz5qalqypbcaw41xdj-gi-vte-2.91.19.drv
/nix/store/vnwd225s1nqci5rmllq3dfsxqz9zr8mf-termonad-0.2.1.0.drv
/nix/store/cnjfxi5wqy6afhvqzgf83xmrr51viw4m-ghc-8.4.4-with-packages.drv
/nix/store/n8n8wpasf3047q269simcf03zx71v7lv-termonad-with-packages-8.4.4.drv
building '/nix/store/i9bshwz2c399kp7l4lx250pbmfmhybwg-gi-gdk-3.0.16.drv'...
setupCompilerEnvironmentPhase
Build with /nix/store/dxljd69cp3m5cgfl53h0fjbq202m0fm7-ghc-8.4.4.
unpacking sources
unpacking source archive /nix/store/fab0pd9x1x2w949a33lsl3m1mkbh4890-gi-gdk-3.0.16.tar.gz
source root is gi-gdk-3.0.16
setting SOURCE_DATE_EPOCH to timestamp 1526109557 of file gi-gdk-3.0.16/stack.yaml
patching sources
compileBuildDriverPhase
setupCompileFlags: -package-db=/private/var/folders/1b/r0tb60rs58jbyrp6fcbhy62h0000gn/T/nix-build-gi-gdk-3.0.16.drv-0/setup-package.conf.d -j12 -threaded
[1 of 1] Compiling Main ( Setup.hs, /private/var/folders/1b/r0tb60rs58jbyrp6fcbhy62h0000gn/T/nix-build-gi-gdk-3.0.16.drv-0/Main.o )
Linking Setup ...
clang-5.0: warning: argument unused during compilation: '-nopie' [-Wunused-command-line-argument]
/nix/store/l928iaj0m48lfb7dib6h7p22d50l566x-clang-wrapper-5.0.2/bin/cc: line 183: /nix/store/9sczacl37p08kdw7c4a11cm05355088w-clang-5.0.2/bin/clang: Argument list too long
`cc' failed in phase `Linker'. (Exit code: 126)
builder for '/nix/store/i9bshwz2c399kp7l4lx250pbmfmhybwg-gi-gdk-3.0.16.drv' failed with exit code 1
cannot build derivation '/nix/store/cnjfxi5wqy6afhvqzgf83xmrr51viw4m-ghc-8.4.4-with-packages.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/n8n8wpasf3047q269simcf03zx71v7lv-termonad-with-packages-8.4.4.drv': 1 dependencies couldn't be built
error: build of '/nix/store/n8n8wpasf3047q269simcf03zx71v7lv-termonad-with-packages-8.4.4.drv' failed
```

The line in question is the following:

```
/nix/store/l928iaj0m48lfb7dib6h7p22d50l566x-clang-wrapper-5.0.2/bin/cc: line 183: /nix/store/9sczacl37p08kdw7c4a11cm05355088w-clang-5.0.2/bin/clang: Argument list too long
```

I'm pretty sure this is https://github.com/NixOS/nixpkgs/issues/41340.

I tried to work around it by setting `strictDeps = true` in branch [`strictDeps-on-haskell-gi-libs-for-mac`](https://github.com/cdepillabout/termonad/tree/strictDeps-on-haskell-gi-libs-for-mac), commit 72714459c78, but then Termonad itself couldn't be built.

I also tried to work around this by using the patch from https://github.com/NixOS/nixpkgs/pull/49552 in branch [`try-using-new-stdenv-builder`](https://github.com/cdepillabout/termonad/tree/try-using-new-stdenv-builder), commit cc62b39, but something early on in the build process failed.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the failure with nix-build on Mac OS X and inspect the reported clang-wrapper error for gi-gdk. Review the strictDeps-on-haskell-gi-libs-for-mac and try-using-new-stdenv-builder branches at their mentioned commits, along with the referenced nixpkgs issue and pull request. Done means Termonad builds successfully with nix-build on the affected platform.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
build-system, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.