-
Notifications
You must be signed in to change notification settings - Fork 846
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
Custom GHC build #4567
Comments
Hi @hsyl20, thanks for the suggestion.
I'd like to know the pros and cons of each of the options — they aren't obvious to me. Would you be interesting in contributing and maintaining a solution? |
One thing to keep in mind is that building GHC from source requires a lot extra stuff installed on the developer's machine, so it wouldn't work "out of the box". We've considered supporting building GHC from source in the past, but decided against it for this reason. |
Solution 1:
Solution 2:
I have been trying to implement the feature, the code is in this branch: https://github.com/hsyl20/stack/tree/hsyl20-compiler-build The test is running but GHC takes ages to build on my station so I'll get the result tomorrow. @borsboom |
Some progress report: with my branch we can now use the following config:
Any help appreciated on this last one. |
Stack bug. See #4573. |
Whoops, accidentally ticked one of the boxes — undone it now. The rest of your results looks pretty impressive.
This is surely a difficulty for you, though. Will your users not mind having to recompile GHC? |
Nice! I'm glad I have reported it here before investing time into fixing it
It would be a temporary measure until the changes are integrated into a released GHC (if ever). I try to get them merged but it takes quite some time (e.g. I'm trying to get this MR merged for a month now). |
It almost works but I encounter a new issue similar to what is presented here: https://www.snoyman.com/blog/2019/01/mismatched-global-packages The GHC HEAD bindist we build is bundled with Cabal-2.5.0.0 which isn't released on Hackage... Stack reports:
However, Cabal-2.4.1.0 (the latest Cabal release on Hackage) can't be built against GHC HEAD. If I add "Cabal-2.5.0.0" as an extra-dep, it can't be found on Hackage (obviously). Is there a way to make Stack try to use packages bundled with GHC? Otherwise, a workaround could be to add extra-deps like this:
It also works if we try to add a dependency on the actual submodule repo/commit:
|
@hsyl20 sorry for getting into the middle of this conversation but what package do you compile so you get a warning about some package wanting version 2.4.1.0 of Cabal? I guess you could try bumping that dependency bound |
@qrilka It seems to be from a build dependency of
I'm not sure it related to my patches as it is reproducible without using the new feature (edit: confirmed that it fails with Stack head too): > stack new test
> cd test
> stack install cabal-doctest -v
... Ignoring package Cabal due to wanting version 2.4.1.0 instead of 2.4.0.1
... [Tries to build Cabal 2.4.1.0] Or: > stack unpack cabal-doctest
> cd cabal-doctest-1.0.6
> stack init
> stack build -v
... Ignoring package Cabal due to wanting version 2.4.1.0 instead of 2.4.0.1 |
Actually I think I have confused myself here (and maybe you too?) - #4488 talks about using |
Eek, Cabal is complicated. See #4494 for further info. |
I can't specify |
Sorry @hsyl20 for talking only about |
According to #4494 (see here), Custom setups are built with Cabal from the snapshot (or overloaded with extra-deps), not with Cabal shipped with GHC. That seems to explain what's happening when I try to build It might be worth adding a way to specify an extra-dep to a boot package:
So that Cabal shipped with GHC is used instead of the snapshot one even for Custom builds. |
Oh, custom setups, sorry, completely forgot about those |
Issue #4637 also asks for the ability to build GHC from source. I'm leaning towards wishlisting both of these issues until someone steps up to contribute code to make this happen. |
…k-yaml Add drop-packages to stack.yaml #4567
Implemented in #4655, closing. Thank you for the contribution! |
I have some code that depends on a custom patched GHC. Currently my options to allow other people to build this code are:
Both options are not satisfying.
What I would like instead is to be able to specify in stack configuration:
This would:
The text was updated successfully, but these errors were encountered: