-
Notifications
You must be signed in to change notification settings - Fork 18k
make.bash: drop bash as a build dependency #41698
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
Comments
Would this solve any actual problem? I don't think I've ever seen anyone complaining about |
In practice we can only do this if there is some way to write a test to ensure that we never regress back to using bash-isms. I don't know how to write such a test but perhaps there is some way. (I also agree that I don't see why this is a problem in practice.) |
This can be checked easily using shellcheck https://github.com/koalaman/shellcheck, or chechbashisms https://linux.die.net/man/1/checkbashisms. The former has the additional benefit of detecting common errors in the shell script. Of course, it then means you have a dependency on one of those tools in stead of bash, which may not be an improvement. |
What’s the driver for this? The resource usage of various shells compared to the 1.3gb of ram needed to compile some of the internal packages in the compiler. |
While I generally agree that it's nice to be portable, I also don't see why Bash would be a problem today if it hasn't been a problem for the past decade. There are also a dozen other bash scripts scattered across the repository, such as |
A heads up for others wanting to contribute to this thread; it's very unlikely that the author will actually provide any more information here, see #41739 (comment). Unless you support this change, it's probably not worth your time to reply. |
I actually support this change together with introducing shellcheck, but seeing that this has been working as is for years, and that there are more urgent priorities, I don't mind if this issue is postponed or closed either. |
Just had my first experience with Go, which was nice. The one thing that surprised me a little bit was that bash was required to build. On OpenBSD the standard shell is a hardened ksh. bash is avoided everywhere in base so I had to install that, no biggie, but the question I would phrase in the spirit of portability and reducing dependencies is "why require more if technically all you need is POSIX shell"? I'm wondering if such a change would be desirable, aside from the question who's going to make it happen. |
I don't think the suggested change is very important but I think it would be fine if someone wants to work on it and has some way to prevent backsliding. (I don't think the packages mentioned above are going to be useful in that regard--we certainly don't want the Go build to depend on them: that would be worse than depending on bash. But if someone can come up with a workable approach, great.) |
Patch that allows building go without bash - https://github.com/kisslinux/community/blob/d99595e575a471698032dbad0cd2c9977d6b0c79/community/go/patches/posix-build.patch . As you see, there is no huge dependency on bash and everything can be implemented in POSIX shell |
Thanks. Now, how do we prevent backsliding? |
Perhaps a test runner that runs shellcheck or checkbashisms? This is more
of a test, and less a build requirement.
Op wo 14 okt. 2020 20:29 schreef Ian Lance Taylor <[email protected]
…:
Thanks. Now, how do we prevent backsliding?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#41698 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAARM6PDQCMVBUXIPKAJQL3SKXUYDANCNFSM4R6FPBSQ>
.
|
One CI/CD host that isn't Linux |
Note that some shells implement common bashisms; dash implements == in test(iirc), for instance. The most reliable method would be checkbashisms or shellcheck. |
FWIW, I've started a separate discussion to get some feedback from a community I'm familiar with, in order to prevent being a loud and chatty newbie overhere before getting to the point. ;-) For anyone interested: https://lobste.rs/s/lzc7ac/make_bash_drop_bash_as_build_dependency |
Duplicate of #3235 |
Timed out in state WaitingForInfo. Closing. (I am just a bot, though. Please speak up if this is a mistake or you have the requested information.) |
The bash build scripts can be rewritten in terms of pure POSIX sh, simplifying the bootstrap development environment.
The text was updated successfully, but these errors were encountered: