Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No error checking when bindep fails #2

Open
andy-maier opened this issue Jun 5, 2024 · 0 comments
Open

No error checking when bindep fails #2

andy-maier opened this issue Jun 5, 2024 · 0 comments

Comments

@andy-maier
Copy link

andy-maier commented Jun 5, 2024

When bindep fails, the commands in action.yml ignore the error. For example, I had this issue with bindep which currently fails when the platform profile for Windows is specified in the bindep.txt file:

Run re-actors/bindep@release/v1
Run echo ::group::Reading the deps for 'test' from 'bindep.txt'...
Reading the deps for test from bindep.txt...
  +++ pipx run bindep -b -f bindep.txt test
  Found a space in the home path. We heavily discourage this, due to multiple
      incompatibilities. Please check our docs for more information on this, as
      well as some pointers on how to migrate to a different home path.
  creating virtual environment...
  installing bindep...
  Traceback (most recent call last):
    File "C:\hostedtoolcache\windows\Python\3.9.13\x64\lib\runpy.py", line 197, in _run_module_as_main
      return _run_code(code, main_globals, None,
    File "C:\hostedtoolcache\windows\Python\3.9.13\x64\lib\runpy.py", line 87, in _run_code
      exec(code, run_globals)
    File "C:\Program Files (x86)\pipx\.cache\9314c93fc63b7de\Scripts\bindep.exe\__main__.py", line 7, in <module>
    File "C:\Program Files (x86)\pipx\.cache\9314c93fc63b7de\lib\site-packages\bindep\__main__.py", line 56, in main
      depends = bindep.depends.get_depends(
    File "C:\Program Files (x86)\pipx\.cache\9314c93fc63b7de\lib\site-packages\bindep\depends.py", line 74, in get_depends
      return Depends(fd.read(), filename)
    File "C:\Program Files (x86)\pipx\.cache\9314c93fc63b7de\lib\site-packages\bindep\depends.py", line 147, in __init__
      self._rules = parser.rules()
    File "C:\Program Files (x86)\pipx\.cache\9314c93fc63b7de\lib\site-packages\parsley.py", line 98, in invokeRule
      raise err
  ometa.runtime.ParseError: 
  grep [platform:msys_nt-10.0-20348 test]
                      ^
  Parse error at line 16, column 20: expected EOF. trail: [selector]

After encountering this error, the action.yml commands continue and the action succeeds without having done what it should be doing.

The missing error check is here:

      PKGS=$( \
        echo $( \
          pipx run bindep \
            -b \
            -f '${{ inputs.file }}' \
            ${{ inputs.profile }} \
        ) \
      )

A possible solution would be to remove the extra echo $(). It is not needed in order to get the command output into PKGS and it zeroizes the exit code of the "pipx run bindep" command.

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant