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

Don't use Bash case fallthrough #25

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Guiorgy
Copy link
Contributor

@Guiorgy Guiorgy commented Nov 21, 2024

The feature was added in Bash 4.0, however, according to @markaltmann, some Mac systems still use Bash 3.x

The feature was used only for expressiveness, the line using it is completely optional (since the case it falls through to is *, aka a catch all), thus it can be safely removed without changing the logic.

the feature was added in Bash 4.0, however, according to Mark Altmann, some Mac systems still use Bash 3.x
@markaltmann
Copy link

markaltmann commented Nov 21, 2024

More on that, all macos systems use this old bundled Bash from 2007.

Reason is apparently licensing issues with the DRM in Apples app store.

Version 3.2.57 was the last under GPL-2.

I have also now opted to another bash package and not use the bundled one, then you are with 5.2.

IMHO a shitty decision by Apple. The same is true for many bundled software like python or ruby.

@Guiorgy
Copy link
Contributor Author

Guiorgy commented Nov 21, 2024

@markaltmann Holy ****!

@BretFisher
Copy link
Owner

Would it be better to shift to just supporting sh, which AFAIK every OS but iOS and Windows has 😛 ?

Thanks for the all the work, I'm still catching up after KubeCon and now enjoying Thanksgiving in the US, so I hope to get to the PR reviewing in the next few weeks 🤜🤛

@Guiorgy
Copy link
Contributor Author

Guiorgy commented Nov 29, 2024

Would it be better to shift to just supporting sh, which AFAIK every OS but iOS and Windows has 😛 ?

Honestly, that has a few of it's own set of gachas:

  • According to this Ubuntu wiki page, $LINENO is not supported in dash, the default sh in Ubuntu. Though, the page is from 2017, so I don't know how accurate the statement is today, however, it remains that on older Ubuntu systems it might not work.
  • The pipefail option in set -Eeo pipefail is Bashism, so that would have to go, potentially having unforeseen consequences?

The case fallthrough is Bashism (>v4.0) so it will have to be removed if we switch to POSIX anyways.

From the top of my head, everything else seems to be POSIX compliant, so it might not be a bad choice.

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