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

TMP COMMIT #6829

Closed
wants to merge 1 commit into from
Closed

TMP COMMIT #6829

wants to merge 1 commit into from

Conversation

phadej
Copy link
Collaborator

@phadej phadej commented May 21, 2020

testing CI

@phadej
Copy link
Collaborator Author

phadej commented May 21, 2020

Windows broken as I expected. Opened an issue actions/runner-images#919

@phadej
Copy link
Collaborator Author

phadej commented May 21, 2020

@Mistuke will your chocolatey cabal-installation scripts detect if msys is isntalled in C:\msys64 as it soon will be on github actions? Search for msys2 in https://github.com/actions/virtual-environments/releases/tag/win19%2F20200517.1

if it doesn't, how can I configure cabal to work with that preinstalled msys?

@Mistuke
Copy link
Collaborator

Mistuke commented May 21, 2020

@Mistuke will your chocolatey cabal-installation scripts detect if msys is isntalled in C:\msys64 as it soon will be on github actions? Search for msys2 in https://github.com/actions/virtual-environments/releases/tag/win19%2F20200517.1

if it doesn't, how can I configure cabal to work with that preinstalled msys?

Yeah it will, it will search for it on the PATH and if it doesn't find it searches for it in a few default locations https://github.com/Mistuke/CabalChoco/blob/master/3.2.0.0/cabal/tools/chocolateyInstall.ps1#L133

@phadej
Copy link
Collaborator Author

phadej commented May 21, 2020

@Mistuke and few more questions:

  • if it happens that cabal is installed before that global msys, how to reconfigure cabal ?
  • I assume the chocolatey --allow-multiple should work for both cabal and ghc I suspect. How to change the default?

The Windows setup will have multiple, but due how our tests are setup it's safer to have the GHC in path to be the one we are testing with

@Mistuke
Copy link
Collaborator

Mistuke commented May 21, 2020

@Mistuke and few more questions:

  • if it happens that cabal is installed before that global msys, how to reconfigure cabal ?

choco install cabal -fy --reinstall will re-run the script.

  • I assume the chocolatey --allow-multiple should work for both cabal and ghc I suspect. How to change the default?

I have never tried it with cabal. cabal and ghc install differently. GHC doesn't choco's shims to manage installs which is why it needs a refreshenv. cabal does, but this means an exe is installed into the destination directory as a sort of symlink. So the install itself would probably work but you'd likely need to change the PATH to each version. Unless the chocolatey shims do something smart here, but never tried...

The Windows setup will have multiple, but due how our tests are setup it's safer to have the GHC in path to be the one we are testing with

All the GHC's will be on PATH. but you can pick the one you want by using the fully qualified ghc name, e.g. ghc-8.10.1.exe.

In principle I could write a utility to allow you to switch between them by re-arranging PATH but don't have one atm.

@phadej
Copy link
Collaborator Author

phadej commented May 21, 2020

Yes, the problem is that if I'd use explicit --with-compiler ghc-8.10.1.exe it should be fine, except if for some reason also ghc.exe would be picked up.

In linux CI the image doesn't have ghc in PATH so there I'm sure implicit ghc isn't picked. Not so sure about Windows setup. it should be the same, but you never know for sure.

@Mistuke
Copy link
Collaborator

Mistuke commented May 22, 2020

Yes, the problem is that if I'd use explicit --with-compiler ghc-8.10.1.exe it should be fine, except if for some reason also ghc.exe would be picked up.

The problem is the tools don't have any notions of when they're being installed side by side. So I can't do anything special here. So I guess a PATH utility could work. although if it accidentally picked up another ghc along with the one specified in -w you should get an error as the interface files won't match.

In linux CI the image doesn't have ghc in PATH so there I'm sure implicit ghc isn't picked. Not so sure about Windows setup. it should be the same, but you never know for sure.

How does it not do that? In principle I could add a flag that when passed to chocolatey doesn't set PATH but instead uses chocolatey shims but only allow those on the fully qualified versions. That means you'll never be able to use ghc or ghci directly.

@Mistuke
Copy link
Collaborator

Mistuke commented May 22, 2020

But that said, I wouldn't be able to modify the existing installers.. They're readonly at this point.

@phadej
Copy link
Collaborator Author

phadej commented May 22, 2020

