Skip to content
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

Add NDK 25b to Windows BazelCI #1962

Closed
ahumesky opened this issue May 31, 2024 · 6 comments
Closed

Add NDK 25b to Windows BazelCI #1962

ahumesky opened this issue May 31, 2024 · 6 comments

Comments

@ahumesky
Copy link
Contributor

To support tests for rules_android_ndk on Windows, we need an updated version of the NDK. Version 25b is on linux:

### Install Android NDK.
{
cd /opt
curl -fsSL -o android-ndk-r15c.zip https://dl.google.com/android/repository/android-ndk-r15c-linux-x86_64.zip
unzip android-ndk-r15c.zip > /dev/null
rm android-ndk-r15c.zip
curl -fsSL -o android-ndk-r25b.zip https://dl.google.com/android/repository/android-ndk-r25b-linux.zip
unzip android-ndk-r25b.zip > /dev/null
rm android-ndk-r25b.zip
}

So we should add Windows 25b to match. The URL is:
https://dl.google.com/android/repository/android-ndk-r25b-windows.zip

## Download the Android NDK and install into C:\android-ndk-r15c.
$android_ndk_url = "https://dl.google.com/android/repository/android-ndk-r15c-windows-x86_64.zip"
$android_ndk_zip = "c:\temp\android_ndk.zip"
$android_ndk_root = "c:\android_ndk"
New-Item $android_ndk_root -ItemType "directory" -Force
(New-Object Net.WebClient).DownloadFile($android_ndk_url, $android_ndk_zip)
[System.IO.Compression.ZipFile]::ExtractToDirectory($android_ndk_zip, $android_ndk_root)
Rename-Item "${android_ndk_root}\android-ndk-r15c" -NewName "r15c"
[Environment]::SetEnvironmentVariable("ANDROID_NDK_HOME", "${android_ndk_root}\r15c", "Machine")
$env:ANDROID_NDK_HOME = [Environment]::GetEnvironmentVariable("ANDROID_NDK_HOME", "Machine")
Remove-Item $android_ndk_zip

(NDK 26d is actually the lastest version of the NDK, but we should test and update to the latest version in a separate change.)

@meteorcloudy
Copy link
Member

Merged #1965, I'll update the VM image now.

@meteorcloudy
Copy link
Member

Windows VMs has been updated.

Android NDK r25b is installed to c:\android_ndk\r25b. However the default ANDROID_NDK_HOME env var still points to c:\android_ndk\r15c, you can override that in your presubmit.yml file.

@ahumesky
Copy link
Contributor Author

ahumesky commented Jun 3, 2024

Thank you!

@meteorcloudy
Copy link
Member

Re-open since the image has been rolled back

@meteorcloudy
Copy link
Member

I have a new Windows VM image in testing with the fix from #1968, will push next Monday morning.

@meteorcloudy
Copy link
Member

meteorcloudy commented Jun 10, 2024

The new image is pushed, let me know if there is any problem with the android ndk versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants