openssl / openssl

TLS/SSL and crypto library
https://www.openssl.org
Apache License 2.0
25.6k stars 10.09k forks source link

Android configuration depends on the order of elements in the PATH variable #18475

Open NPellet opened 2 years ago

NPellet commented 2 years ago

Checking out this configuration line here:

https://github.com/openssl/openssl/blob/479b9adb88b9050186c1e9fc94879906f378b14b/Configurations/15-android.conf#L106

clearly shows that whether

PATH=/.../android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin

(toolchain path at the beginning)

or

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/.../android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/

(toolchain path at the end)

Makes a huge difference in the way the toolchain if resolved. I've got no experience in toolchains, but is this really how it should be ?

The documentation is correct (https://github.com/openssl/openssl/blob/master/NOTES-ANDROID.md?plain=1#L41) in the sense that it specifies properly how the path should be set, yet I'm so used to writing export PATH=$PATH:... that I didn't really pay attention to the path order and definitely didn't expect it to play any role.

Should this be either changed or at least documented with some warning ?

(Sorry I realize I probably didn't classify this properly. It's not really a feature request)

t8m commented 2 years ago

It the ANDROID NDK contains binaries that potentially name clash with system tools then it is kind of obvious that path to the NDK must be at the beginning of the PATH and not at the end, otherwise the system tools will be invoked instead of the ANDROID NDK binaries.

nhorman commented 4 months ago

marking as inactive, to be closed at the end of 3.4 dev barring further input