@Mistuke sorry for bothering but I have more questions:

  • There doesn't seem to be --reinstall flag on https://chocolatey.org/docs/commands-install

  • What does choco source add -n mistuke -s https://www.myget.org/F/mistuke/api/v2 does? (The GitHub actions image setup doesn't seem to do it)

  • When I try to reinstall cabal-install it seems to work as it prints

    Chocolatey v0.10.15
    Installing the following packages:
    cabal
    By installing you accept licenses for the packages.
    cabal v3.2.0.0 already installed. Forcing reinstall of version '3.2.0.0'. 
     Please use upgrade if you meant to upgrade to a new version.
    [NuGet] Uninstalling 'cabal 3.2.0.0' might cause 'ghc 8.10.1, ghc 8.6.5, ghc 8.8.3' to be broken.
    [NuGet] Uninstalling 'cabal 3.2.0.0' might cause 'ghc 8.10.1, ghc 8.6.5, ghc 8.8.3' to be broken.
    

    but for ghc it prints just

    Installing the following packages:
    ghc
    By installing you accept licenses for the packages.
    
    Progress: Downloading cabal 3.2.0.0... 4%
    Progress: Downloading cabal 3.2.0.0... 15%
    Progress: Downloading cabal 3.2.0.0... 25%
    Progress: Downloading cabal 3.2.0.0... 35%
    Progress: Downloading cabal 3.2.0.0... 45%
    Progress: Downloading cabal 3.2.0.0... 55%
    Progress: Downloading cabal 3.2.0.0... 65%
    Progress: Downloading cabal 3.2.0.0... 75%
    Progress: Downloading cabal 3.2.0.0... 86%
    Progress: Downloading cabal 3.2.0.0... 96%
    Progress: Downloading cabal 3.2.0.0... 100%
    
    Progress: Downloading ghc 8.6.5... 10%
    Progress: Downloading ghc 8.6.5... 32%
    Progress: Downloading ghc 8.6.5... 53%
    Progress: Downloading ghc 8.6.5... 75%
    Progress: Downloading ghc 8.6.5... 97%
    Progress: Downloading ghc 8.6.5... 100%
    
    Chocolatey installed 0/0 packages. 
     See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
    

    and nothing happens. I also don't seem to get any GHC in Path.

@phadej
Copy link
Collaborator Author

phadej commented May 22, 2020

@Mistuke and do I understand right that installing GHCs side-by-side with -m / --allow-multiple is not supported by your scripts?

I.e. which one ends up in Path is somewhat arbitrary etc?

@phadej
Copy link
Collaborator Author

phadej commented May 22, 2020

How does it not do that? In principle I could add a flag that when passed to chocolatey doesn't set PATH but instead uses chocolatey shims but only allow those on the fully qualified versions.

