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

Standardise bash shebang #458

Merged
merged 1 commit into from
Jul 22, 2024
Merged

Conversation

alcaeus
Copy link
Contributor

@alcaeus alcaeus commented Jul 22, 2024

Related to DRIVERS-2852

The GitHub Action does not explicitly use a shell when calling run-orchestration.sh, but instead relies on the shebang to choose the appropriate shell. This causes warnings when running the action:

/home/runner/work/drivers-evergreen-tools/drivers-evergreen-tools/.//.evergreen/run-orchestration.sh: 23: /home/runner/work/drivers-evergreen-tools/drivers-evergreen-tools/.//.evergreen/handle-paths.sh: [[: not found
/home/runner/work/drivers-evergreen-tools/drivers-evergreen-tools/.//.evergreen/run-orchestration.sh: 40: /home/runner/work/drivers-evergreen-tools/drivers-evergreen-tools/.//.evergreen/handle-paths.sh: [[: not found
/home/runner/work/drivers-evergreen-tools/drivers-evergreen-tools/.//.evergreen/run-orchestration.sh: 59: /home/runner/work/drivers-evergreen-tools/drivers-evergreen-tools/.//.evergreen/handle-paths.sh: [[: not found

This PR changes all shebangs to use /usr/bin/env bash, so that any invocations of scripts that do not explicitly use sh (as is the case in some evergreen configs) use bash. This removes warnings above.

Note that any drivers that have not yet completed DRIVERS-2852 (currently C, C++, Node, Ruby, Rust) might see changes in behaviour on Evergreen if they do not use an explicit shell when invoking run-orchestration.sh or any other script changed here. I don't think there are any negative side-effects to this, but wanted to point it out.

Testing

To test this PR, change the uses key in the GitHub Action Workflow using this action to the following, then run the workflow:

uses: alcaeus/drivers-evergreen-tools@use-bash-shebang

A green build with no warnings indicates that this PR does what it's supposed to do.

@alcaeus alcaeus requested review from jamis and blink1073 July 22, 2024 07:41
Copy link
Member

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

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

LGTM!

@alcaeus alcaeus merged commit 1fa0a27 into mongodb-labs:master Jul 22, 2024
22 of 24 checks passed
@alcaeus alcaeus deleted the use-bash-shebang branch July 22, 2024 15:03
adriandole pushed a commit to adriandole/drivers-evergreen-tools that referenced this pull request Oct 7, 2024
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.

3 participants