New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
haskell-generic-builder: Add option to disable library-for-ghci #58743
haskell-generic-builder: Add option to disable library-for-ghci #58743
Conversation
Even on Linux/NixOS, it can be useful to have a compiler without the large address space as it creates issues in some contexts.
This update was generated by hackage2nix v2.14.2-4-gd25a3c5 from Hackage revision commercialhaskell/all-cabal-hashes@47088e8.
…Space ghc: make disableLargeAddressSpace configurable
This update was generated by hackage2nix v2.14.2-4-gd25a3c5 from Hackage revision commercialhaskell/all-cabal-hashes@17a371c.
This update was generated by hackage2nix v2.14.2-4-gd25a3c5 from Hackage revision commercialhaskell/all-cabal-hashes@1d1f033.
This update was generated by hackage2nix v2.14.2-4-gd25a3c5 from Hackage revision commercialhaskell/all-cabal-hashes@ac4eded.
This update was generated by hackage2nix v2.14.2-4-gd25a3c5 from Hackage revision commercialhaskell/all-cabal-hashes@5fa6445.
I'd like to give a little bit more of the information I've found out about this when digging into it. GHCThe GHC documentation says the following about
CabalThe cabal documentation seems to say that However, the actual logic in cabal for deciding whether to pass this flag or not seems somewhat complicated. I haven't done a deep dive into the cabal codebase, but from playing around with StackAs far as I can tell, |
If anyone wants to try to reproduce this, you can do so with the Termonad repository. You can run the following commands: $ git clone git@github.com:cdepillabout/termonad.git
$ cd termonad
$ git checkout show-problem-with-doctest
$ nix-build Running the doctests for the |
Have you actually tested whether compiling with |
2afaeb9
to
1da98bb
Compare
@peti, thanks for the quick response.
Sorry, I should have made this clear. I have tested locally that compiling with Hmm, it looks like something strange happened with the history of this PR when you force-pushed the |
Merged in 780f8057991cf5bd1e701632c4e5c0d2090700c3. It will go to Now, the next step is to decide whether to disable this feature by default. ❓ |
This commit disables the library-for-ghci flag passed to `Setup configure` in the Haskell generic-builder.nix file. This stops the HSfoo.o file from being built. Building this HSfoo.o file caused doctest to take an extremely long time to load dependencies when running. This is a follow-up from #58743.
This commit disables the library-for-ghci flag passed to `Setup configure` in the Haskell generic-builder.nix file. This stops the HSfoo.o file from being built. Building this HSfoo.o file caused doctest to take an extremely long time to load dependencies when running. This is a follow-up from #58743.
This commit disables the library-for-ghci flag passed to `Setup configure` in the Haskell generic-builder.nix file. This stops the HSfoo.o file from being built. Building this HSfoo.o file caused doctest to take an extremely long time to load dependencies when running. This is a follow-up from #58743.
This commit disables the library-for-ghci flag passed to `Setup configure` in the Haskell generic-builder.nix file. This stops the HSfoo.o file from being built. Building this HSfoo.o file caused doctest to take an extremely long time to load dependencies when running. This is a follow-up from #58743. (cherry picked from commit 0698b54)
This commit disables the library-for-ghci flag passed to `Setup configure` in the Haskell generic-builder.nix file. This stops the HSfoo.o file from being built. Building this HSfoo.o file caused doctest to take an extremely long time to load dependencies when running. This is a follow-up from NixOS#58743.
Motivation for this change
This PR adds an option to the Haskell generic-builder that can be used to disable the
library-for-ghci
option passed toSetup configure
.By default, the Haskell generic-buider enables
library-for-ghci
. This causesSetup build
to build an additionalHSfoo*.o
file.It looks like this
--enable-library-for-ghci
flag was added in d7beae3, but there doesn't seem to be any explanation of why it was added.I'm seeing a problem when trying to use
doctest
to test a Haskell package:cdepillabout/termonad#15
doctest
uses the GHCi API to load each module in your package into GHCi, and then run tests written in your Haddocks. I'm seeing a problem usingdoctest
to load files that requireTemplateHaskell
.It looks like what happens is that in order for GHCi to typecheck and load the modules in a given package, it needs to byte-compile the TemplateHaskell splices. In order to do this, it needs to load all the required dependency packages. For some reason, when libraries have been compiled with
--enable-library-for-ghci
, this takes an extremely long time. The Termonad example from above takes about 3 hours to rundoctest
, even though running it throughstack
orcabal
just takes a few seconds.I'm not sure why it takes so long to load libraries when using
--enable-library-for-ghci
, but I have confirmed that using--disable-library-for-ghci
only takes a few seconds.We're seeing this at work with our own Haskell packages, so we'd really like an easy way to work around this. I'd also like to backport this change to 19.03, since that is what we're using at work.
This PR adds an option to disable
library-for-ghci
for the Haskell generic-builder.Pinging @peti.
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)