-
Notifications
You must be signed in to change notification settings - Fork 254
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
[BUG] shell interpreter hardcode #!/bin/bash
update to #!/usr/bin/env bash
.
#1780
Comments
I agree we shouldn't be assuming /bin/bash. A potentially trickier problem is that we should also assume as little as possible about the capabilities of the shell -- no bash-specific features. |
Thanks @jfgoog :-)
|
I did some work very related to this, which I haven't been able to finish: https://android-review.googlesource.com/c/platform/ndk/+/2249853 As I recall, there weren't any major problems when I essentially replaced "bash" with "sh". There's also this reference in external/shaderc/glslang that might need to be fixed upstream: |
|
The NDK repo is all open source. You can try building your own, but it's probably never been tried on FreeBSD, and I would be very surprised if it worked. Instructions are at https://android.googlesource.com/platform/ndk/+/refs/heads/master/docs/Building.md |
Thanks, I saw that, but what is Update: Okay these are Google helper scripts [1], I will probably want to add them to FreeBSD ports or add them to a local user account :-) |
In this
|
[1] https://android.googlesource.com/platform/ndk/+/refs/heads/master/docs/Building.md |
|
To be blunt (and I know you won't like this answer, but I think you'd like being led on even less): we will not be spending engineering time supporting BSD (unless you count macOS). We have staggeringly more users on Windows, macOS, and even Linux that we'd have to deprioritize to support (each) BSD. We'll accept patches for low-cost portability improvements (such as the one in the title of this bug), but won't be accepting anything that adds to our maintenance burden or misleads users (such as ndk-build claiming support for OSs which we don't support). If we're not able to fund BSD support (and we are not), anyone that's hoping to ship something is going to have a better time doing so from a supported platform than trying to muddle through the bugs that can and will arise from using an unsupported path. With infinite resources, sure, we'd do this. We don't have that though so we have to pick our battles. We are not the people that own |
Hey there @DanAlbert :-)
|
Yes, this is the place to report bugs. No, it is not the place to send patches. The readme links our docs which will tell you how to send patches that we can merge.
For NDK bugs, yes, but like I said, we don't work on |
Thanks @DanAlbert for accepting one of my first patches at Google Gerrit, I will send further propositions directly over there.. I assume that would be the preferred way of propositions / discussions? :-) |
@jfgoog are you also on the Google Gerrit? I can see some |
If you have a patch to send, yeah, just send patches. If you have a discussion that isn't about a specific code change, the discussions tab here is the right place. If you have bugs to report, that's this. |
ACK! :-) |
Thanks for accepting the patch into upstream @DanAlbert :-) |
Description
#!/bin/bash
shell script interpreter is a Linux only syntax because Linux does not distinguish between/bin/sh
and/bin/bash
(/bin/sh
is/bin/bash
).#!/usr/bin/env bash
because bash may not be part of the system or it may be installed in the userland (i.e./usr/local/bin/bash
).#!/bin/bash
hardcode will work only on Linux, but not Unix (i.e. BSD).Why I got here? Because Google does not release Android-NDK for FreeBSD. But FreeBSD can natively emulate Linux ELF, so tools for Linux can also work on FreeBSD.. unless they have Linux-only hardcodes. Please fix :-)
This problem is in the source code for a long time, and it is still in the master, for instance:
https://android.googlesource.com/a/platform/ndk/+/refs/heads/master/build/tools/ndk_bin_common.sh
Affected versions
r25, Canary
Canary version
270076ca936ed0dca16de84e302dde296aaf1ca4
Host OS
Linux
Host OS version
FreeBSD 13-STABLE
Affected ABIs
armeabi-v7a, arm64-v8a, x86, x86_64
Build system
ndk-build
Other build system
No response
minSdkVersion
20
Device API level
21
The text was updated successfully, but these errors were encountered: