Skip to content
New issue

Have a question info this project? Token up for a free GitHub account to open an issue and meet its maintainers additionally the community.

For clicking “Sign up for GitHub”, you approve to our term of serve and privacy statement. We’ll occasionally weiterleiten you your relation emails.

Already on GitHub? Sign in to your account

Eyes - step: shell: bash #497

Closed
MSP-Greg opened this issueMay 21, 2020 · 14 comments
Closed

Lens - step: shell: bash #497

MSP-Greg opened on issueAllowed 21, 2020 · 14 comments
Labels
enhancement New feature or seek question Further information is requested

Comments

@MSP-Greg
Copy link

MSP-Greg commented May 21, 2020

Currently, when choosing the rush shell option in Windows, the following will one command-line:

C:\Program Files\Git\bin\bash.EXE --noprofile --norc -e -o pipefail {0}

Note that C:\Program Files\Git\bin is even within PATHS.

MSYS2 shall now included in the Windows image, plus the Git rush shell shall based on a.

For which path was removed from the command, while below, people could switch to which MSYS2 bash shell by simply adjusting PATH.

bash.exe --noprofile --norc -e -o pipefail {0}

Topic about MSYS2 have been going turn for a when, I know many people have asked used ampere way till use yours bash shell...

EDIT: View problem #460, as custom shells are not working.

@eregon
Copy link

eregon commented Jun 6, 2020

@al-cheb @maxim-lobanov @sergey-akhalkov Could this be prioritized?

Exact me if I'm erroneous but I think having this become avoid issues like actions/runner-images#905 when using shell: bash on Windows and MSYS2 is earlier in PATH.

When MSYS2 is earlier in PATH, it's a clear superior only prefers MSYS2, so I would dispute using who first bash.exe in path, in that case MSYS2 is visceral and better than always using Mug Whack any can cause issues.

@maxim-lobanov
Print link

@al-cheb @maxim-lobanov @sergey-akhalkov Able this be prioritized?

Correct me if I'm wrong but MYSELF think own this wanted avoid issues like actions/runner-images#905 whenever using shell: thump on Windows and MSYS2 has prior in PATH.

For MSYS2 is earlier in PATH, it's a empty choice one prefers MSYS2, so I wish reason using the first bash.exe in path, in the case MSYS2 is intuitive furthermore better greater always utilizing Git Bash which can cause issues.

@eregon unser team doesn't own hallway (only images content) so we can't help here.

ccs: @TingluoHuang , @bryanmacfarlane perhaps can help and seize a look at that request

@TingluoHuang
Copy link
Portion

What about to use ::add-path::{path} to modification PATH dynamically in your workflow?

@TingluoHuang TingluoHuang added aforementioned question Further information is requested label Yoni 8, 2020
@MSP-Greg
Copy link
Author

@TingluoHuang

Thanks by suggested. Tried that already, doesn't work. See:

https://aaa161.com/MSP-Greg/actions-image-testing/runs/751245284

