-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
[Investigate] Android SDK/NDK will be moved to root folder (C:\) on Windows #1122
Comments
Adding 1 week to target date to give more space for proper validation. |
After multiple discussions we decided not to make this change in the near future since the possible impact is unpredictable. |
@AlenaSviridenko We are still facing this issue, see the linked PR and one of our failed runs. It's worked around by setting up a symlink from a folder without spaces (the inverse of #1077) and overriding environment variables which is far from ideal. Are there any plans to resurrect and land this fix? |
Hey @MarijnS95, It would be much appreciated if you could post your workaround in case if anyone else will have this issue in future. |
That's unfortunate, from what I have seen most scripts still pull in the SDK/NDK by hand without knowing these are already available in GH images which is a likely cause for the absence of reports. Or efforts to switch to this resulted in the same error, without time available to investigate a fix or workaround. I want to reiterate again that the NDK is hardcoded to warn/error on spaces and pretty much not function at all; this is broken as it is right now.
That should be addressed by the PR creating a symlink from the old to the new directory? Then this only leaves room for hardcoded paths that perform some comparison to this variable.
Sure, the direct commits are rust-mobile/ndk@b89ecba and rust-mobile/ndk@f0fc14b, together: - if: runner.os == 'Windows'
name: Create symlink to Android SDK/NDK without spaces
run: |
$oldAndroidPath = $env:ANDROID_HOME
$sdk_root = "C:\Android"
New-Item -Path $sdk_root -ItemType SymbolicLink -Value $oldAndroidPath
echo "ANDROID_SDK_ROOT=$sdk_root" >> $env:GITHUB_ENV
echo "ANDROID_NDK_ROOT=$sdk_root\ndk-bundle" >> $env:GITHUB_ENV
# Update legacy path for ndk-build:
echo "ANDROID_HOME=$sdk_root" >> $env:GITHUB_ENV
# "Unset" legacy paths:
echo "ANDROID_NDK_HOME=" >> $env:GITHUB_ENV
echo "ANDROID_NDK_PATH=" >> $env:GITHUB_ENV Note that this is not literally unsetting the variables, merely overwriting them with an empty string. I'll gladly update this code listing if that's possible one way or another. If these variables need to point to a valid NDK in your environment, set them to |
Thank you @MarijnS95 for the detailed explanation, I will re-open this issue to perform deeper investigation on possible impact and implementation ideas. |
First of all, the reason of the problem is the content of It contains a line
Namely It must have double quotes to work properly
Might be we should patch the file and create the ticket for Google? |
@dsame I won't be surprised if the answer is "use paths without spaces". There is a warning in the NDK as well as the Android Studio installer, someone must have tried to fix this before and seeing breakage in obscure places. These wrapper scripts (on Linux as well) are just an obvious first utterance of the problem. Let's hope that assumption is wrong, the scripts are the only missing piece to support whitespace paths, and Google is willing to accept a patch or fix it :) |
@MarijnS95 I agree with you there might be some other issues related to the path with the spaces, but the changing the value of ANDROID_HOME variable seems to be the dangerous breaking change which affects the very wide group of users. This is why i prefer to stay with the fixing of just one script so far. |
@dsame Don't forget to replace similar issues in all the clang wrapper scripts, which is what I came here for. |
My tests show that patch |
@vvb2060 Indeed, changing just Again, it seems unlikely that this project can quickly and consistently fix all whitespace issues given that Google engineers working on the NDK have not done so yet and advise against even trying because of mentioned nesting in |
@MarijnS95 @vvb2060 i got your statements. One more question before going the way you've suggested: don't you think it would be enough to change ANDROID_NDK_ROOT only and to do not touch ANDROID_SDK_ROOT? I almost the answer is "no" but just in case. |
AGP uses |
@dsame Not that I know of, we only use the NDK. Since its location sits within the SDK it would be weird not to keep them in sync. Again, how easy would it be to move the entire thing to @vvb2060 That page only lists SDK variables, not a single mention of the NDK (other applications will use the 10+ variants of |
@MarijnS95 @vvb2060 finally the PR is merged. ANDROID_SDK_ROOT to be changed in the next rollout |
@dsame Awesome, thanks for fully moving it in the end! I do have some questions about hardlink vs symlink vs junction though, see the PR. |
We've finished windows image deployments with the changes! |
Hey 👋 !
We were reported an issue with Android NDK path on Windows: #1074
[Under investigation]In order to fix it we are going to move Android SDK to the root folder C:\ in the scope of this PR on
July, 22#1077Please, let us know through this issue if you have any concerns.
Thanks!
The text was updated successfully, but these errors were encountered: