Coder Social home page Coder Social logo

actions's Introduction

actions's People

Contributors

a5ob7r avatar alexbiehl avatar andreasabel avatar anton-latukha avatar dependabot[bot] avatar ethomson avatar hazelweakly avatar hross avatar kleidukos avatar ludat avatar luispedro avatar lukel97 avatar mbj avatar mihaimaruseac avatar msakai avatar newhoggy avatar omelkonian avatar patrickt avatar pavelzw avatar rethab avatar rhendric avatar rufflewind avatar rwe avatar ryanglscott avatar sgadkar2 avatar simmsb avatar sorki avatar tclem avatar thboop avatar wismill avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

actions's Issues

Remove cabal update from setup upon request

I feel like cabal update should not be part of the setup. This is because cabal update will do project specific work and sometimes fail because of problems specific to the project.

For example:

image

Aside from this, the project may want to do cabal update after configuring the project, which duplicates work.

Can the "not found in cache" warning be downgraded to debug level?

Is this warning actionable? If not, can it be downgraded to a core.debug message?

Source code that generates this warning: https://github.com/haskell/actions/blob/main/setup/src/installer.ts#L56-L63

Example:

ghc 8.10.3 was not found in the cache. It will be downloaded. If this is unexpected, please check if version 8.10.3 is pre-installed. The list of pre-installed versions is available here: https://help.github.com/en/actions/reference/software-installed-on-github-hosted-runners The above list follows a common haskell convention that the three latest major releases of ghc are commonly supported. If the list is outdated, please file an issue here: https://github.com/actions/virtual-environments by using the appropriate tool request template: https://github.com/actions/virtual-environments/issues/new/choose

Matchers-only option

We use nix in CI to provide GHC and all relevant tools, but we also want the error matchers.

As a work around, we've got this config in our GitHub Actions file:

        # we use the Haskell setup action because it integrates error matching.
        # we don't use it to bring in GHC or any other Haskell tooling - that
        # is all provided by Nix. 
      - uses: haskell/actions/setup@v1
        # This little stanza is what we need to prevent installing a redundant
        # GHC. It does install a redundant stack, but that's a much smaller
        # problem.
        with:
          enable-stack: true
          stack-no-global: true

This takes ~0s according to GitHub, which is great.

However, it'd be ideal to either have a ghc-matchers GitHub action or a matchers-only option.

Please, checks after merge

There is a number of things that need to be done & checked to make merged hlint actions work properly.

  • 1. I forgot to manually update my haskell/actions main fork branch to recent commits, that is - after #82 & #83 got merged.

A big diff in #83 thankfully is only haskell/actions/setup specific. There everything is Ok, seems it requires nothing.

Also #82's .github/dependabot.yml is not in #85's Git history. During merge that would resolve itself. Again - that should be no biggy at all. But because I have already redone complex merge several times & then noticed:

hlint-run/.github/dependabot.yml
hlint-setup/.github/dependabot.yml

can not be merged with .github/dependabot.yml in the scope of #85, because the .github/dependabot.yml does not exist there.

After the merge into the mainline - configs of those dependabot.yml files seems need merge into .github. As I found no evidence/docs that localized dependabot configuration would work. Seems like setting according directory: field there would be enough.

  • 2. (optional):

I kept .gitattributes files in according directories. Documentation on gitattributes for me was unclear - does git treats them as it does .gitignore (allowing to place localized .gitignore in any directory. I currently assume, git detects & works with .gitattributes localized just as well.

  • 2. Tags for hlint action versioning need to be made (as GitHub Actions mechanism depends on that) (as the continuations of rwes versioning). & as alpha/beta/pre first.

  • 3. HLint actions (their testing prereleases) need to be published to GitHub Marketplace, so we can test the full actions workflow loop.

  • 4. Final testing

I can test pre-release & then stable release actions on

And on more calm haskell-with-nixpkgs for that matter.

ghc-8.10.4 installation started failing

See https://github.com/input-output-hk/cardano-prelude/pull/157/checks?check_run_id=2137094041

  Attempting to install ghc 8.10.4" using apt-get
  /usr/bin/sudo -- sh -c apt-get -y install ghc-8.10.4
  Reading package lists...
  Building dependency tree...
  Reading state information...
  ghc-8.10.4 is already the newest version (8.10.4-19~20.04).
  0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
  Attempting to install ghc 8.10.4" using ghcup
  /opt/hostedtoolcache/ghcup/0.1.12/x64/ghcup install ghc 8.10.4"
  Not a valid version
  
  Usage: ghcup install ghc [-p|--platform PLATFORM] 
                           [[-u|--url BINDIST_URL] VERSION|TAG | VERSION|TAG] 
                           [--set]
    Install GHC
  
  Available options:
    -p,--platform PLATFORM   Override for platform (triple matching ghc tarball
                             names), e.g. x86_64-fedora27-linux
    -u,--url BINDIST_URL     Install the specified version from this bindist
    --set                    Set as active version after install
    -h,--help                Show this help text
  
  Discussion:
    Installs the specified GHC version (or a recommended default one) into
    a self-contained "~/.ghcup/ghc/<ghcver>" directory
    and symlinks the ghc binaries to "~/.ghcup/bin/<binary>-<ghcver>".
  
  Examples:
    # install recommended GHC
    ghcup install ghc
  
    # install latest GHC
    ghcup install ghc latest
  
    # install GHC 8.10.2
    ghcup install ghc 8.10.2
  
    # install GHC head fedora bindist
    ghcup install ghc -u https://gitlab.haskell.org/api/v4/projects/1/jobs/artifacts/master/raw/ghc-x86_64-fedora27-linux.tar.xz?job=validate-x86_64-linux-fedora27 head
Error: All install methods for ghc 8.10.4" failed

latest cabal-install version

IMO this is a github actions/virtual-environments issue (so I opened actions/runner-images#2458 there)
but I thought better to discuss and coordinate here too.

The problem for me is that the github Actions ubuntu runner images are installing the latest cabal-install package
from hvr's ppa but it seems here cabal-install latest is 3.2.0.0: so this makes things a bit confusing:
eg even if one does not set a cabal-install explicitly there is still a Warning about downloading 3.2.

Based on that I have suggested in the above issue that upstream changes the ubuntu images to use the current
stable 3.2.0.0 release instead (instead of the latest 3.4 RC package build).

(Similarly they take latest ghc to be 8.10.3 - lucky there is no 9.0 yet in the ppa - but there will be before long I suppose .;-)
Overall I don't think the "just take the latest version" solution is very good - though of course it reduces their PR churn.
Another approach would be not to install either in the ubuntu images, but then the default latest versions would always need to be installed (not sure how many people just use to the latest image versions only though...).

Support GHC 8.10.4

Thanks for this great resource!

It would be very cool if 8.10.4 were to be supported here.

I wonder how feasible it would be to have some automated updates of supported GHC versions, at the moment it seems as though it's a largely manual affair.

setup action fails to set the required ghc version as default

Run haskell/actions/setup@v1
  with:
    ghc-version: 8.8.4
    cabal-version: 3.4
    stack-version: latest
Preparing to setup a Haskell environment
Resolved 3.4 to 3.4.0.0
Installing ghc version 8.8.4
  Attempting to install ghc 8.8.4 using apt-get
  /usr/bin/sudo -- sh -c add-apt-repository -y ppa:hvr/ghc && apt-get update && apt-get -y install ghc-8.8.4
.........
  Selecting previously unselected package ghc-8.8.4.
  Preparing to unpack .../ghc-8.8.4_8.8.4-17~20.04_amd64.deb ...
  Unpacking ghc-8.8.4 (8.8.4-17~20.04) ...
  Setting up libncursesw5:amd64 (6.2-0ubuntu2) ...
  Setting up ghc-8.8.4 (8.8.4-17~20.04) ...
  update-alternatives: using /opt/ghc/bin/ghc-8.8.4 to provide /opt/ghc/bin/ghc (opt-ghc) in auto mode
  Processing triggers for libc-bin (2.31-0ubuntu9.2) ...

Found ghc 8.8.4 in cache at path /opt/ghc/8.8.4/bin. Setup successful.
  • And this info about ghc:
Run which cabal
  which cabal
  cabal --version
  which ghc
  ghc --version
  cabal exec ghc -- --version
  shell: /usr/bin/bash -e {0}
/home/runner/.ghcup/bin/cabal
cabal-install version 3.4.0.0
compiled using version 3.4.0.0 of the Cabal library 
/home/runner/.ghcup/bin/ghc
The Glorious Glasgow Haskell Compilation System, version 9.0.1
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: ghcide-1.4.2.0 (user goal)
[__1] trying: base-4.15.0.0/installed-4.15.0.0 (dependency of ghcide)
[__2] trying: hls-brittany-plugin-1.0.1.0 (user goal)
[__3] next goal: czipwith (dependency of hls-brittany-plugin)
[__3] rejecting: czipwith-1.0.1.3 (conflict:
base==4.15.0.0/installed-4.15.0.0, czipwith => base>=4.11 && <4.15)
[__3] skipping: czipwith-1.0.1.2, czipwith-1.0.1.1, czipwith-1.0.1.0,
czipwith-1.0.0.0 (has the same characteristics that caused the previous
version to fail: excludes 'base' version 4.15.0.0)
[__3] fail (backjumping, conflict set: base, czipwith, hls-brittany-plugin)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: ghcide, base, czipwith,
hls-brittany-plugin
Try running with --minimize-conflict-set to improve the error message.

//cc @jared-w @hasufell

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?

`stack-setup-ghc: false` treated as true

The documentation states that the default is false, but when the value is explicitly set to false, it is treated as if it was set to true.

Here is an example run in which stack-setup-ghc has been set to false; the logs show that stack setup is being called:

Run haskell/actions/setup@v1
  with:
    enable-stack: true
    stack-setup-ghc: false
    ghc-version: latest
    cabal-version: latest
    stack-version: latest
Preparing to setup a Haskell environment
Resolved latest to 8.10.2
Resolved latest to 3.2.0.0
Resolved latest to 2.5.1
Installing ghc version 8.10.2
Installing cabal version 3.2.0.0
Installing stack version 2.5.1
Pre-installing GHC with stack
  /opt/hostedtoolcache/stack/2.5.1/x64/stack setup 8.10.2
[...]
Setting up cabal

Here is an example run in which stack-setup-ghc was not specified; the logs show that stack setup is not called, as expected:

Run haskell/actions/setup@v1
  with:
    enable-stack: true
    ghc-version: latest
    cabal-version: latest
    stack-version: latest
Preparing to setup a Haskell environment
Resolved latest to 8.10.2
Resolved latest to 3.2.0.0
Resolved latest to 2.5.1
Installing ghc version 8.10.2
Installing cabal version 3.2.0.0
Installing stack version 2.5.1
Setting up cabal

strange builder failure on windows

Failed to build Only-0.1. The failure occurred during the configure step.
Build log (
C:\Users\runneradmin\AppData\Roaming\cabal\logs\ghc-8.10.2\Only-0.1-2ef1951231fbebae8aef46b573558eddb102eaa0.log
cabal.exe: Failed to build Only-0.1 (which is required by criterion-1.5.9.0).
):
See the build log above for details.
Configuring library for Only-0.1..

C:\Users\RUNNER~1\AppData\Local\Temp\ghcC097.o: DeleteFile "\\\\?\\C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\ghcC097.o": permission denied (Access is denied.)
Error: Process completed with exit code 1.

from https://github.com/cartazio/ralist/runs/1592491336?check_suite_focus=true#step:10:230

Please, help us merge or integrate the HLint action

In ndmitchell/hlint#1311 we found & Neil blessed the currently best HLint action that exists.

An important feature of it - it allows softly suggesting code improvements, & so allows to use HLint in the project while also preserving the ease of pleasantness in the code merge processes.

How we would adopt the usage of it.

Calling author into the thread: @rwe.

Output the path to the stack store

This is another issue related to #12. Similar to the output cabal-store, it will be much nicer if this action provides an output for stack global store as well. It makes life easier when setting up a cross-platform CI scripts. ๐Ÿ˜ƒ

Add support for ghc-8.10.6

Installing ghc version 8.10.6
  Attempting to install ghc 8.10.6 using apt-get
  /usr/bin/sudo -- sh -c add-apt-repository -y ppa:hvr/ghc && apt-get update && apt-get -y install ghc-8.10.6
  Get:1 https://packages.microsoft.com/ubuntu/20.04/prod focal InRelease [10.5 kB]
  Hit:2 http://azure.archive.ubuntu.com/ubuntu focal InRelease
  Get:3 http://azure.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
  Get:4 http://azure.archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB]
  Get:5 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
  Get:6 https://packages.microsoft.com/ubuntu/20.04/prod focal/main amd64 Packages [91.7 kB]
  Get:7 http://ppa.launchpad.net/hvr/ghc/ubuntu focal InRelease [17.5 kB]
  Get:8 http://azure.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [1163 kB]
  Get:9 http://azure.archive.ubuntu.com/ubuntu focal-updates/main Translation-en [251 kB]
  Get:10 http://azure.archive.ubuntu.com/ubuntu focal-updates/main amd64 c-n-f Metadata [13.9 kB]
  Get:11 http://azure.archive.ubuntu.com/ubuntu focal-updates/restricted amd64 Packages [400 kB]
  Get:12 http://azure.archive.ubuntu.com/ubuntu focal-updates/restricted Translation-en [57.3 kB]
  Get:13 http://azure.archive.ubuntu.com/ubuntu focal-updates/restricted amd64 c-n-f Metadata [480 B]
  Get:14 http://azure.archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [845 kB]
  Get:15 http://azure.archive.ubuntu.com/ubuntu focal-updates/universe Translation-en [177 kB]
  Get:16 http://azure.archive.ubuntu.com/ubuntu focal-updates/universe amd64 c-n-f Metadata [18.4 kB]
  Get:17 http://azure.archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 Packages [25.0 kB]
  Get:18 http://azure.archive.ubuntu.com/ubuntu focal-updates/multiverse Translation-en [6888 B]
  Get:19 http://azure.archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 c-n-f Metadata [652 B]
  Hit:20 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu focal InRelease
  Get:21 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [820 kB]
  Get:22 http://security.ubuntu.com/ubuntu focal-security/main Translation-en [160 kB]
  Get:23 http://security.ubuntu.com/ubuntu focal-security/main amd64 c-n-f Metadata [8440 B]
  Get:24 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 Packages [361 kB]
  Get:25 http://security.ubuntu.com/ubuntu focal-security/restricted Translation-en [51.7 kB]
  Get:26 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 c-n-f Metadata [484 B]
  Get:27 http://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages [637 kB]
  Get:28 http://security.ubuntu.com/ubuntu focal-security/universe Translation-en [99.2 kB]
  Get:29 http://security.ubuntu.com/ubuntu focal-security/universe amd64 c-n-f Metadata [12.1 kB]
  Get:30 http://ppa.launchpad.net/hvr/ghc/ubuntu focal/main amd64 Packages [7352 B]
  Get:31 http://ppa.launchpad.net/hvr/ghc/ubuntu focal/main Translation-en [708 B]
  Fetched 5566 kB in 1s (3886 kB/s)
  Reading package lists...
  Hit:1 http://azure.archive.ubuntu.com/ubuntu focal InRelease
  Hit:2 http://azure.archive.ubuntu.com/ubuntu focal-updates InRelease
  Hit:3 http://azure.archive.ubuntu.com/ubuntu focal-backports InRelease
  Hit:4 https://packages.microsoft.com/ubuntu/20.04/prod focal InRelease
  Hit:5 http://security.ubuntu.com/ubuntu focal-security InRelease
  Hit:6 http://ppa.launchpad.net/hvr/ghc/ubuntu focal InRelease
  Hit:7 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu focal InRelease
  Reading package lists...
  Reading package lists...
  Building dependency tree...
  Reading state information...
  E: Unable to locate package ghc-8.10.6
  E: Couldn't find any package by glob 'ghc-8.10.6'
  E: Couldn't find any package by regex 'ghc-8.10.6'
  Attempting to install ghc 8.10.6 using ghcup
  /opt/hostedtoolcache/ghcup/0.1.14/x64/ghcup install ghc 8.10.6
  [ Warn  ] New GHCup version available: 0.1.16.2. To upgrade, run 'ghcup upgrade'
  [ Error ] Unable to find a download for the requested version/distro.
  [ Error ] Also check the logs in "/home/runner/.ghcup/logs"
Error: All install methods for ghc 8.10.6 failed

Output actual ghc-version, stack-version, and cabal-version

Using latest as input for ghc-version, stack-version and cabal-version is very convenient, but then it is not so convenient later in the workflow when one needs these versions.

Suggestion: Also output these three variables, filling them with the actually chosen versions of the tools.

This would also open the path for other wildcards for versions, like ghc-version: 8.10.latest etc. which could be used conveniently.

Neutral in the choice of build tools

It does not seem necessary to set up cabal whenever this action is used, if the intended build tool is stack. Setting up cabal is currently costly (about 30s), since the action downloads the version 3.2 of cabal instead of using the one 3.4 provided by runner.

Also, it will be nice to have an option for stack to choose the system GHC by default.

Support new installation path for GHC 9.x on Windows

Hello! I am writing on behalf of maintainers of Hosted GItHub Actions images.

We have noticed that GHC choco package has changed installation path for GHC 9.x on Windows.
Previously, it was installed like C:\ProgramData\chocolatey\lib\ghc.9.0.1\tools, currently, C:\tools

See package changes: version 8.4 vs version 9.0.1.

So this task is not able to install GHC 9.x in runtime or consume pre-installed version because this task uses hardcoded path.
This task even won't be able to install GHC 9.x in runtime because it checks installation path after installation.
The new location is c:\tools\ghc-9.0.1\bin\ghc.exe

Support for Stack 2.7.1

Hi,
When using the stack as 'latest', I get Stack 2.5.1 which fails on Windows when trying to use it with latest nightly resolves, which is using GHC 9.0.1. I am guessing this might be solved with latest Stack which is 2.7.1, but it doesn't seem to be available through this github action!

What is the deal with the versions -> new ones need to be added manually? How do we add 2.7.1? Could it be possible to add support for installing latest Stack without manually updating the latest version in this repo?

Intermittent "cannot find the file specified" on Windows

I thought I saw this reported, but cannot find a ticket, so sorry if it is a duplicate.

After the latest update every other Windows build (cabal + GHC 9.0) fails with

C:\Users\RUNNER~1\AppData\Local\Temp\ghcB4EF.o.tmp: renameFile:renamePath:MoveFileEx "\\\\?\\C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\ghcB4EF.o.tmp" Just "\\\\?\\C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\ghcB4EF.o": does not exist (The system cannot find the file specified.)

https://github.com/haskell/bytestring/runs/1874357129?check_suite_focus=true#step:6:195
https://github.com/haskell/bytestring/blob/master/.github/workflows/ci.yml#L56

Rerunning usually helps, so it is not a blocker, just a nuisance.

Consider ghcup for windows

Right now, when I define

jobs:
  build-cabal:

    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, macOS-latest, windows-latest]
        ghc: ['8.10.7', '9.0.1']
        cabal: ['3.4.0.0']

This will fail on windows only, because 8.10.7 isn't in choco yet. It's quite confusing, because different installers with different release schedules are used under the hood.

I merged https://gitlab.haskell.org/haskell/ghcup-hs/-/merge_requests/159 which would allow the installation procedure on windows to be:

curl.exe -O https://www.haskell.org/ghcup/sh/bootstrap-haskell.ps1
.\bootstrap-haskell.ps1 -InstallDir 'C:\' -InBash -Minimal

Leaving you with an msys2 installation (in C:\ghcup\msys64) and the ghcup binary (in C:\ghcup\bin), nothing more.

Installations of msys2 packages would be carried out via:

C:\ghcup\msys64\usr\bin\bash.exe -lc 'pacman --noconfirm -S package'

GHC 8.10.3

For some reason "latest" seems to point to ghc-8.10.2 on Windows. The latest chocolatey version is 8.10.3 and seems to fix some Windows issues. Do I need to do anything to get it?

Caching dist-newstyle still rebuilds project tests every time

I'm trying to cache ~/.cabal/store and dist-newstyle for my Cabal builds using this action. With that, I expect that if I make a non-code change, Cabal shouldn't have to rebuild anything. But no matter what I try, Cabal will always rebuild the project tests.

One message in the log sticks in my mind:

./.cabal has been changed. Re-configuring with most recently used options. If this fails, please run configure manually.

But I don't know what this means: the *.cabal file isn't edited at all on CI. Also, the library build succeeds just fine, that message only shows on tests.

My tests are at raehik/reprinter (example problematic run workflow). Larger project building at raehik/fortran-src (example problematic run log).

Similar commands run locally don't have this behaviour. I managed to sort most of my issues (Cabal will rebuild the project too if unrelated flags aren't kept the same), but I'd like to know why this occurs. Hope this is relevant, I realise it's a bit of a StackOverflow question -- let me know if I should take it elsewhere.

