actions
actions copied to clipboard
Early GHC versions, problems
Using haskell/actions/[email protected]
, I have had the following problems with early GHC versions, on ubuntu-latest
or windows-latest
, as follows:
1: ubuntu-latest
7.0.4, 7.2.2 and 7.4.2 work, but 7.6.3 and 7.8.4 do not, with the following logging (7.8.4, as an example):
Attempting to install ghc 7.8.4 using apt-get
/usr/bin/sudo -- sh -c apt-get -y install ghc-7.8.4
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package ghc-7.8.4
E: Couldn't find any package by glob 'ghc-7.8.4'
E: Couldn't find any package by regex 'ghc-7.8.4'
Attempting to install ghc 7.8.4 using ghcup
/opt/hostedtoolcache/ghcup/0.1.12/x64/ghcup install ghc 7.8.4
[ Warn ] New GHCup version available: 0.1.14. To upgrade, run 'ghcup upgrade'
[ Error ] No available GHC version for 7.8.4
Error: All install methods for ghc 7.8.4 failed
2: windows-latest
7.0.4, 7.2.2 and 7.4.2 do not work, in that choco
installs GHC but that does not seem to be detected. The output is as follows (7.4.2, as an example):
Attempting to install ghc 7.4.2 using chocolatey
::stop-commands::SetupHaskellStopCommands
C:\windows\System32\WindowsPowerShell\v1.0\powershell.exe choco install ghc --version 7.4.2 -m --no-progress -r
Installing the following packages:
ghc
By installing you accept licenses for the packages.
ghc v7.4.2 [Approved]
ghc package files install completed. Performing other installation steps.
Downloading ghc
from 'https://www.haskell.org/ghc/dist/7.4.2/ghc-7.4.2-i386-windows.exe'
Download of ghc-7.4.2-i386-windows.exe (86.44 MB) completed.
Installing ghc...
ghc has been installed.
ghc can be automatically uninstalled.
Environment Vars (like PATH) have changed. Close/reopen your shell to
see the changes (or in powershell/cmd.exe just type `refreshenv`).
The install of ghc was successful.
Software installed to 'C:\ghc\ghc-7.4.2\'
Chocolatey installed 1/1 packages.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
::SetupHaskellStopCommands::
Error: All install methods for ghc 7.4.2 failed
3: windows-latest
, GHC 7.10.3 (choco version: GHC 7.10.3.2)
I could not get "7.10.3" to work, but "7.10.3.2" does work. I noted that https://github.com/haskell/actions/blob/main/setup/src/release-revisions.json does not include:
{"from": "7.10.3", "to": "7.10.3.2"}
and wonder if it should do?
In respect of my Item 2 above, I note function getChocoPath
has:
// choco packages GHC < 9.x
if (!fs.existsSync(chocoToolPath)) {
chocoToolPath = join(
`${process.env.ChocolateyInstall}`,
'lib',
`${tool}.${version}`
);
}
For example: Software installed to 'C:\ProgramData\chocolatey\lib\ghc.7.6.3.1\tools'
.
However, that does not appear to be true for choco packages for GHC < 7.6. For example: Software installed to 'C:\ghc\ghc-7.4.2\'
.
Perhaps something like the following is also required:
// choco packages GHC < 7.6
if (!fs.existsSync(chocoToolPath)) {
chocoToolPath = join(
`${process.env.SystemDrive}`,
'ghc',
`${tool}-${version}`
);
}
{"from": "7.10.3", "to": "7.10.3.2"}
should definitely be there. I must've missed it when I went over the chocolatey versions list the last time.
I'll have to add in that workaround for the chocolatey path... I had been assuming the older versions of GHC were fetched by a current script (and thus their paths would be the same format) but clearly some of those assumptions were not valid :) I'll fix that too. Thanks!
To address the availability of old versions of GHC on linux and macOS, ghcup does not have versions of GHC earlier than 7.10.3 available. For ubuntu, hvr's ppa does go down to GHC 7.0.1, however it seems that ubuntu-20.04 is missing a significant number of versions of GHC vs ubuntu-18.04. I'm not quite sure why, but it appears that ghc 7.6.x and 7.8.x are missing entirely.
In short, anything below 7.10.3 is going to start leaking quite a few underlying implementation details of the underlying package managers, which is one of the reasons why I don't specify anything below 7.10.3 as "supported" (but of course, nothing prevents you from using them if they manage to work for you)
This conversation was helpful, as it explained how to fix the GHC 7.10 Windows issue!
OP 3 is fixed by:
- #147
OP 1 is beyond this action, it is the lack of ubuntu > 18.04 bindists. OP 2 concerns GHC version that are not officially supported, and it seems there is no manpower here to fix them.