Git Product home page Git Product logo

Comments (11)

lazka avatar lazka commented on June 12, 2024 1

This was already reported here actions/runner#353

I think that's a similar but unrelated issue. It is about getting a different behaviour when not setting shell or when setting it to bash. In our case, we don't use any of them, neither the default nor bash. Our entrypoint is msys2.cmd.

Yeah, unrelated, I just wanted to suggest at first that we should mirror what bash does in GHA ideally, but turned out that it wasn't that clear...

from setup-msys2.

lazka avatar lazka commented on June 12, 2024 1

yes!

from setup-msys2.

lazka avatar lazka commented on June 12, 2024

(It's documented as set -e o pipefail here https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference but it doesn't look like that's true)

This was already reported here actions/runner#353

from setup-msys2.

eine avatar eine commented on June 12, 2024

I'm not sure I understand the context... Your concern is legit, and I agree. But, please, let me elaborate:

  • Commands executed through this Action's msys2 {0} are called with bash --norc -ilceo pipefail (see https://github.com/msys2/setup-msys2/blob/master/main.js#L74). Hence, regardless of the default setup of the shells provided by GitHub, the behaviour of the Action should be as expected.
  • If users set -e in their scripts, the behaviour is the expected.

I wrote multiple tests in a fork of your demo (https://github.com/eine/msys2-workflow-error-test/blob/master/.github/workflows/main.yml), but I reached no conclusive solution:

Might this issue be related to this warning https://github.com/eine/msys2-workflow-error-test/runs/866200165?check_suite_focus=true#step:4:9 ?

from setup-msys2.

eine avatar eine commented on June 12, 2024

This was already reported here actions/runner#353

I think that's a similar but unrelated issue. It is about getting a different behaviour when not setting shell or when setting it to bash. In our case, we don't use any of them, neither the default nor bash. Our entrypoint is msys2.cmd.

from setup-msys2.

lazka avatar lazka commented on June 12, 2024

Doesn't it pass a file there? That would mean a new shell.

I'll try some things...

from setup-msys2.

eine avatar eine commented on June 12, 2024

My understanding is that run: anything is passed raw. That's why run: anything && anyotherthing and such might fail. However, the content of run: | is saved to some temporal location and passed as a file. See numworks/setup-msys2#22.

Might be worth trying run: fail; echo "ok";?

from setup-msys2.

eine avatar eine commented on June 12, 2024

Doesn't it pass a file there? That would mean a new shell.

Oh, I see what you mean. If run: |, https://github.com/msys2/setup-msys2/blob/master/main.js#L74 might need to be:

drive + `\\msys64\\usr\\bin\\env.exe /usr/bin/bash --norc -ilceo pipefail "cd $OLDPWD && bash -e %args%"`

or something similar.

from setup-msys2.

lazka avatar lazka commented on June 12, 2024

I think I have something, I'll create a PR later

from setup-msys2.

lazka avatar lazka commented on June 12, 2024

oh, meh, it gets used to run scripts and binary files (like to "go env" example). No idea how to fix that without breaking things.

from setup-msys2.

eine avatar eine commented on June 12, 2024

@laxka, I guess this is fixed, now that #44 is merged, isn't it?

from setup-msys2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.