Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

Output "stack-root " on Windows is not working #120

Closed
Sorokin-Anton opened this issue Oct 10, 2022 · 4 comments
Closed

Output "stack-root " on Windows is not working #120

Sorokin-Anton opened this issue Oct 10, 2022 · 4 comments
Assignees
Labels
question Further information is requested re: stack Concerning CIs using stack

Comments

@Sorokin-Anton
Copy link

How to reproduce:

Try to run CI.yml with GitHub runner

jobs:
  build-and-test:
    runs-on: windows-latest
    strategy:
      matrix:
        stack: ["2.7.5"]
        ghc: ["9.0.2"]
        include:
          - ghc: "9.0.2"
            stackyaml: stack.yaml
    steps:
    - uses: actions/checkout@v3

    - uses: haskell/actions/[email protected]
      id: setup-haskell-stack
      name: Setup Haskell Stack
      with:
        ghc-version: ${{ matrix.ghc }}
        stack-version: ${{ matrix.stack }}

    - uses: actions/cache@v3
      name: Cache stack root
      with:
        path: ${{ steps.setup-haskell-stack.outputs.stack-root }}
        key: ${{ runner.os }}-${{ matrix.ghc }}-stack
    ...

What should happen:

${{ steps.setup-haskell-stack.outputs.stack-root }} is replaced by stack root created in setup

What happens:

Build fails with Error: Input required and not supplied: path

Additional info:

If I try to run echo "${{ steps.setup-haskell-stack.outputs.stack-root }}", it prints empty string

@andreasabel
Copy link
Member

@Sorokin-Anton wrote:

matrix:
        stack: ["2.7.5"]
        ghc: ["9.0.2"]
        include:
          - ghc: "9.0.2"
            stackyaml: stack.yaml

This matrix looks ill-formed to me, but maybe it works nevertheless? Could it be the source of your problem, maybe?

Can you link to a failing CI run?

@andreasabel andreasabel added question Further information is requested re: stack Concerning CIs using stack labels Dec 22, 2022
@Sorokin-Anton
Copy link
Author

Sorokin-Anton commented Dec 22, 2022

I manually inserted the path to stack root and everything works, I don't think that problem is in matrix
Attempt to echo job output: serokell/xrefcheck@7394d8a
Job: https://github.com/serokell/xrefcheck/actions/runs/3211364966/jobs/5249483031
If I remove echo, I still can't use cache: serokell/xrefcheck@f4ba88f

@andreasabel
Copy link
Member

andreasabel commented Dec 22, 2022


Job: serokell/xrefcheck/actions/runs/3211364966/jobs/5249483031

If you look at this job and what haskell-setup is doing, you see that it does not even attempt to do anything around stack. I think you need to pass:

enable-stack: true

to the action to get it to install stack.

actions/setup/README.md

Lines 62 to 67 in cfcdd36

- uses: haskell/actions/setup@v2
with:
ghc-version: '8.8.4' # Exact version of ghc to use
# cabal-version: 'latest'. Omitted, but defaults to 'latest'
enable-stack: true
stack-version: 'latest'

@andreasabel
Copy link
Member

@Sorokin-Anton I am closing this issue, but feel free to reopen if my suggestion of enable-stack: true does not fix the OP.

I admit the API is awkward, so I opened this issue instead:

@andreasabel andreasabel closed this as not planned Won't fix, can't repro, duplicate, stale Dec 22, 2022
@andreasabel andreasabel self-assigned this Dec 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested re: stack Concerning CIs using stack
Projects
None yet
Development

No branches or pull requests

2 participants