msys2 / setup-msys2

GitHub Action to setup MSYS2
https://github.com/marketplace/actions/setup-msys2
MIT License
285 stars 38 forks source link

Compiler unable to find installed packages #261

Open newhoggy opened 1 year ago

newhoggy commented 1 year ago

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.

Biswa96 commented 1 year ago

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

newhoggy commented 1 year ago

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?

umarcor commented 1 year ago

@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: