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

Windows: ghc-install.sh does not output absolute path to a GHC binary #913

Closed
mpilgrem opened this issue Nov 5, 2023 · 1 comment
Closed

Comments

@mpilgrem
Copy link
Contributor

mpilgrem commented Nov 5, 2023

Stack's GHC installation customisation requries that the script output the absolute path to the GHC binary. On Windows, an executable will have file extension .exe. However, ghc-install.sh has this:

printf "%s/ghc" "${ghcdir}"

On Windows, I think that should be:

printf "%s/ghc.exe" "${ghcdir}"

I think this causes Stack to report warnings like this one, because Stack checks that the compiler executable file exists:

Warning: Unable to save CompilerPaths cache:

         CreateFile "D:\\ghcup\\ghc\\9.0.2\\bin\\ghc": does not exist (The system cannot find the file specified.)

See: commercialhaskell/stack#6330

@mpilgrem
Copy link
Contributor Author

mpilgrem commented Nov 5, 2023

So, perhaps:

if [ -n "$WINDIR" ]; then
    # Running on Windows
    printf "%s/ghc.exe" "${ghcdir}"
else
    # Not running on Windows
    printf "%s/ghc" "${ghcdir}"
fi

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

No branches or pull requests

2 participants