snowleopard / hadrian

Hadrian: a new build system for the Glasgow Haskell Compiler. Now merged into the GHC tree!
https://gitlab.haskell.org/ghc/ghc/tree/master/hadrian
MIT License
208 stars 39 forks source link

Failure to build with ACLOCAL_PATH #515

Closed ndmitchell closed 6 years ago

ndmitchell commented 6 years ago

On Windows, using approximately the instructions from http://neilmitchell.blogspot.co.uk/2016/03/compiling-ghc-on-windows.html, I just got:

C:\Neil\ghc\feb2018\ghc>stack exec -- hadrian\build.bat -j --configure
| Checking for Windows tarballs...
| Running boot...
Traceback (most recent call last):
  File "boot", line 196, in <module>
    autoreconf()
  File "boot", line 154, in autoreconf
    ac_local = os.environ['ACLOCAL_PATH']
  File "C:/Users/ndmit_000/AppData/Local/Programs/stack/x86_64-windows/msys2-20150512/mingw64/lib/python3.6\os.py", line 669, in __getitem__
    raise KeyError(key) from None
KeyError: 'ACLOCAL_PATH'

I am not sure what Hadrian version I am using (I just did a git clone from the root of GHC), so instructions to refresh Hadrian are welcome.

snowleopard commented 6 years ago

I'm not sure this is related, but some time ago I dropped a hack for ACLOCAL_PATH, see: https://github.com/snowleopard/hadrian/commit/830567e388a89b90a80c0140379c983de3cec8aa.

@ndmitchell Can you retry with this hack returned? If it works, we can just revert the above commit.

snowleopard commented 6 years ago

It looks like this may actually require some extra work, see https://github.com/snowleopard/hadrian/issues/314#issuecomment-334129053.

ndmitchell commented 6 years ago

set ACLOCAL_PATH=. beforehand seems to have fixed it. Should boot on line 154 perhaps be conditionally getting aclocal if the environment variable is set, and not blowing up otherwise?

snowleopard commented 6 years ago

@ndmitchell Yep, sounds like the right approach!

@bgamari What do you think about this? We need to make this line in boot more robust:

https://github.com/ghc/ghc/blob/master/boot#L154

ndmitchell commented 6 years ago

I just stumbled across this problem again, and then manually derived the same solution. If a fix isn't going to go upstream (which I think it should @bgamari) then having a local hack in Hadrian will reduce the number of times I have to re-solve this.

ndmitchell commented 6 years ago

Patched in https://github.com/ghc/ghc/pull/164.

ndmitchell commented 6 years ago

Fixed upstream!

snowleopard commented 6 years ago

:tada: Thanks Neil!