setup-msys2 icon indicating copy to clipboard operation
setup-msys2 copied to clipboard

Compiler unable to find installed packages

Open newhoggy opened this issue 3 years ago • 3 comments

I'm getting new behaviour where the ghc the compiler we are using are unable to find installed packages where it used to be able to do so.

I have a work around for the problem, but feel that this should work out of the box with the work around.

I have documented my findings here: https://github.com/input-output-hk/cardano-node/issues/4614

The work around we are using is here: https://github.com/input-output-hk/cardano-node/pull/4590

I have raised this issue to start a conversation about what recent change might have occurred that would cause this change in behaviour and discuss if there are any options to make the work around unnecessary.

newhoggy avatar Nov 04 '22 14:11 newhoggy

If the program is running in msys2 shell it would not require to add paths manually.

Biswa96 avatar Nov 04 '22 14:11 Biswa96

Thanks for this tip!

This is curious. I have in my Github Actions workflow the following:

    defaults:
      run:
        shell: ${{ matrix.os == 'windows-latest' && 'msys2 {0}' || 'bash' }}

I didn't write this myself, but this used to work - but maybe it doesn't do what I hope it is meant to do?

The trouble I have is I'd like to write the steps in a way that works across platforms (Linux, MacOS Windows), but if I have to specify shell: msys2, this won't work for non-Windows OSes, which forces me to duplicate all my steps so they work between Windows and POXIS CIs.

Is there a way to toggle the shell globally depending on my CI matrix?

newhoggy avatar Nov 05 '22 01:11 newhoggy

@newhoggy you can use a "Params" job to generate outputs, to then be used in the matrix, which you can consume in the defaults.

For instance, in pyTooling/Actions:

  • icon, runs-on and shell are defined in: `https://github.com/pyTooling/Actions/blob/main/.github/workflows/Parameters.yml#L102-L107
  • Jobs are passed to a reusable workflow (you could skip this intermediate abstraction): https://github.com/pyTooling/Actions/blob/main/ExamplePipeline.yml#L46
  • Nevertheless, jobs is the expanded matrix, which is used as-is: https://github.com/pyTooling/Actions/blob/main/.github/workflows/UnitTesting.yml#L71
  • Fields runs-on, shell, etc. are consumed from the matrix:
    • https://github.com/pyTooling/Actions/blob/main/.github/workflows/UnitTesting.yml#L66
    • https://github.com/pyTooling/Actions/blob/main/.github/workflows/UnitTesting.yml#L75

umarcor avatar Nov 25 '22 13:11 umarcor