Migrate/close PRs from actions/setup-haskell

I have some code locally and in the haskell-CI/setup repo that merges in some of the in-flight PRs from actions/setup-haskell (confusing, right?)

However, given that I migrated everything to a setup subfolder in a singular actions repo (with the hopes of having more actions eventually), it doesn't make sense to try to merge that in all at once. Instead I'll go back through and apply every PR manually. The PR to make haskell/actions a library will have to be done last as that one has some larger structural changes that make eyeballing diffs more difficult.

  • Provide library for other actions to use.
  • Upgrade to ghcup-0.1.12
  • Use correct moving tag in readme examples
  • Add cabal 3.4 to the list of versions
  • Add stack-root output
  • Add stack 2.3.3

Add templates written and described by the community

Inspired by #7.

I would be happy to add the following templates written and described in detail by me and @vrom911:

I think a lot of people can benefit from more examples and described templates of using the Haskell setup action ๐Ÿค— Also, licensing rules for our templates are simpler (no need to mention anyone and worry about that).

Cabal 3.4

It's out all official now, so it'd be good to have support for this.

Unable to install cabal-3.4.0.0

  The following NEW packages will be installed:
    cabal-install-3.4
  0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
  Need to get 4352 kB of archives.
  After this operation, 31.9 MB of additional disk space will be used.
  Err:1 http://ppa.launchpad.net/hvr/ghc/ubuntu focal/main amd64 cabal-install-3.4 amd64 3.4+git20210110.2.97582dd-6~20.04
    404  Not Found [IP: 91.189.95.85 80]
  E: Failed to fetch http://ppa.launchpad.net/hvr/ghc/ubuntu/pool/main/c/cabal-install-3.4/cabal-install-3.4_3.4+git20210110.2.97582dd-6~20.04_amd64.deb  404  Not Found [IP: 91.189.95.85 80]
  E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
  Attempting to install cabal 3.4.0.0 using ghcup
  /opt/hostedtoolcache/ghcup/0.1.12/x64/ghcup install cabal 3.4.0.0
  ghcup: internal error: Itimer: read(timerfd) failed with Bad file descriptor and returned -1
      (GHC version 8.8.4 for x86_64_alpine_linux)
      Please report this as a GHC bug:  https://www.haskell.org/ghc/reportabug

