Skip to content

Python info steps: switch bash -l to bash -e #341

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

Merged
merged 1 commit into from
Jun 9, 2023

Conversation

egpbos
Copy link
Member

@egpbos egpbos commented Jun 8, 2023

Fixes #219.

@egpbos egpbos requested review from jspaaks and sjvrijn June 8, 2023 13:15
@egpbos
Copy link
Member Author

egpbos commented Jun 8, 2023

The macOS log outputs show that the issue is fixed. If anyone wants to give this a LGTM, we can merge :)

Copy link
Contributor

@sjvrijn sjvrijn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No idea why it works, but it does work 👍

@egpbos
Copy link
Member Author

egpbos commented Jun 9, 2023

Good comment @sjvrijn, I should explain! Although I must admit I'm also not 100% sure. A couple of thoughts:

  1. The default shell mode in GitHub Actions is actually bash -e, see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell. Makes sense to me to just use the default when there's no reason not to.
  2. I'm not actually sure if we even need to specify the shell though, given that it's already the default...
  3. -l means open a login shell. I think (correct me if I'm wrong) the way GitHub Actions normally works is that you are basically running all steps in a workflow as sequential scripts from a single login session. In that session, environment variables and such have been set (e.g. for the Python environment). If you open a new login shell, those variables won't be around in that new login environment. The default way of running scripts is in non-login mode. That way, the environment of the login shell running the script is passed along. So removing the -l flag is actually the crucial part here.
  4. Why did it work for the Linux case though? No idea. 💀

@sjvrijn sjvrijn merged commit e572f10 into main Jun 9, 2023
@sjvrijn sjvrijn deleted the fix_219_python_info_macos branch May 3, 2024 22:56
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

Successfully merging this pull request may close these issues.

wrong python 3 version on mac
2 participants