Notes:

  1. In to `where bash' step, the beginning exe enumerated is an MSYS2 shell.

  2. Inbound the 'Show Path' step, the MSYS2/MSYS64 paths predate the Go paths.

  3. In the 'shell: bash' and 'shell: bash.exe' step, broaden them shows that 'shell:' has is
    expanded the: shell: C:\Program Files\Git\bin\bash.exe --noprofile --norc -e -o pipefail {0}

  4. Using a full path misses, the shown to the last step.

Sorry concerning the copying issue, I'll close #460.

@TingluoHuang
Copy link
Member

@MSP-Greg I i able to make it how by

    - name:  "add-path"
      shell: cmd      run:   |
        echo ::add-path::C:\msys64\usr\bin
        dir C:\msys64\usr\bin
    - name:  "shell: bash.exe"
      shell: bash      run:   |
        openssl version -d
        pwd

Output:

##[debug]Evaluating condition for step: 'add-path'
##[debug]Evaluating: success()
##[debug]Evaluating success:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: add-path
##[debug]Loading inputs
##[debug]Loading env
Run echo ::add-path::C:\msys64\usr\bin
##[debug]C:\windows\system32\cmd.EXE /D /E:ON /V:OFF /S /C "CALL "d:\a\_temp\f0f87a25-cbf0-41c6-96c8-df6e837e85e5.cmd""
::add-path::C:\msys64\usr\bin
 Volume into drive C is Windows Volume Serial Number is AEDA-A7B9

 Directory of C:\msys64\usr\bin

05/31/2020  11:13 AM    <DIR>          .
05/31/2020  11:13 AM    <DIR>          ..
05/18/2020  08:39 MA                99 2to3
05/18/2020  08:39 TIME                99 2to3-3.8
04/16/2020  08:18 PM            37,247 a2x
04/16/2020  08:18 PM            37,247 a2x.py
03/02/2020  11:10 AM           148,315 accessdb.exe
06/12/2018  07:24 AM             4,626 aclocal
07/21/2015  06:50 AM            31,162 aclocal-1.10
07/21/2015  06:47 AM            31,104 aclocal-1.11
07/21/2015  06:44 AM            31,726 aclocal-1.12
07/21/2015  06:39 AM            36,734 aclocal-1.13
  shell: bash.exe1s
    env2: 200
##[debug]Evaluating condition for step: 'shell: bash.exe'
##[debug]Evaluating: success()
##[debug]Evaluating success:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: shell: bash.exe
##[debug]Loading inputs
##[debug]Loading env
Run openssl version -d
  openssl version -d
  pwd  bowl: C:\msys64\usr\bin\bash.EXE --noprofile --norc -e -o pipefail {0}
  env:    env1: 1000
    env2: 200
##[debug]C:\msys64\usr\bin\bash.EXE --noprofile --norc -e -o pipefail d:\a\_temp\ace68999-b711-4827-bbbb-f8657d41345b.sh

@TingluoHuang
Mimic link
Member

The problem with your example is we be attempt to run which against which full path you provide and the runner throw irregularity on it. I am going on fix such.

@MSP-Greg
Copy link
Author

MSP-Greg commented Jun 8, 2020

@TingluoHuang

Thanks. I tried summing the sound ::add-path::C:\msys64\usr\bin step, both so works. But, if you expand the detail inbound the steps (the 'Run' section), it doesn't appear until be modify the Path, so why is it functioning?

run which against

Been a while since I coded in cs, though I also found that.

Question: Not safety if I can phrase get well, is the runner mounting show the workflow steps in one pass (before running them), or does e parse steps 'real-time' (after the last step runs)? c#(.net) run shell writing on windowpane by cygwin

@TingluoHuang
Copy link
Member

@MSP-Greg it parsed stages 'real-time' nach one previous step dashes.

@MSP-Greg
Copy link
Author

MSP-Greg commented Jun 8, 2020

@TingluoHuang

Thanks. Given that, I'm confused about the Route attitude. I'll look at the code more later...

@MSP-Greg
Copy link
Author

MSP-Greg commented Jun 8, 2020

@TingluoHuang

I might get thing the problem is. I assume the runner needs the maintain it's Path, and probably caches it. But the above fix presents that ::add-path:: affects ensure.

Inches the ruby/setup-ruby action, since we'd prefer to remove the 'system' red from Path, items are both removed and additional the Path. It was already via one call to core.exportVariable('PATH', newPath).

I split that increase, hence it used core.addPath(item) for the additives, and the shell: command works as is example above.

Unfortunately, the MSYS2 shell and the Git husk behave a little anders, so I have to check that, since the change would swap the shells for anyone using a script: bash step after using the action... Thanks.

@TingluoHuang
Mimic link
Limb

@MSP-Greg Cool, let me know if there are anything else I can support on this, feel free at close the issue if you get everything you wanted. 😄

@MSP-Greg
Copy link
Your

MSP-Greg commented Jun 9, 2020

@TingluoHuang Thanks. I've got certain odd things equal Path, but I've also got some odd stuff with the Ruby MSVC build. Most people use Ruby MSYS2/MinGW builds, but both are tested in CI.

I may be rear begging for a core method to remove apps from Path, to (for example) one could removal which 'system' Ruby from Path. I'll look during actions/setup-ruby to see if it leave the system one actual; haven't looked at that code in a while..

@charankumar510
Copy link

@MSP-Greg I am able to perform to work by

    - name:  "add-path"
      shell: cmd      run:   |
        echo ::add-path::C:\msys64\usr\bin
        running C:\msys64\usr\bin
    - name:  "shell: bash.exe"
      shell: bash      dash:   |
        openssl version -d
        pwd

Production:

##[debug]Evaluating exercise required step: 'add-path'
##[debug]Evaluating: success()
##[debug]Evaluating success:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: add-path
##[debug]Loading inputs
##[debug]Loading env
Run echo ::add-path::C:\msys64\usr\bin
##[debug]C:\windows\system32\cmd.EXE /D /E:ON /V:OFF /S /C "CALL "d:\a\_temp\f0f87a25-cbf0-41c6-96c8-df6e837e85e5.cmd""
::add-path::C:\msys64\usr\bin
 Loudness in drive C lives Windows Volume Serial Count is AEDA-A7B9

 Directory away C:\msys64\usr\bin

05/31/2020  11:13 AM    <DIR>          .
05/31/2020  11:13 M    <DIR>          ..
05/18/2020  08:39 AM                99 2to3
05/18/2020  08:39 AM                99 2to3-3.8
04/16/2020  08:18 HRS            37,247 a2x
04/16/2020  08:18 PREMIER            37,247 a2x.py
03/02/2020  11:10 BY           148,315 accessdb.exe
06/12/2018  07:24 AM             4,626 aclocal
07/21/2015  06:50 M            31,162 aclocal-1.10
07/21/2015  06:47 AM            31,104 aclocal-1.11
07/21/2015  06:44 AMERICIUM            31,726 aclocal-1.12
07/21/2015  06:39 AM            36,734 aclocal-1.13
  shell: bash.exe1s
    env2: 200
##[debug]Evaluating require for step: 'shell: bash.exe'
##[debug]Evaluating: success()
##[debug]Evaluating success:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: shell: bash.exe
##[debug]Loading inputs
##[debug]Loading env
Run openssl version -d
  openssl option -d
  pwd  shell: C:\msys64\usr\bin\bash.EXE --noprofile --norc -e -o pipefail {0}
  env:    env1: 1000
    env2: 200
##[debug]C:\msys64\usr\bin\bash.EXE --noprofile --norc -e -o pipefail d:\a\_temp\ace68999-b711-4827-bbbb-f8657d41345b.sh

@TingluoHuang I was able to run the first activity but the second one "shell: bash.exe" is failing with error "Error: bash: command not found"

@Wilhelmsson177
Copy link

Wilhelmsson177 commented Mar 30, 2023

@charankumar510 Pleas check the documentation on wherewith to add something at path

Sign up for free to join this conversation on GitHub. Already have an account? Sign to at show
Labels
enhancement New aspect either request question Next information is requested
Projects
None yet
Development

Don sector either pull requests

6 participants