Introduce a $tooldir variable for nicer toolchain detection on Windows

Authored by alpmestan on Apr 16 2018, 3:45 AM.



This patch affects several files that affect how we detect mingw and perl
on Windows. The initial motivation is:

where, with Hadrian building relocatable (non-inplace) GHCs, the current
detection mechanism falls short by e.g only trying $topdir/../mingw. But
in Hadrian, for reasons given in that issue, we would need to store e.g mingw
under $topdir/../../mingw except for binary distributions, where we want
to follow the existing structure, in which case $topdir/../mingw is correct. So
we need to support both, which is what this patch hopefully implements.

Test Plan


Diff Detail

rGHC Glasgow Haskell Compiler
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
alpmestan created this revision.Apr 16 2018, 3:45 AM
alpmestan updated this revision to Diff 16048.Apr 16 2018, 3:46 AM
  • fix typo
Phyx added a comment.Apr 16 2018, 5:07 AM

@alpmestan the build failure seems unrelated. Can you rebase your patch on latest Master and push again?

alpmestan added a comment.EditedApr 16 2018, 6:00 PM

@Phyx HEAD should now be fixed. I rebased and fixed a typo. Let's see what CI says tomorrow :-)

alpmestan updated this revision to Diff 16057.Apr 17 2018, 4:01 AM
  • address bug caused by the patch
alpmestan updated this revision to Diff 16058.Apr 17 2018, 4:35 AM
  • fix silly mistake
alpmestan updated this revision to Diff 16059.Apr 17 2018, 6:20 AM
  • add type signature to avoid warning
alpmestan requested review of this revision.Apr 17 2018, 8:31 AM
Phyx accepted this revision.Apr 17 2018, 8:38 AM

Thanks @alpmestan! , looks good to me.

This revision is now accepted and ready to land.Apr 17 2018, 8:38 AM
This revision was automatically updated to reflect the committed changes.