<div dir="ltr"><div><div>Thanks for the pointer Edward, new-build seems nice. It could build base indeed!<br></div><br>Just a note - with the patch, if I had "tests: True" in cabal.project, I got an assertion for<br> pkgStanzasEnabled `Set.isSubsetOf` pkgStanzasAvailable<br>from Distribution/Client/<wbr>ProjectPlanning.hs. Maybe WAI.<br><br></div><div>Do you think the patch could make it upstream in a form of some flag? --no-require-install=x,y or so.<br><br></div><div>Thank you,<br></div><div>Robin<br></div><br></div><div class="gmail_extra"><br><div class="gmail_quote">2016-12-31 3:28 GMT+01:00 Edward Z. Yang <span dir="ltr"><<a href="mailto:ezyang@mit.edu" target="_blank">ezyang@mit.edu</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Excerpts from Brandon Allbery's message of 2016-12-30 19:45:46 -0500:<br>
<span class="">> On Fri, Dec 30, 2016 at 7:37 PM, Robin Palotai <<a href="mailto:palotai.robin@gmail.com">palotai.robin@gmail.com</a>><br>
> wrote:<br>
> ><br>
> > Do you know a way to force a rebuild of base with stack? I don't want to<br>
> > modify it, just want to feed it through a customized ghc pipeline.<br>
> ><br>
><br>
> base is part of ghc and must be built along with ghc. It cannot be built<br>
> separately from ghc, regardless of tooling, if you want it to actually work.<br>
><br>
> (If you want to see some examples of why it is this way, play around with<br>
> RebindableSyntax a bit, paying attention to the ways in which it breaks if<br>
> you do the wrong thing. You can also get some idea of it from the behavior<br>
> of type roles. In short: ghc must know the precise identity *at machine<br>
> level*, not just source, of various key types in base. It can only do this<br>
> by ghc and base being built together so that various types' machine level<br>
> representations can be wired into ghc as they are built.)<br>
<br>
</span>Although it is true that GHC is closely tied to the particularities<br>
of base, you CAN swap out base, as long as the new version of base has<br>
all of the wired in entities that GHC expects to see. (This must be<br>
the case, because we build stage 1 GHC before we build base.)<br>
<br>
To answer OP's question, I don't know how to do it with Stack but I've<br>
rebuilt base with cabal-install new-build with a little patch. First you have to<br>
modify cabal-install/Distribution/<wbr>Solver/Modular/Solver.hs,<br>
changing the invocation of P.requireInstalled so that "base" isn't<br>
on the list; this lets cabal-install decide that it can rebuild base.<br>
Then, in your cabal.project, add:<br>
<br>
packages: path/to/base<br>
constraints: base +integer-gmp<br>
<br>
(The integer-gmp flag is manual so you need to make sure you toggle<br>
it yourself.) Then cabal new-build will build it, and other packages<br>
will make use of it.<br>
<br>
Good luck!<br>
<span class="HOEnZb"><font color="#888888"><br>
Edward<br>
</font></span></blockquote></div><br></div>