You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] If there are spaces in ANDROID_SDK_ROOT, ndk-build will not work. #1400
I doubt this is something that will ever work reliably, FYI. This is extremely difficult to do correctly in a make based system, especially one like ours which makes heavy use of eval (you need to escape variables differently depending on how deep it will be used in a callstack).
We should probably emit a warning if the NDK is installed to such a path. We already do that when the source is in a path that contains spaces, but we don't check the NDK itself I guess.
We should also squash this particular case, but I suspect we'll regress.
Thanks! I tried the same thing you did (quote the thing in ndk-build.cmd) and ran into the same problem (that's insufficient). The fix you ended up merging makes sense to me.
make can't catch the second case on windows. $(lastword $(MAKEFILE_LIST)) when the NDK's install directory is android-ndk-r25c with spaces is spaces\build\..\build\core\build-local.mk. ndk-build.cmd already passes a quoted path to make, so that really is just make being different on Windows (a bug, but not one I care to chase).
This, in case it wasn't clear, is a pretty big blocker for us ever doing better at this. Still probably less problematic than eval, but it's an early enough blocker that I don't think it's even worth trying.
Activity
DanAlbert commentedon Dec 14, 2020
I doubt this is something that will ever work reliably, FYI. This is extremely difficult to do correctly in a make based system, especially one like ours which makes heavy use of
eval(you need to escape variables differently depending on how deep it will be used in a callstack).We should probably emit a warning if the NDK is installed to such a path. We already do that when the source is in a path that contains spaces, but we don't check the NDK itself I guess.
We should also squash this particular case, but I suspect we'll regress.
DanAlbert commentedon Apr 20, 2023
Apparently this is already forbidden: https://android.googlesource.com/platform/ndk/+/refs/heads/master/build/ndk-build#53 and https://android.googlesource.com/platform/ndk/+/refs/heads/master/build/core/build-local.mk#43. The former of course isn't used on Windows, but the latter doesn't appear to work there either. Your GHA log has unfortunately been culled, so I have no idea what the original report was, but this does seem quite broken on Windows.
vvb2060 commentedon Apr 20, 2023
actions/runner-images#1122 (comment)
DanAlbert commentedon Apr 20, 2023
Adding this seems to be the way to catch the problem (will upload a patch in a moment):
DanAlbert commentedon Apr 20, 2023
Thanks! I tried the same thing you did (quote the thing in ndk-build.cmd) and ran into the same problem (that's insufficient). The fix you ended up merging makes sense to me.
make can't catch the second case on windows.
$(lastword $(MAKEFILE_LIST))when the NDK's install directory isandroid-ndk-r25c with spacesisspaces\build\..\build\core\build-local.mk. ndk-build.cmd already passes a quoted path to make, so that really is just make being different on Windows (a bug, but not one I care to chase).DanAlbert commentedon Apr 20, 2023
https://android-review.googlesource.com/c/platform/ndk/+/2552855 and https://android-review.googlesource.com/c/platform/ndk/+/2552856
DanAlbert commentedon Apr 20, 2023
This, in case it wasn't clear, is a pretty big blocker for us ever doing better at this. Still probably less problematic than
eval, but it's an early enough blocker that I don't think it's even worth trying.Check for paths with spaces in ndk-build.cmd.