hadrian icon indicating copy to clipboard operation
hadrian copied to clipboard

Allow caching of configure results.

Open AndreasPK opened this issue 6 years ago • 6 comments

Running configure takes a lot of time on windows.

Having a flag to use cached configure data for rebuilds would speed this up nicely.

I can run configure for GHC with -C myself. But adding the flag for the configure process of base is a different story. Ideally libraries would also use the same configure cache as ghc, so it would be faster even on the first build:

Here are the times for base and ghc itself on my machine. (SSD, skylake i7)

name ./configure ./configure -C (rerun) difference
ghc 61 s 18s -43
base 1m 40s 31s -1m 9s

AndreasPK avatar May 21 '18 19:05 AndreasPK

@AndreasPK Good idea! Now that we got rid of ghc-cabal we should have a more fine-grain control over how packages are configured.

Let me tag @angerman @alpmestan @izgzhen -- I think they are more knowledgeable in how this corner of Hadrian could be improved.

snowleopard avatar May 21 '18 19:05 snowleopard

@AndreasPK and I discussed this a little more on IRC. autoconf's caching mechanism handles a lot of the work. Andreas pointed out that we probably just need to run the "toplevel" configure script with -C and then pass --configure-option=-C to all the cabal packages when we're configuring them. This is expected to make a noticeable difference on Windows, but not that much on Linux.

alpmestan avatar May 25 '18 12:05 alpmestan

Configure on macOS feels quite a bit slower than on Linux as well. For crosscompilation the slowness is just comical.

angerman avatar May 26 '18 00:05 angerman

This used to be discussed on #ghc a few years ago, and I’m not sure about the exact details anymore, but I believe there was some fear around stale state. Maybe @bgamari remembers...

angerman avatar May 26 '18 00:05 angerman

I think it would be great to have the option. If it's a good default is indeed a different topic.

This used to be discussed on #ghc a few years ago, and I’m not sure about the exact details anymore, but I believe there was some fear around stale state. Maybe @bgamari remembers..

Personally I don't think this is a major issue if we delete the cache on make clean. There are already lot's of ways to break a working build tree with lingering build artefacts where make clean is required to fix it.

But I'm also perfectly happy if we make this available just as an optional setting.

AndreasPK avatar May 26 '18 09:05 AndreasPK

I'm absolutely in favor of having this! I just wanted to add some history.

angerman avatar May 26 '18 11:05 angerman