Missing ghc-9.0.1.exe executable in bindist
Summary
The GHC bindist for Windows for 9.0.1 includes a ghc.exe file, but not a ghc-9.0.1.exe file. Previous versions of GHC included both. This change confuses Stack's executable detection mechanism in some cases, specifically when a different ghc-9.0.1.exe is on the PATH, as occurs for example with GitHub Actions.
Steps to reproduce
Unpacking the GHC bindist will demonstrate the lack of file. To demonstrate the bug triggered in Stack:
- Place a dummy file
ghc-9.0.1.exesomewhere on thePATH - Run
stack setup ghc-9.0.1(tested using Stack 2.7.1) - Installation will fail with an error such as:
Found an invalid compiler at "C:\\Users\\snoyb\\.cargo\\bin\\ghc-9.0.1.EXE": UnliftIO.Exception.throwString called with:
Could not find any of: ["C:\\Users\\snoyb\\.cargo\\bin\\ghc-pkg-9.0.1.EXE","C:\\Users\\snoyb\\.cargo\\bin\\ghc-pkg.exe"]
Expected behavior
It would be ideal to continue including the ghc-9.0.1.exe executables. In the meantime, however, I intend to modify Stack's installer logic to deal with both cases.
Environment
- GHC version used: 9.0.1
Optional:
- Operating System: Windows
- System Architecture: x86_64