IntersectMBO / plutus

The Plutus language implementation and tools
Apache License 2.0
1.57k stars 479 forks source link

building plutus fails on NixOS 18.09 #328

Closed bernadinm closed 6 years ago

bernadinm commented 6 years ago

When attempting to build the Plutus core on NixOS 18.09, I've experienced this error.

Is plutus ready for building at this time?

Error

$ nix build -f default.nix localPackages.language-plutus-core
[1/0/103 built, 0.0 MiB DL] building ghc-8.4.3 (buildPhase): "/build/ghc-8.4.3/inplace/bin/haddock" --verbosity=0 --odir="libraries/Cabal/Cabal/dist-install/doc/html/Cabal" --no-tmp-comp-dir --dump-interface=libraries/Cabal/Cabal/dist-install/doc/html/Cabal/Cabal.haddock builder for '/nix/store/h9ydgbajf3lrxkj3lj67mq9hg1g7w7r9-ghc-8.4.3.drv' failed with exit code 2; last 10 log lines:
      vectTopBinder vectTopBind
  Warning: WwLib: could not find link destinations for:
      WwResult
  Warning: DmdAnal: could not find link destinations for:
      useLhaddock: internal error: Unable to commit 1048576 bytes of memory
      (GHC version 8.4.3 for x86_64_unknown_linux)
      Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
  make[1]: *** [compiler/ghc.mk:448: compiler/stage2/doc/html/ghc/ghc.haddock] Aborted
  make[1]: *** Deleting file 'compiler/stage2/doc/html/ghc/ghc.haddock'
  make: *** [Makefile:127: all] Error 2
cannot build derivation '/nix/store/rn9w6rf9l8ya9kc3si2g8wy8wmqapsf3-language-plutus-core-0.1.0.0.drv': 1 dependencies couldn't be built
[0 built (1 failed), 0.0 MiB DL]
error: build of '/nix/store/rn9w6rf9l8ya9kc3si2g8wy8wmqapsf3-language-plutus-core-0.1.0.0.drv' failed

NixOS Machine Info

This is a Virtualbox virtual machine as well. Sourced from https://nixos.org/nixos/download.html

$ nix-shell -p nix-info --run "nix-info -m"
warning: ignoring untrusted substituter 'https://hydra.iohk.io'
these paths will be fetched (20.04 MiB download, 217.86 MiB unpacked):
  /nix/store/6yz7851vibc1xjxpiyfzqqi2ksbv6qah-binutils-wrapper-2.30
  /nix/store/h0lbngpv6ln56hjj59i6l77vxq25flbz-binutils-2.30
  /nix/store/i6vl5lwlz5jbkg4r6p340dwmj6fha3xq-stdenv-linux
  /nix/store/iw94llkj05wgaz268mlzvgx8jkbi1ss0-gcc-wrapper-7.3.0
  /nix/store/kic17fw8wil74k04kzh3dha43izrr9j3-bash-interactive-4.4-p23-dev
  /nix/store/ynb9h0q59ykdpmsn5m2qrkmnq1p683wr-expand-response-params
copying path '/nix/store/kic17fw8wil74k04kzh3dha43izrr9j3-bash-interactive-4.4-p23-dev' from 'https://cache.nixos.org'...
copying path '/nix/store/h0lbngpv6ln56hjj59i6l77vxq25flbz-binutils-2.30' from 'https://cache.nixos.org'...
copying path '/nix/store/ynb9h0q59ykdpmsn5m2qrkmnq1p683wr-expand-response-params' from 'https://cache.nixos.org'...
copying path '/nix/store/6yz7851vibc1xjxpiyfzqqi2ksbv6qah-binutils-wrapper-2.30' from 'https://cache.nixos.org'...
copying path '/nix/store/iw94llkj05wgaz268mlzvgx8jkbi1ss0-gcc-wrapper-7.3.0' from 'https://cache.nixos.org'...
copying path '/nix/store/i6vl5lwlz5jbkg4r6p340dwmj6fha3xq-stdenv-linux' from 'https://cache.nixos.org'...
 - system: `"x86_64-linux"`
 - host os: `Linux 4.14.79, NixOS, 18.09.1228.a4c4cbb613c (Jellyfish)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.1.3`
 - channels(root): `"nixos-18.09.1228.a4c4cbb613c"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
bernadinm commented 6 years ago

When adding my local user to the trusted list, I've managed to skill the manual building step and leverage the IOHK cache instead and the build completed.

I'll leave this ticket open if the local build method needs to be addressed for others as well.

This is no longer an issue for me for the time being.

michaelpj commented 6 years ago

It looks like your machine is trying to build GHC but doesn't have enough memory. I would recommend not trying to build GHC, and instead doing as you're doing and using the binary cache.

I'm pretty sure there is nothing wrong with the build configuration, it builds on hydra nixos machines on every commit.