See https://github.com/input-output-hk/cardano-node/pull/2321/checks?check_run_id=2028084604

Cabal version 3.2 is requested, and yet cabal 3.4 is installed

I'm quite confused. Here is a fragment of my workflow:

jobs:
  build:
    runs-on: ubuntu-latest
    needs: ormolu
    strategy:
      matrix:
        cabal: ["3.2"]
        ghc: ["8.6.5", "8.8.4", "8.10.3"]
    steps:
      - uses: actions/[email protected]
      - uses: haskell/actions/[email protected]
        id: setup-haskell-cabal
        with:
          ghc-version: ${{ matrix.ghc }}
          cabal-version: ${{ matrix.cabal }}
      - run: cabal --version

I request Cabal 3.2 and indeed in the log it looks like that's what is installed:

Installing cabal version 3.2.0.0
  /opt/hostedtoolcache/ghcup/0.1.12/x64/ghcup set cabal 3.2.0.0
  [ Warn  ] New GHCup version available: 0.1.13. To upgrade, run 'ghcup upgrade'
  [ Error ] NotInstalled Cabal "3.2.0.0"
  Found cabal 3.2.0.0 in cache at path /home/runner/.ghcup/bin. Setup successful.

However, when cabal --version is called immediately after the setup action, it says:

cabal-install version 3.4.0.0
compiled using version 3.4.0.0 of the Cabal library 

See here

What I expect is that if I specify 3.2, then I should get that version of cabal.

Unable to install GHC error

I'm getting this error when running CI:

https://github.com/parsonsmatt/some-dict-of/runs/3657365243?check_suite_focus=true

Installing ghc version 8.10.4
  Warning: ghc 8.10.4 was not found in the cache. It will be downloaded.
  If this is unexpected, please check if version 8.10.4 is pre-installed.
  The list of pre-installed versions is available here: https://help.github.com/en/actions/reference/software-installed-on-github-hosted-runners
  The above list follows a common haskell convention that the three latest major releases of ghc are commonly supported.
  If the list is outdated, please file an issue here: https://github.com/actions/virtual-environments
  by using the appropriate tool request template: https://github.com/actions/virtual-environments/issues/new/choose
  Attempting to install ghc 8.10.4 using apt-get
  /usr/bin/sudo -- sh -c apt-get -y install ghc-8.10.4
  Reading package lists...
  Building dependency tree...
  Reading state information...
  E: Unable to locate package ghc-8.10.4
  E: Couldn't find any package by glob 'ghc-8.10.4'
  E: Couldn't find any package by regex 'ghc-8.10.4'
  Attempting to install ghc 8.10.4 using ghcup
  /opt/hostedtoolcache/ghcup/0.1.8/x64/ghcup install 8.10.4
  [ Warn  ] New GHCup version available: 0.1.16.2. To upgrade, run 'ghcup upgrade'
  [ Warn  ] This is an old-style command for installing GHC. Use 'ghcup install ghc' instead.
  [ Error ] No available GHC version for 8.10.4
Error: All install methods for ghc 8.10.4 failed

https://github.com/parsonsmatt/some-dict-of/blob/master/.github/workflows/haskell.yml is the config

any idea what's going on here?

Attempting to use Stack 2.7.3 results in "add-path disabled" error

Requesting stack version 2.7.3 (current "latest") results in this notice

stack 2.7.3 was not found in the cache. It will be downloaded.
If this is unexpected, please check if version 2.7.3 is pre-installed.
The list of pre-installed versions is available here: https://help.github.com/en/actions/reference/software-installed-on-github-hosted-runners
The above list follows a common haskell convention that the latest release of stack is commonly supported.

which then failed with

Unable to process command '::add-path::/opt/hostedtoolcache/stack/2.7.3/x64' successfully.

and

The `add-path` command is disabled. Please upgrade to using Environment Files or opt into unsecure command
execution by setting the `ACTIONS_ALLOW_UNSECURE_COMMANDS` environment variable to `true`. For more
information see: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/

No doubt I'm holding it wrong, but I thought it pertinent to let you know.

[Windows] Integrate better with msys2 and cabal config

The current windows images don't have a cabal config, so everything is default. haskell/actions sets the store-dir, but nothing else. That means, in order to be able to use msys2 packages, a user would have to set:

  • extra-prog-path
  • extra-include-dirs
  • extra-lib-dirs

And figure out where the pre-installed msys2 is, etc. etc.

This is cumbersome. I've suggested to add this config to the windows images here actions/runner-images#4264 but it's debatable. If we decide to not do this, then the haskell action should have easier means to:

  1. set all of the above cabal config values to the right thing (maybe via a boolean config option or unconditionally)
  2. allow installation of additional msys2 packages in the pre-installed msys2 instance

Doctest doesn't work if ghcup not used

When running doctest in Github Actions, if GHC is not installed via ghcup (for example it was already installed in the virtual environment) then the doctest fails in this manner:

doctest: /home/runner/.ghcup/ghc/8.10.3/bin/ghc-8.10.3: getPermissions:getFileStatus: does not exist (No such file or directory)

https://github.com/haskell-works/hw-aeson/pull/46/checks?check_run_id=1780850470

For some reason doctest expects that ghc is found under ghcup, when it is actually elsewhere.

Provide library for other actions to use

This is the already existing PR from actions/setup-haskell.

@omelkonian, I quite liked your work with this. Unfortunately, a few things in the structure of the repo have changed enough to make porting it over a non-automatic process. It shouldn't be too bad, and I'll help out with it, but I just wanted to give you a heads up with that.

Migrate/close issues from actions/setup-haskell

  • include a more fully featured example template? (heres mine!)
  • Either use sliding tag or latest tag in README.md
  • Bad build of ghc version 8.10.2 for latest on windows ?
  • Retry of GHC installation upon failure does not work
  • Setting GHC/Cabal versions doesn't work with macOS
  • Add ghc 9.0.1
  • I suggest add ~/.local/bin to PATH
  • How to install system libraries on windows?
  • ghcup set is not run when the desired ghc version is found in the cache
  • [RFC] Statically linked binaries
  • Install fails with "cabal: unrecognized 'user-config' option `-a'"
  • Provide cabal-cache executable
  • Provide hlint executable.
  • cabal update fails
  • Not Shown in Marketplace

libnuma-dev required for ghc 8.4.4 (ubuntu-18.04)

We observed a recent failure of building with stack and ghc-8.4.4, apparently due to a missing libnuma-dev on the ubuntu 18.04 machine.

I wonder whether the missing libnuma-dev could be installed as part of the setup action.

Action doesn't handle pre-installed GHCup properly

This action works perfectly if you don't have pre-installed ghcup on machine. It uses apt to install versions and they are resolved correctly.
But when we install GHCup on machine (to the default location $HOME/.ghcup) we can see very strange behavior:

So even if ghcup is pre-installed on machine and available in PATH, action will download own ghcup to tool-cache and use it for all operations.
Probably, ghcupBin function should try to find ghcup in PATH and download in case if it is not found.

Unable to process command '::add-path::/opt/ghc/8.6.5/bin' successfully.

uses: actions/[email protected] leads to

The `add-path` command is disabled. Please upgrade to using Environment Files or opt into unsecure command execution by setting the `ACTIONS_ALLOW_UNSECURE_COMMANDS` environment variable to `true`. For more information see: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/

Should I be using some different version of setup-haskell?

`cabal haddock --enable-doc` still won't build docs for base libraries

I'm trying to pawn off Hackage artifact generation to my CI to ease maintenance. When I run cabal haddock --haddock-for-hackage --enable-documentation locally (via a ghcup install), I get an archive I can upload to Hackage to get the documentation working (it's never generated documentation for me). When I run it on CI, I get the following warning during the workflow (full log):

Warning: The documentation for the following packages are not installed. No
links will be generated to these packages: array-0.5.4.0, base-4.15.0.0,
binary-0.8.8.0, bytestring-0.10.12.1, containers-0.6.4.1, deepseq-1.4.5.0,
ghc-bignum-1.0, ghc-boot-th-9.0.1, ghc-prim-0.7.0, mtl-2.2.2, pretty-1.1.3.6,
stm-2.5.0.0, template-haskell-2.17.0.0, text-1.2.4.1, time-1.9.3,
transformers-0.5.6.2, unix-2.7.2.2
...
Warning: StreamPatch.Patch: could not find link destinations for:

	- GHC.Types.Type
	- GHC.Classes.Eq
	- GHC.Classes.==
	- GHC.Types.Bool
...

And I don't get hyperlinks for types like Functor. Non "base" libraries like aeson hyperlink correctly.

I've tried various flag and command combinations, like an explicit cabal build --enable-doc before cabal haddock, but I only get the same errors. This is on ubuntu-latest, GHC 9.0, Cabal 3.6.

Document that running `haskell/actions/setup` will overwrite `STACK_ROOT` variable on Windows

While updating the PureScript compiler repo to migrate from Travis CI to GitHub Actions (see purescript/purescript#3980), we were setting STACK_ROOT to $HOME/.stack in one step and running this repo's setup action in a later step. Despite setting the variable, stack path always showed stack-path: c:\sr as the result.

After much exploration, I discovered that STACK_ROOT is overwritten on Windows. AFAIK, this isn't documented in this repo.

Support GHC 9.2

I noticed alpha releases of GHC 9.2 are rolling out. I use haskell/actions/setup for the hugely convenient setup it does. I was wondering whether I could use it to test 9.2 releases as well, so I had a go.

I tried adding it to my CI's GHC versions list, but the setup step fails. However, not before appearing to work (after falling back to ghcup). Here is the relevant part of a build log. (also copied below)

  Attempting to install ghc 9.2 using apt-get
  /usr/bin/sudo -- sh -c apt-get -y install ghc-9.2
  Reading package lists...
  Building dependency tree...
  Reading state information...
  E: Unable to locate package ghc-9.2
  E: Couldn't find any package by glob 'ghc-9.2'
  E: Couldn't find any package by regex 'ghc-9.2'
  Attempting to install ghc 9.2 using ghcup
  /opt/hostedtoolcache/ghcup/0.1.12/x64/ghcup install ghc 9.2
  [ Warn  ] New GHCup version available: 0.1.14.1. To upgrade, run 'ghcup upgrade'
  [ Info  ] downloading: https://downloads.haskell.org/~ghc/9.2.1-alpha2/ghc-9.2.0.20210422-x86_64-fedora27-linux.tar.xz
[snip]
  [ Info  ] verifying digest of: ghc-9.2.0.20210422-x86_64-fedora27-linux.tar.xz
  [ Info  ] Unpacking: ghc-9.2.0.20210422-x86_64-fedora27-linux.tar.xz to /tmp/ghcup-leiEoM
  [ Info  ] Installing GHC (this may take a while)
  [ Info  ] GHC installation successful
  /opt/hostedtoolcache/ghcup/0.1.12/x64/ghcup set ghc 9.2
  [ Warn  ] New GHCup version available: 0.1.14.1. To upgrade, run 'ghcup upgrade'
  [ Info  ] GHC 9.2.0.20210422 successfully set as default version
Error: All install methods for ghc 9.2 failed

GHC 9.2 appears to be successfully installed and set as default through ghcup, but the step then ends with an error. Is this intended? The only questionable thing I see is downloading the Fedora version while it's running Ubuntu, but I don't imagine any issues there.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.