[windows] Do not install latest version of GHC (#6581)

This commit is contained in:
Alexey-Ayupov
2022-11-16 20:42:51 +01:00
committed by GitHub
parent 279e529dab
commit b101b5646f

View File

@@ -13,13 +13,20 @@ $VersionsList = $LatestMajorMinor | ForEach-Object { $_.Group | Select-Object -F
# The latest version will be installed as a default # The latest version will be installed as a default
ForEach ($version in $VersionsList) ForEach ($version in $VersionsList)
{ {
# 9.4.3 has failed choco builds, replace with 9.4.2 for the time being
# 9.2.5 has failed choco builds, replace with 9.2.4 for the time being
if ($version -eq "9.4.3"){ [version]$version = "9.4.2" }
if ($version -eq "9.2.5"){ [version]$version = "9.2.4" }
Write-Host "Installing ghc $version..." Write-Host "Installing ghc $version..."
Choco-Install -PackageName ghc -ArgumentList '--version', $version, '-m' Choco-Install -PackageName ghc -ArgumentList '--version', $version, '-m'
} }
# Add default version of GHC to path, because choco formula updates path on user level # Add default version of GHC to path, because choco formula updates path on user level
$DefaultGhcVersion = $VersionsList | Select-Object -Last 1 $DefaultGhcVersion = $VersionsList | Select-Object -Last 1
$DefaultGhcShortVersion = ([version]$DefaultGhcVersion).ToString(3) # temporary hardcode -------------
#$DefaultGhcShortVersion = ([version]$DefaultGhcVersion).ToString(3)
$DefaultGhcShortVersion = "9.4.2"
#--------------------------------
$DefaultGhcPath = Join-Path $env:ChocolateyInstall "lib\ghc.$DefaultGhcVersion\tools\ghc-$DefaultGhcShortVersion\bin" $DefaultGhcPath = Join-Path $env:ChocolateyInstall "lib\ghc.$DefaultGhcVersion\tools\ghc-$DefaultGhcShortVersion\bin"
# Starting from version 9 haskell installation directory is $env:ChocolateyToolsLocation instead of $env:ChocolateyInstall\lib # Starting from version 9 haskell installation directory is $env:ChocolateyToolsLocation instead of $env:ChocolateyInstall\lib
if ($DefaultGhcShortVersion -notmatch '^[0-8]\.\d+.*') if ($DefaultGhcShortVersion -notmatch '^[0-8]\.\d+.*')