Unable to build on NixOS

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Unable to build on NixOS

Sean Gillespie
Howdy,

I am unable to build the latest revision of GHC on NixOS. I can build older revisions.
Here's my error:

    ===--- building final phase
    make --no-print-directory -f ghc.mk phase=final all
    "inplace/bin/ghc-stage1" -hisuf p_hi -osuf  p_o -hcsuf p_hc -static -prof -eventlog  -H32m -O -Wall      -this-unit-id ghc-heap-8.5 -hide-all-packages -i -ilibraries/ghc-heap/. -ilibraries/gh
    c-heap/dist-install/build -Ilibraries/ghc-heap/dist-install/build -ilibraries/ghc-heap/dist-install/build/./autogen -Ilibraries/ghc-heap/dist-install/build/./autogen -Ilibraries/ghc-heap/.
     -optP-include -optPlibraries/ghc-heap/dist-install/build/./autogen/cabal_macros.h -package-id base-4.12.0.0 -package-id ghc-prim-0.5.3 -package-id rts -Wall -XHaskell2010 -O2  -no-user-packa
    ge-db -rtsopts  -Wno-deprecated-flags     -Wnoncanonical-monad-instances  -odir libraries/ghc-heap/dist-install/build -hidir libraries/ghc-heap/dist-install/build -stubdir libraries/ghc-heap/
    dist-install/build  -split-sections  -c libraries/ghc-heap/./GHC/Exts/Heap/Closures.hs -o libraries/ghc-heap/dist-install/build/GHC/Exts/Heap/Closures.p_o -dyno libraries/ghc-heap/dist-instal
    l/build/GHC/Exts/Heap/Closures.dyn_o

    libraries/ghc-heap/GHC/Exts/Heap/Closures.hs:23:1: error:
        Could not find module `GHC.Exts.Heap.InfoTableProf'
        It is a member of the hidden package `ghc-heap-8.5'.
        You can run `:set -package ghc-heap' to expose it.
        (Note: this unloads all the modules in the current scope.)
        Use -v to see a list of the files searched for.
       |
    23 | import GHC.Exts.Heap.InfoTableProf
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    make[1]: *** [libraries/ghc-heap/ghc.mk:4: libraries/ghc-heap/dist-install/build/GHC/Exts/Heap/Closures.p_o] Error 1
    make: *** [Makefile:127: all] Error 2

For reference, here's my shell.nix:

    { nixpkgs ? import <nixpkgs> {}, compiler ? "ghcHEAD" }:

    let
      inherit (nixpkgs) pkgs;
      ghc = pkgs.haskell.packages.${compiler}.ghc;
    in
      with nixpkgs; lib.overrideDerivation ghc
      (drv: {
        name = "ghc-dev";
        nativeBuildInputs = drv.nativeBuildInputs ++ [
          arcanist
          git
          python36Packages.sphinx
          texlive.combined.scheme-basic
        ];
      })

Any help would be appreciated.

Thanks
Sean G
_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Reply | Threaded
Open this post in threaded view
|

Re: Unable to build on NixOS

Patrick Dougherty
Huh,

So this is a bug I thought I dealt with :/
In the short term, I've found that often simply trying the build again can fix it. This is a dependency issue that I don't 100% understand.

For some more technical background, the "InfoTableProf" module is only built/needed when it is used with PROFILING. It uses CPP to "peek" into the StgInfoTable, which changes under profiling.

My impression is that dependency resolution decides that module isn't necessary, so then it is missing when it goes to use it. Again, I am not sure here, that's just what seemed to be the issue.

Best,
Patrick Dougherty
On May 26, 2018, 8:39 PM -0500, Sean D Gillespie <[hidden email]>, wrote:
Howdy,

I am unable to build the latest revision of GHC on NixOS. I can build older revisions.
Here's my error:

===--- building final phase
make --no-print-directory -f ghc.mk phase=final all
"inplace/bin/ghc-stage1" -hisuf p_hi -osuf p_o -hcsuf p_hc -static -prof -eventlog -H32m -O -Wall -this-unit-id ghc-heap-8.5 -hide-all-packages -i -ilibraries/ghc-heap/. -ilibraries/gh
c-heap/dist-install/build -Ilibraries/ghc-heap/dist-install/build -ilibraries/ghc-heap/dist-install/build/./autogen -Ilibraries/ghc-heap/dist-install/build/./autogen -Ilibraries/ghc-heap/.
-optP-include -optPlibraries/ghc-heap/dist-install/build/./autogen/cabal_macros.h -package-id base-4.12.0.0 -package-id ghc-prim-0.5.3 -package-id rts -Wall -XHaskell2010 -O2 -no-user-packa
ge-db -rtsopts -Wno-deprecated-flags -Wnoncanonical-monad-instances -odir libraries/ghc-heap/dist-install/build -hidir libraries/ghc-heap/dist-install/build -stubdir libraries/ghc-heap/
dist-install/build -split-sections -c libraries/ghc-heap/./GHC/Exts/Heap/Closures.hs -o libraries/ghc-heap/dist-install/build/GHC/Exts/Heap/Closures.p_o -dyno libraries/ghc-heap/dist-instal
l/build/GHC/Exts/Heap/Closures.dyn_o

libraries/ghc-heap/GHC/Exts/Heap/Closures.hs:23:1: error:
Could not find module `GHC.Exts.Heap.InfoTableProf'
It is a member of the hidden package `ghc-heap-8.5'.
You can run `:set -package ghc-heap' to expose it.
(Note: this unloads all the modules in the current scope.)
Use -v to see a list of the files searched for.
|
23 | import GHC.Exts.Heap.InfoTableProf
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
make[1]: *** [libraries/ghc-heap/ghc.mk:4: libraries/ghc-heap/dist-install/build/GHC/Exts/Heap/Closures.p_o] Error 1
make: *** [Makefile:127: all] Error 2

For reference, here's my shell.nix:

{ nixpkgs ? import <nixpkgs> {}, compiler ? "ghcHEAD" }:

let
inherit (nixpkgs) pkgs;
ghc = pkgs.haskell.packages.${compiler}.ghc;
in
with nixpkgs; lib.overrideDerivation ghc
(drv: {
name = "ghc-dev";
nativeBuildInputs = drv.nativeBuildInputs ++ [
arcanist
git
python36Packages.sphinx
texlive.combined.scheme-basic
];
})

Any help would be appreciated.

Thanks
Sean G
_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Reply | Threaded
Open this post in threaded view
|

Re: Unable to build on NixOS

Sean Gillespie
> For some more technical background, the "InfoTableProf" module is only built/needed
> when it is used with PROFILING. It uses CPP to "peek" into the StgInfoTable,
> which changes under profiling.

I think my issue was that nixpkgs.ghcHEAD configurePhase was overwriting my build.mk. That
might explain why profiling was enabled.

_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Reply | Threaded
Open this post in threaded view
|

Re: Unable to build on NixOS

Ben Gamari-3
In reply to this post by Patrick Dougherty
Patrick Dougherty <[hidden email]> writes:

> Huh,
>
> So this is a bug I thought I dealt with :/
> In the short term, I've found that often simply trying the build again
> can fix it. This is a dependency issue that I don't 100% understand.
>
I also encountered this (although it's rather unlikely to occur with
high build parallelism, which is how it snuck through validation).

Anyways, I filed #15197 and pushed D4753 as a possible workaround. I
believe the root cause is a bug in `ghc -M`'s treatment of ways.

Cheers,

- Ben

[1] https://phabricator.haskell.org/D4753


_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

signature.asc (497 bytes) Download Attachment