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

Fix unlit by placing it under lib/bin/ instead of bin/ #591

Closed alpmestan closed 6 years ago

alpmestan commented 6 years ago

A nicer fix would involve patching GHC to not just look under $libexec/ but also under the directory where the GHC binary itself lives (bin/ for hadrian), so that we can leave all binaries under bin/.

Addresses Trac #15132.

Without this patch, this used to fail:

$ echo '> main = putStrLn "hello"' > foo.lhs 
$ _build/stage1/bin/ghc foo.lhs

with an error saying that ghc could not find unlit at _build/stage1/lib/bin/unlit, where it expects it. With this patch, GHC successfully compiles that file.

snowleopard commented 6 years ago

@alpmestan Thanks, happy to merge this, see a minor comment above. I've restarted the CI since Travis failed in a mysterious way.

alpmestan commented 6 years ago

Two of the travis jobs still failed in an odd way (with an !, not a X). The others are green. Do you perhaps want to restart the two failing ones one last time?

snowleopard commented 6 years ago

@alpmestan Merged, many thanks!

snowleopard commented 6 years ago

@alpmestan I've noticed that both Make build system and Hadrian build unlit twice -- do you know if this is necessary? Can we build it just once, say in Stage0?

alpmestan commented 6 years ago

@snowleopard It's a C program, so I don't think there is a lot to be gained by building unlit twice, indeed.

snowleopard commented 6 years ago

@alpmestan Thanks, I've added an issue: #595.