asterius icon indicating copy to clipboard operation
asterius copied to clipboard

Building on OS X with Nix fails

Open boggle opened this issue 5 years ago • 1 comments

Describe the bug I'm trying to build a clean checkout of asterius on Mac OS X.

My setup is:

  • 10.15.7
  • cabal 3.2.0.0
  • ghc 8.8.3
  • stack 2.5.1

installed via nix.

I also manually setup binaryen 98 and WASI-SDK.

To Reproduce

  • git checkout
  • stack build asterius
stack build asterius
Preparing to install GHC (custom-asterius) to an isolated location.
This will not interfere with any system-level installation.
Already downloaded.
ld: unknown option: --version
sed: RE error: illegal byte sequence
dyld: Library not loaded: /usr/local/opt/gmp/lib/libgmp.10.dylib
  Referenced from: /Users/stepup/.stack/programs/x86_64-osx/ghc-custom-asterius-8.8.4/lib/ghc-8.8.4/bin/ghc-pkg
  Reason: image not found
make: *** [Makefile:122: update_package_db] Abort trap: 6
Received ExitFailure 2 when running
Raw command: /Users/stepup/.nix-profile/bin/make install
Run from: /Users/stepup/.stack/programs/x86_64-osx/ghc-custom-asterius-8.8.4.temp/ghc-8.8.4/

To me this looks like your custom build of ghc is expecting libgmp in /usr/local (perhaps assuming the use of homebrew). While many people use homebrew, this isn't documented and leaves everyone who doesn't out in the cold.

Expected behavior

  • This should work, right?

Environment

  • OS name + version:
  • Version of the code:

Additional context This is the third time I'm trying to simply build your project. I think it would help asterius if this was generally easier. A description of how to do create the custom ghc build from scratch and how to continue from there might also help.

boggle avatar Nov 02 '20 14:11 boggle

Sorry for the frustration. We don't have official nix build support yet; as for how to build the custom ghc, it's a part of the documentation: https://asterius.netlify.app/building.html#about-the-custom-ghc-fork. I'm not enough familiar with nix yet to say how to continue from there, since the official build system is still based on stack.

TerrorJack avatar Nov 03 '20 09:11 TerrorJack