The hvr-ppa installs GHCs and cabal into directories which are not in the PATH by default. So user have to that manually. Linux users are used to that, it's not a problem.
In haskell-ci generated scripts (which Cabal doesn't use), I don't set up the PATH, but explicitly use --with-compiler=/path/to/correct/ghc to use that one. This way we can ensure that packages themselves dont' call ghc directly, or anything like that. (And in fact some do/did).

Cabal CI is different. The setup here is unfortunately complicated, so getting complete isolation is tricky. There are various issues (like interaction with global package environment files or packages in store) which are unfortunate but not major enough that I'd be motivated to tackle them (i.e. payoff is low).

Now the GitHub actions setup changes stuff.

I wish GitHub actions provided a minimal image. There is more work to correct the setup that we ever will save by saved startup time (which we won't anyway).

@jneira
Copy link
Member

jneira commented May 22, 2020

.. or some way to customize the image, including just the software you need.
Thanks for the info you have collected here, good to know all the incoming haskell related changes of the images used in github actions (and azure ci, which i am using) and its integration with @Mistuke choco installation.

@Mistuke
Copy link
Collaborator

Mistuke commented May 22, 2020

@Mistuke sorry for bothering but I have more questions:

Hmm it used to be there.. perhaps it's now explicit with the -f flag.

  • What does choco source add -n mistuke -s https://www.myget.org/F/mistuke/api/v2 does? (The GitHub actions image setup doesn't seem to do it)

It's only needed if you want access to packages I don't put on the community feed, such as the nightly cabal feed. It's just adding another source for packages.

  • When I try to reinstall cabal-install it seems to work as it prints

    Chocolatey v0.10.15
    Installing the following packages:
    cabal
    By installing you accept licenses for the packages.
    cabal v3.2.0.0 already installed. Forcing reinstall of version '3.2.0.0'. 
     Please use upgrade if you meant to upgrade to a new version.
    [NuGet] Uninstalling 'cabal 3.2.0.0' might cause 'ghc 8.10.1, ghc 8.6.5, ghc 8.8.3' to be broken.
    [NuGet] Uninstalling 'cabal 3.2.0.0' might cause 'ghc 8.10.1, ghc 8.6.5, ghc 8.8.3' to be broken.
    

    but for ghc it prints just

    Installing the following packages:
    ghc
    By installing you accept licenses for the packages.
    
    Progress: Downloading cabal 3.2.0.0... 4%
    Progress: Downloading cabal 3.2.0.0... 15%
    Progress: Downloading cabal 3.2.0.0... 25%
    Progress: Downloading cabal 3.2.0.0... 35%
    Progress: Downloading cabal 3.2.0.0... 45%
    Progress: Downloading cabal 3.2.0.0... 55%
    Progress: Downloading cabal 3.2.0.0... 65%
    Progress: Downloading cabal 3.2.0.0... 75%
    Progress: Downloading cabal 3.2.0.0... 86%
    Progress: Downloading cabal 3.2.0.0... 96%
    Progress: Downloading cabal 3.2.0.0... 100%
    
    Progress: Downloading ghc 8.6.5... 10%
    Progress: Downloading ghc 8.6.5... 32%
    Progress: Downloading ghc 8.6.5... 53%
    Progress: Downloading ghc 8.6.5... 75%
    Progress: Downloading ghc 8.6.5... 97%
    Progress: Downloading ghc 8.6.5... 100%
    
    Chocolatey installed 0/0 packages. 
     See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
    

    and nothing happens. I also don't seem to get any GHC in Path.

yes, github actions has a fucked up way that it manages PATHs. the install seems to be failing can you pass -d to see why?

@Mistuke
Copy link
Collaborator

Mistuke commented May 22, 2020

How does it not do that? In principle I could add a flag that when passed to chocolatey doesn't set PATH but instead uses chocolatey shims but only allow those on the fully qualified versions.

The hvr-ppa installs GHCs and cabal into directories which are not in the PATH by default. So user have to that manually. Linux users are used to that, it's not a problem.

Windows users already crucify me for using a commandline, I doubt they would grok having to modify PATH. Like I said I can do it as an option in future images, or you can simply "clean" the PATH after install as I can't modify existing images.

In haskell-ci generated scripts (which Cabal doesn't use), I don't set up the PATH, but explicitly use --with-compiler=/path/to/correct/ghc to use that one. This way we can ensure that packages themselves dont' call ghc directly, or anything like that. (And in fact some do/did).

Cabal CI is different. The setup here is unfortunately complicated, so getting complete isolation is tricky. There are various issues (like interaction with global package environment files or packages in store) which are unfortunate but not major enough that I'd be motivated to tackle them (i.e. payoff is low).

Now the GitHub actions setup changes stuff.

I wish GitHub actions provided a minimal image. There is more work to correct the setup that we ever will save by saved startup time (which we won't anyway).

What I don't get is why the image has to have every single version installed at once? Why can't you simply use something like AppVeyor's build matrix? Isn't that simpler? or does github actions not support something like that.

@phadej
Copy link
Collaborator Author

phadej commented May 22, 2020

What I don't get is why the image has to have every single version installed at once? Why can't you simply use something like AppVeyor's build matrix? Isn't that simpler? or does github actions not support something like that.

The motivation seems to be that having tools preinstalled would save startup time.

@Mistuke
Copy link
Collaborator

Mistuke commented May 22, 2020

@Mistuke and do I understand right that installing GHCs side-by-side with -m / --allow-multiple is not supported by your scripts?

They are supported.

I.e. which one ends up in Path is somewhat arbitrary etc?

It's not arbitrary, they are appended to PATH. so first one always gets used first. which is why using the fully qualified name of the compiler works with -w you don't need the full path.

@Mistuke
Copy link
Collaborator

Mistuke commented May 22, 2020

What I don't get is why the image has to have every single version installed at once? Why can't you simply use something like AppVeyor's build matrix? Isn't that simpler? or does github actions not support something like that.

The motivation seems to be that having tools preinstalled would save startup time.

The thing that takes largest amount of time is msys2, which you say will be preinstalled or could be. installing GHC and cabal on appveyor takes 1minute. it's just a download and extract. It'll save bandwidth sure, but highly doubt much in compile time..

You can speed this up by instead of caching the installs, cache the binaries using --cachelocation and --use-download-cache which should drop the time needed down to seconds (just unzip) and make your life a lot easier...

@phadej
Copy link
Collaborator Author

phadej commented May 22, 2020

For -d output see https://github.com/haskell/cabal/pull/6831/checks?check_run_id=699118152

I also Get-Content the appveyor log. It ends with

2020-05-22T09:10:47.1567473Z 2020-05-22 09:10:21,171 4576 [DEBUG] - Configuration: CommandName='install'|
2020-05-22T09:10:47.1567975Z CacheLocation='C:\Users\runneradmin\AppData\Local\Temp\chocolatey'|
2020-05-22T09:10:47.1568457Z ContainsLegacyPackageInstalls='True'|
2020-05-22T09:10:47.1569412Z CommandExecutionTimeoutSeconds='2700'|WebRequestTimeoutSeconds='30'|
2020-05-22T09:10:47.1569587Z Sources='https://chocolatey.org/api/v2/'|SourceType='normal'|
2020-05-22T09:10:47.1569966Z Debug='True'|Verbose='False'|Trace='False'|Force='True'|Noop='False'|
2020-05-22T09:10:47.1570698Z HelpRequested='False'|UnsuccessfulParsing='False'|RegularOutput='True'|
2020-05-22T09:10:47.1571109Z QuietOutput='False'|PromptForConfirmation='False'|AcceptLicense='True'|
2020-05-22T09:10:47.1571519Z AllowUnofficialBuild='False'|Input='ghc'|Version='8.6.5'|
2020-05-22T09:10:47.1572019Z AllVersions='False'|SkipPackageInstallProvider='False'|
2020-05-22T09:10:47.1572494Z PackageNames='ghc'|Prerelease='False'|ForceX86='False'|
2020-05-22T09:10:47.1573007Z OverrideArguments='False'|NotSilent='False'|
2020-05-22T09:10:47.1573924Z ApplyPackageParametersToDependencies='False'|
2020-05-22T09:10:47.1574070Z ApplyInstallArgumentsToDependencies='False'|IgnoreDependencies='False'|
2020-05-22T09:10:47.1574958Z AllowMultipleVersions='False'|AllowDowngrade='False'|
2020-05-22T09:10:47.1575112Z ForceDependencies='False'|Information.PlatformType='Windows'|
2020-05-22T09:10:47.1575895Z Information.PlatformVersion='10.0.17763.0'|
2020-05-22T09:10:47.1576144Z Information.PlatformName='Windows Server 2016'|
2020-05-22T09:10:47.1576556Z Information.ChocolateyVersion='0.10.15.0'|
2020-05-22T09:10:47.1577008Z Information.ChocolateyProductVersion='0.10.15'|
2020-05-22T09:10:47.1577543Z Information.FullName='choco, Version=0.10.15.0, Culture=neutral, PublicKeyToken=79d02ea9cad655eb'|
2020-05-22T09:10:47.1577909Z 
2020-05-22T09:10:47.1578698Z Information.Is64BitOperatingSystem='True'|
2020-05-22T09:10:47.1579078Z Information.Is64BitProcess='True'|Information.IsInteractive='True'|
2020-05-22T09:10:47.1579578Z Information.UserName='runneradmin'|
2020-05-22T09:10:47.1580006Z Information.UserDomainName='fv-az26'|
2020-05-22T09:10:47.1580602Z Information.IsUserAdministrator='True'|
2020-05-22T09:10:47.1581056Z Information.IsUserSystemAccount='False'|
2020-05-22T09:10:47.1581569Z Information.IsUserRemoteDesktop='False'|
2020-05-22T09:10:47.1582051Z Information.IsUserRemote='True'|
2020-05-22T09:10:47.1582549Z Information.IsProcessElevated='True'|
2020-05-22T09:10:47.1583052Z Information.IsLicensedVersion='False'|Information.LicenseType='Foss'|
2020-05-22T09:10:47.1583567Z Information.CurrentDirectory='D:\a\cabal\cabal'|
2020-05-22T09:10:47.1584057Z Features.AutoUninstaller='True'|Features.ChecksumFiles='True'|
2020-05-22T09:10:47.1584545Z Features.AllowEmptyChecksums='False'|
2020-05-22T09:10:47.1585109Z Features.AllowEmptyChecksumsSecure='True'|
2020-05-22T09:10:47.1585511Z Features.FailOnAutoUninstaller='False'|
2020-05-22T09:10:47.1586079Z Features.FailOnStandardError='False'|Features.UsePowerShellHost='True'|
2020-05-22T09:10:47.1586514Z Features.LogEnvironmentValues='False'|Features.LogWithoutColor='False'|
2020-05-22T09:10:47.1587133Z Features.VirusCheck='False'|
2020-05-22T09:10:47.1587494Z Features.FailOnInvalidOrMissingLicense='False'|
2020-05-22T09:10:47.1587991Z Features.IgnoreInvalidOptionsSwitches='True'|
2020-05-22T09:10:47.1588499Z Features.UsePackageExitCodes='True'|
2020-05-22T09:10:47.1589155Z Features.UseEnhancedExitCodes='False'|
2020-05-22T09:10:47.1589541Z Features.UseFipsCompliantChecksums='False'|
2020-05-22T09:10:47.1589936Z Features.ShowNonElevatedWarnings='True'|
2020-05-22T09:10:47.1590523Z Features.ShowDownloadProgress='True'|
2020-05-22T09:10:47.1590908Z Features.StopOnFirstPackageFailure='False'|
2020-05-22T09:10:47.1591348Z Features.UseRememberedArgumentsForUpgrades='False'|
2020-05-22T09:10:47.1591820Z Features.IgnoreUnfoundPackagesOnUpgradeOutdated='False'|
2020-05-22T09:10:47.1592277Z Features.SkipPackageUpgradesWhenNotInstalled='False'|
2020-05-22T09:10:47.1592928Z Features.RemovePackageInformationOnUninstall='False'|
2020-05-22T09:10:47.1593181Z Features.ExitOnRebootDetected='False'|
2020-05-22T09:10:47.1593712Z Features.LogValidationResultsOnWarnings='True'|
2020-05-22T09:10:47.1594188Z Features.UsePackageRepositoryOptimizations='True'|
2020-05-22T09:10:47.1594680Z Features.ScriptsCheckLastExitCode='False'|
2020-05-22T09:10:47.1595318Z ListCommand.LocalOnly='False'|
2020-05-22T09:10:47.1595594Z ListCommand.IdOnly='False'|ListCommand.IncludeRegistryPrograms='False'|
2020-05-22T09:10:47.1596156Z ListCommand.PageSize='25'|ListCommand.Exact='False'|
2020-05-22T09:10:47.1596738Z ListCommand.ByIdOnly='False'|ListCommand.ByTagOnly='False'|
2020-05-22T09:10:47.1597132Z ListCommand.IdStartsWith='False'|ListCommand.OrderByPopularity='False'|
2020-05-22T09:10:47.1597601Z ListCommand.ApprovedOnly='False'|
2020-05-22T09:10:47.1598101Z ListCommand.DownloadCacheAvailable='False'|
2020-05-22T09:10:47.1598612Z ListCommand.NotBroken='False'|
2020-05-22T09:10:47.1599184Z ListCommand.IncludeVersionOverrides='False'|
2020-05-22T09:10:47.1599575Z UpgradeCommand.FailOnUnfound='False'|
2020-05-22T09:10:47.1599987Z UpgradeCommand.FailOnNotInstalled='False'|
2020-05-22T09:10:47.1600486Z UpgradeCommand.NotifyOnlyAvailableUpgrades='False'|
2020-05-22T09:10:47.1600977Z UpgradeCommand.ExcludePrerelease='False'|
2020-05-22T09:10:47.1601573Z NewCommand.AutomaticPackage='False'|
2020-05-22T09:10:47.1602000Z NewCommand.UseOriginalTemplate='False'|SourceCommand.Command='unknown'|
2020-05-22T09:10:47.1602510Z SourceCommand.Priority='0'|SourceCommand.BypassProxy='False'|
2020-05-22T09:10:47.1603102Z SourceCommand.AllowSelfService='False'|
2020-05-22T09:10:47.1603478Z SourceCommand.VisibleToAdminsOnly='False'|
2020-05-22T09:10:47.1603986Z FeatureCommand.Command='unknown'|ConfigCommand.Command='unknown'|
2020-05-22T09:10:47.1604626Z ApiKeyCommand.Remove='False'|PinCommand.Command='unknown'|
2020-05-22T09:10:47.1604916Z OutdatedCommand.IgnorePinned='False'|Proxy.BypassOnLocal='True'|
2020-05-22T09:10:47.1605349Z 2020-05-22 09:10:21,172 4576 [DEBUG] - _ Chocolatey:ChocolateyInstallCommand - Normal Run Mode _
2020-05-22T09:10:47.1605986Z 2020-05-22 09:10:21,172 4576 [INFO ] - Installing the following packages:
2020-05-22T09:10:47.1606307Z 2020-05-22 09:10:21,172 4576 [INFO ] - ghc
2020-05-22T09:10:47.1606757Z 2020-05-22 09:10:21,172 4576 [INFO ] - By installing you accept licenses for the packages.
2020-05-22T09:10:47.1607350Z 2020-05-22 09:10:21,562 4576 [INFO ] - [NuGet] Attempting to resolve dependency 'cabal (= 2.4.0.0)'.
2020-05-22T09:10:47.1607785Z 2020-05-22 09:10:21,906 4576 [INFO ] - [NuGet] 'ghc 8.6.5' already installed.
2020-05-22T09:10:47.1608284Z 2020-05-22 09:10:21,922 4576 [DEBUG] - Attempting to delete file "C:\Users\runneradmin\AppData\Local\NuGet\Cache\ghc.8.6.5.nupkg".
2020-05-22T09:10:47.1608761Z 2020-05-22 09:10:21,922 4576 [WARN ] - 
2020-05-22T09:10:47.1609259Z Chocolatey installed 0/0 packages. 
2020-05-22T09:10:47.1609905Z  See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
2020-05-22T09:10:47.1610215Z 2020-05-22 09:10:21,922 4576 [DEBUG] - Sending message 'PostRunMessage' out if there are subscribers...
2020-05-22T09:10:47.1610773Z 2020-05-22 09:10:21,984 4576 [DEBUG] - Exiting with 0

I have no idea why nothing happens.

I tried first uninstalling GHC and cabal, and then reinstalling them, and they work stuff worked.

@phadej
Copy link
Collaborator Author

phadej commented May 22, 2020

As you can see in #6831 commits, I run out of ideas. (Only uninstalling approach worked).

Any new things to try are much appreciated. Until then I guess we have to not care about failing windows job. Luckily the Appveyor job acts as safety net (it does less, but it does something).

@Mistuke
Copy link
Collaborator

Mistuke commented May 22, 2020

For -d output see https://github.com/haskell/cabal/pull/6831/checks?check_run_id=699118152

I also Get-Content the appveyor log. It ends with

I have no idea why nothing happens.

Because it thinks it has nothing to do:

2020-05-22T09:10:47.1606765Z 2020-05-22 09:10:21,172 4576 [INFO ] - By installing you accept licenses for the packages.
2020-05-22T09:10:47.1607360Z 2020-05-22 09:10:21,562 4576 [INFO ] - [NuGet] Attempting to resolve dependency 'cabal (= 2.4.0.0)'.
2020-05-22T09:10:47.1607794Z 2020-05-22 09:10:21,906 4576 [INFO ] - [NuGet] 'ghc 8.6.5' already installed.

did you remember to pass it a -f? also for ghc reinstalls you probably want to use --ignore-dependencies.

I tried first uninstalling GHC and cabal, and then reinstalling them, and they work stuff worked.

I think you should cache the binaries, the install itself would be a second or 10, look at the time in the log, not sure it's worth the complication of caching the installs instead of the binaries.

@phadej
Copy link
Collaborator Author

phadej commented May 22, 2020

did you remember to pass it a -f

Yes, I had -fyd

also for ghc reinstalls you probably want to use --ignore-dependencies.

Wil ltry that next.

I think you should cache the binaries, the install itself would be a second or 10, look at the time in the log, not sure it's worth the complication of caching the installs instead of the binaries

I don't understand what you mean here. I tried to uninstall the preinstalled GHC and then install the version I wanted. It worked. The uninstallation took 10 minutes or so. Installation part was quick.

@Mistuke
Copy link
Collaborator

Mistuke commented May 22, 2020

As you can see in #6831 commits, I run out of ideas. (Only uninstalling approach worked).

Any new things to try are much appreciated. Until then I guess we have to not care about failing windows job. Luckily the Appveyor job acts as safety net (it does less, but it does something).

Yes, because AppVeyor didn't do something ass stupid on their windows CI. I will get you a working script after the weekend. But I still recommend you cache the binaries instead of reinstall.

@Mistuke
Copy link
Collaborator

Mistuke commented May 22, 2020

I don't understand what you mean here. I tried to uninstall the preinstalled GHC and then install the version I wanted. It worked. The uninstallation took 10 minutes or so. Installation part was quick.

My point it don't uninstall! Uninstall is slow because of how chocolatey tries to make it atomic and ensure it leaves nothing behind. It will always be slow.

What I am suggesting is having c:\choco\cache

and doing choco install ghc --ignore-dependencies --use-download-cache --cache-location="c:\choco\cache"

which should make a fresh install almost instant. and you can then use a build matrix like appveryor and cache c:\choco\cache in your image (but I just noticed this is not available in the free version of chocolatey).

Ok, instead install them with --install-directory=<dir> which would allow you to pick where to install them and you can then just simply manage PATH yourself like on linux. If you can cache only the folder then when the new image starts up the PATH should be clean.

Otherwise We can clean the PATH after install. But can we talk after work... find me on irc might be easier.

@phadej
Copy link
Collaborator Author

phadej commented May 22, 2020

Does the above mean

  • Ignore existence of installed GHC
  • Just install it somewhere else
  • Fix Path so pre-installing GHC is not there?

That sounds plausible.

I think I'll stop Cabal work in few hours for this week.

@Mistuke
Copy link
Collaborator

Mistuke commented May 22, 2020

Does the above mean

  • Ignore existence of installed GHC
  • Just install it somewhere else
  • Fix Path so pre-installing GHC is not there?

That sounds plausible.

Indeed, install everything with -m into folders you expect. clear PATH, save the image. On a run you just point to the locations you want.

I think I'll stop Cabal work in few hours for this week.

Fair enough, have a good weekend!

@phadej
Copy link
Collaborator Author

phadej commented May 22, 2020

Obviously there is ::add-path:: https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#adding-a-system-path but doesn't seem to be corresponding ::delete-path:: or ::remove-path::... so clearing Path is not easy.

@Mistuke
Copy link
Collaborator

Mistuke commented May 22, 2020

We can maybe do that with ::set-env especially if we get the PATH before the installs, then it's just a matter of setting that value back.

@phadej
Copy link
Collaborator Author

phadej commented May 22, 2020

It appears you are attempting to use options that may be only available in licensed versions of Chocolatey ('--install-directory=c:\ghc').

@Mistuke
Copy link
Collaborator

Mistuke commented May 22, 2020

sigh [Licensed editions](https://chocolatey.org/compare) only. I didn't see that before.. which GHC versions are you looking to support? are they ones from the las t 2-3 years?

@phadej
Copy link
Collaborator Author

phadej commented May 22, 2020

@Mistuke for Cabal? The 8.6.5 is the oldest. I don't remember the reason we dropped GHC-8.4.4, probably it had some issues. Sadly my commit message is just

Try newer GHC on Appveyor

So I don't remember what exactly didn't work then. Doesn't matter now.

Yet, GHC-8.6.5 is the only working one in GitHub Actions. 8.8 and 8.10 fail due https://gitlab.haskell.org/ghc/ghc/issues/17926, so currently we are squeezed.

(Also looks like 8.8.4 won't happen, so maybe we won't be able to test cabal with 8.8 at all on newer Windows. EDIT: or maybe we can if we manage to upgrade process, but I'm not sure it's worth the trouble).

@phadej
Copy link
Collaborator Author

phadej commented May 22, 2020

I got CI green again in #6831, feel free to improve upon uninstall-reinstall hack.

@phadej phadej closed this May 22, 2020
@phadej phadej deleted the testi branch May 22, 2020 17:51
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 this pull request may close these issues.

3 participants