Closed sgraf812 closed 6 years ago
@sgraf812 Thank you! I don't use nix
, so I cannot properly review this PR.
@angerman @mpickering Perhaps, you could have a look?
By the way, is there a CI service for nix? If yes, we could add it to our CI suite.
I don't understand the nativeBuildInputs
change. The rest I also have locally (woops).
There is also a problem with the script currently that it overrides mk/build.mk
. You have to run configurePhase to set the right flags and then copy mk/build.mk and append DYNAMIC_GHC_PROGRAMS=YES
.
Re: nativeBuildInputs
change. If I change it back to buildInputs
, I get this error:
$ config_args=$configureFlags ./validate
...
----------------------------------------------------------------------
Configure completed successfully.
...
Tools to build Sphinx HTML documentation available: NO
Tools to build Sphinx PDF documentation available: NO
...
===--- building phase 0
make --no-print-directory -f ghc.mk phase=0 phase_0_builds
ghc.mk:175: *** BUILD_SPHINX_HTML=YES, but `sphinx-build` was not found. Create a file `mk/validate.mk` containing `BUILD_SPHINX_HTML=NO` (when validating), or install `sphinx-build` and rerun `./configure`. See https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation. Stop.
make: *** [Makefile:123: all] Error 2
This error doesn't happen for nativeBuildInputs
, which is how the other build dependencies in ghcHEAD
s derivation seems to be specified.
OK -- seems sensible. I say merge this if it works for you.
Thanks @mpickering!
@sgraf812 Shall I merge, or would you like to make any further tweaks?
Although it doesn't quite build hadrian yet, I think it's a strict improvement, so we can merge this.
If my nix foo was stronger, I could probably rig some overlay together that fetches all-cabal-hashes
and depends on a version of shake
that works with directory
, but the grass is always greener.
@sgraf812 Done. Thank you!
@sgraf812 What do you think about pinning the version of nixpkgs in the shell.nix
file?
That would definitely help. Or rather make builds reproducible.
But the shake
breakage I was referring to was due to a name clash with directory
process-1.6.3.0
that was fixed only recently. We can't just depend on shake-0.16.2
, which is a release that includes the fix, because of the slow tracking of all-cabal-hashes
in nixpkgs
. I guess a combination of fixing the nixpkgs
release + fixing all-cabal-hashes
+ fixing all dependencies on hackage would help.
Note that I have a few variations on the shell.nix, including one with which I can build and use hadrian. I do have to clean all of this up before I make a PR though. One of these days, if someone doesn't beat me to it, I'll take care of writing a nix expression that supports a bunch of options (llvm packages or not, using hadrian or make, docs dependencies or not, etc), I've just been busy with more important things lately. Thanks in the meantime for this @sgraf812!
ghc821
isn't available anymore, usingghc822
insteadghcHEAD
package are now specified asnativeBuildInputs
rather thanbuildInputs
./validate
needs sphinx to be installedI use this setup (minus the
hadrianPackages.hadrian
line) for building GHC. Using hadrian for the build doesn't work, asnix
fails to installshake-0.16
which seems to miss this fix. I'm not too familiar with nix, but I had to manually update the cabal-hashes tarball which breaks every time Inix-channel --update
. Last time I tried, it probably broke somewhere else, so I'm just using this file as a base for building GHC HEAD withmake
.