Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stack invokes the wrong Hadrian build script when building GHC from source #5528

Closed
fwcd opened this issue Apr 26, 2021 · 1 comment · Fixed by #5529
Closed

Stack invokes the wrong Hadrian build script when building GHC from source #5528

fwcd opened this issue Apr 26, 2021 · 1 comment · Fixed by #5529

Comments

@fwcd
Copy link
Contributor

fwcd commented Apr 26, 2021

General summary

Building a recent version of GHC from source by specifying compiler: ghc-git-COMMIT-FLAVOUR in a stack.yaml (as described here) fails with the following error:

Building GHC from source with `quick` flavour. It can take a long time (more than one hour)...
Did not find executable at specified path: /tmp/with-repo468829/cloned/hadrian/build.stack.sh

Steps to reproduce

For example:

  1. Create stack.yaml with
compiler: ghc-git-7bc7eea3897dcb8a87fdb0921f451b9bc77309f6-quickest

(This is the newest GHC commit at the time of writing)

  1. Run stack build

Expected

The script hadrian/build-stack should be invoked.

Actual

The script hadrian/build.stack.sh was invoked (apparently the script has been renamed).

Stack version

$ stack --version
Version 2.5.1, Git revision d6ab861544918185236cf826cb2028abb266d6d5 x86_64 hpack-0.33.0

Method of installation

Official binary

@hsyl20
Copy link
Contributor

hsyl20 commented Jul 20, 2021

Thanks for fixing this! A related issue to fix:

In Stack.Setup, there is still:

           hadrianArgs = fmap T.unpack
               [ "-c"                    -- run ./boot and ./configure
               , "-j" <> tshow threads   -- parallel build
               , "--flavour=" <> flavour -- selected flavour
               , "binary-dist"
               ]

but -c is broken again (cf https://gitlab.haskell.org/ghc/ghc/-/issues/19804) and probably won't be fixed... Instead of using it, we should call the following commands before invoking hadrian:

stack --stack-yaml hadrian/stack.yaml exec -- ./boot
stack --stack-yaml hadrian/stack.yaml exec -- ./configure

@fwcd If you had the bandwidth to offer a patch for this, it would be great :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants