-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Replace /bin/bash with /bin/sh #3809
Replace /bin/bash with /bin/sh #3809
Conversation
Some bash vs sh vs [etc] comments are noted at: http://stackoverflow.com/questions/5725296/difference-between-sh-and-bash |
I'm all for using sh vs bash, which would drop a dependency on some platforms, e.g. Alpine, FreeBSD, OpenBSD. |
One thing to note is that it is still required to run Since there were assumptions made that it was on MacOS and running an Ubuntu docker container, should we be concerned by the following lines? on_linux docker run \
--rm \
-u $(id -u) \
-v $(pwd):/mnt \
-w /mnt \
-e LIBRARY_PATH="/opt/crystal/embedded/lib/" \
-e CRYSTAL_CACHE_DIR="/tmp/crystal" \
"jhass/crystal-build-$ARCH" \
"$ARCH_CMD" /bin/bash -c "'$command'"
on_osx PATH="/usr/local/opt/llvm/bin:\$PATH" \
CRYSTAL_CACHE_DIR="/tmp/crystal" \
/bin/bash -c "'$command'" |
|
Let me clarify. I had concerns with us calling bash on the lines mentioned earlier if we're moving forward assuming bash isn't available on the target platform (linux, darwin, etc.). Should these be changed, or are we making the assumption that bash will always installed in the CI environment? |
We'll rework |
I thought similarly, but also considered that the build environment containing bash might open us up for testing removal of the dependency entirely. If we say it's not required and some deeply nested script calls it, we won't know in the CI tests but users who don't have it installed will see things explode. Personally, I view this as an acceptable risk. I just wanted to confirm that others viewed it similarly. |
#codetriage We appear to have left this conversation in agreement that Recommend for Merge, per 👍 in comments. |
Is there anything blocking this merge? I've reviewed this PR and it LGTM. |
Nothing blocking it! Thanks everyone, especially @TheLonelyGhost for crafting the PR, @ysbaddaden for providing feedback, @miketheman for taking the time to triage it and @RX14 for reviewing and nudging it ❤️ Sorry @miketheman for the horrible omission before :(. |
There were some bashisms left that became a bug since crystal-lang#3809
This also addresses idiosyncrasies with
echo
versusprintf
(see StackExchange answer about this).Since bash is a more fully-featured shell and
sh
(in Ubuntu, this is aliased to/bin/dash
) is lighter weight, it makes more sense to usesh
to run the realpath script in./bin/crystal
. I've benchmarked it on my system and there's a very slight increase in performance. It also, in part, reduces dependencies to run crystal.Changes were made to the escape sequence coloring to support more shells, also per StackExchange.