Skip to content

Conversation

@christomel
Copy link

Before this change scripts wrongly assume that bash resides at /bin/bash. This is not always the case and in fact is not mandated by POSIX. One example of a unix which does not have bash in /bin/bash is NixOS.

A workaround for this is to use /usr/bin/env bash, which is the standard way to get bash from user environment and works on a wider range of systems than /bin/bash

Therefore, this change replaces every /bin/bash with /usr/bin/env bash. Wherever /bin/bash took extra arguments, those arguments were moved out of line, because env interprets arguments as part of a program name.

Solves #2243

@odpbuild odpbuild changed the title [PATCH v1] scripts: make bash scripts more cross-platform [PATCH v2] scripts: make bash scripts more cross-platform Aug 7, 2025
@MatiasElo
Copy link
Collaborator

Seems like a good improvement, thanks! Please fix the commit author to make checkpatch happy and add my reviewed-by tag: Reviewed-by: Matias Elo <matias.elo@nokia.com>

Also, I'll send you a contributor agreement, which has to be signed before we can merge this PR.

Before this change scripts wrongly assume that `bash` resides at
`/bin/bash`. This is not always the case and in fact is not mandated by
POSIX. One example of a UNIX OS which does not have bash in `/bin/bash`
is NixOS.

A workaround for this is to use `/usr/bin/env bash`, which is a standard
way to get bash from user environment and works on a wider range of
systems than `/bin/bash`

Therefore, this change replaces every `/bin/bash` with `/usr/bin/env
bash`. Wherever `/bin/bash` took extra arguments, those arguments were
moved out of line, because `env` interprets arguments as part of a
program name

Signed-off-by: christomel <218936083+christomel@users.noreply.github.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
@odpbuild odpbuild changed the title [PATCH v2] scripts: make bash scripts more cross-platform [PATCH v3] scripts: make bash scripts more cross-platform Aug 9, 2025
@MatiasElo
Copy link
Collaborator

A small mixup. The signed-off-by tag (Signed-off-by: Christo Mel <christomel@protonmail.com>) was correct in the previous PR version, the issue was in git commit author.

@MatiasElo MatiasElo added the CLA Missing Developer needs to sign CLA before the PR can be merged. label Aug 29, 2025
@MatiasElo
Copy link
Collaborator

Ping @christomel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Missing Developer needs to sign CLA before the PR can be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants