-
-
Notifications
You must be signed in to change notification settings - Fork 540
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
fix: Make hooks bash 3.2 compatible #339
Conversation
ℹ️ IMHO: we EITHER officially declare support for Bash 3 and hence test every change using Bash 3 as well as modern Bash OR we set Bash >= 4 as a requirement for |
@yermulnik I agree that toil is bad here but I am also not sure how hard it is for users to install Bash 4+ on various systems where |
48bc03c
to
42d04a1
Compare
@antonbabenko From my knowledge it's either very old and outdated version of existing distros, or MacOS only. The latter has at least four more or less easy and more or less user friendly and/or widely used ways to upgrade to a modern version of Bash. If we'd support outdated version of Bash for only one "brand" of OS, someone may also ask us to provide support for e.g. non-Bash shells (there are a plenty of and |
Also those systems which lack modern Bash (and any other tool used by |
@yermulnik That isn't going to scale well in organizations where not everyone has Docker installed. I understand the sentiment not wanting to have to support old versions of bash. However, this should be introduced as a breaking change. We have hundreds of projects using these hooks and to all of the sudden now require them to install an updated version of bash (and hope they got it right) is a big burden. |
(apologies for long-read)
It is not about the number of projects, but about the number of engineers. And yep, I fully agree such a change should have been announced in advance along with proper semantic versioning for changes with backward incompatibility. As I already stated before, my personal opinion (I'm not founder or owner, I'm collaborator) is we either revisit this entire repo and convert it to become fully POSIX-compliant so that we rely upon ps: one of the main reasons against bash3 support would be the need to maintain and test every single change and release with bash3 which is not impossible, but, you know, «That isn't going to scale well in organizations where not everyone has Docker installed» — I see Docker as the only sensible approach to run bash3 w/o littering our workstations with ancient software and quirks to temporarily fool local environment about which bash version should come up via |
@antonbabenko let's fix breaking changes introduced in v1.63 for some Mac users, by merging that PR. @yermulnik could you please check in a week, how much effort need to make code POSIX-compatible? |
Do we have any plans to switch to What's needed to make code compatible with Bash v3 I (by a surprising coincident) already described in #337 (comment) today 😃 Let me know if that's what you mean.
That's definitely the way to go w/o any constraints: we should drop support of ancient Bash in whichever major release of |
If it is not too difficult - why not |
This may make sense, btw. Though we need to inspect our code and ensure it complies to POSIX standard and rip off any bashisms including those that belong to bash 3. |
## [1.64.1](v1.64.0...v1.64.1) (2022-03-31) ### Bug Fixes * Make hooks bash 3.2 compatible ([#339](#339)) ([4ad825d](4ad825d))
This PR is included in version 1.64.1 🎉 |
…sues with Macos (related to pre-commit-terraform issue: antonbabenko/pre-commit-terraform#339)
Put an
x
into the box if that apply:Description of your changes
In new versions, macOS use
zsh
by default and include bash 3.2 for compatibility reasons.That OS will never upgrade bash to 4+, during license issues.
theverge.com/2019/6/4/18651872/apple-macos-catalina-zsh-bash-shell-replacement-features
So looks like we need to maintain compatibility with bash 3.2 🙄
Or require bash 4.2+ as deps.
Fixes #337
How can we test changes
Run on macOS: