msys2 / setup-msys2

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

'location' not honored? #288

Closed Lord-Kamina closed 1 year ago

Lord-Kamina commented 1 year ago

Hi. I've been using this action for a while, with very good results. However, in a recent workflow I needed to patch a header and am having issues due to a "file not found" error.

I'm breaking my head over this, and with debug mode I noticed that msys is being installed to a random temp directory, despite my explicitly specifying a location.

Is this a known issue? Am I doing something wrong? Did something change that made a previous behavior break?

My workflow has


      - name: Install MSYS2.
        uses: msys2/setup-msys2@v2
        with:
          msystem: MINGW64
          update: false
          location: ${{ github.workspace }}
          install: >-
            #A bunch of packages...

But, after erroring out and making a crude log to understand what is goin on, I see this:

      - name: Check folders
        shell: bash
        run: |
          touch ${{ env.workpath }}/log.log
          pwd >> ${{ env.workpath }}/log.log
          ls -l ./ >> ${{ env.workpath }}/log.log
          ls -l ../ >> ${{ env.workpath }}/log.log
          ls -l ../.. >> ${{ env.workpath }}/log.log

Outputs:

/d/a/gdb-win/gdb-win total 38 -rw-r--r-- 1 runneradmin 197121 35823 Mar 14 17:27 LICENSE -rw-r--r-- 1 runneradmin 197121 494 Mar 14 17:27 enable-gmp-static.diff -rw-r--r-- 1 runneradmin 197121 21 Mar 14 17:27 log.log total 4 drwxr-xr-x 1 runneradmin 197121 0 Mar 14 17:27 gdb-win total 4 drwxr-xr-x 1 runneradmin 197121 0 Mar 14 17:25 _PipelineMapping drwxr-xr-x 1 runneradmin 197121 0 Mar 14 17:25 _actions drwxr-xr-x 1 runneradmin 197121 0 Mar 14 17:27 _temp drwxr-xr-x 1 runneradmin 197121 0 Mar 14 17:25 gdb-win

EDIT: Most importantly, the GA debug output says:

  shell: D:\a\_temp\setup-msys2\msys2.CMD {0}
  env:
    workpath: D:/a/gdb-win/gdb-win
    MSYSTEM: MINGW64
lazka commented 1 year ago

hm, could it be that you are using the checkout action afterwards which clears that location again?

lazka commented 1 year ago

ah, you posted a followup. hm, not idea from the top of my head.

lazka commented 1 year ago

The msys2.CMD is always written to a temp dir, so that's not an indication of the location.

Lord-Kamina commented 1 year ago

Actually yes, though, there is a checkout step afterwards. I'll try changing that and report back. Also, the checkout clears everything just like that? jeez.

Lord-Kamina commented 1 year ago

The msys2.CMD is always written to a temp dir, so that's not an indication of the location.

Ah, ok.

Anyway... I've confirmed that was the issue now. Thanks for the help!

lazka commented 1 year ago

ok, thanks for checking back.