-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Document NDK upgrade process #112885
Open
jkurdek
wants to merge
3
commits into
dotnet:main
Choose a base branch
from
jkurdek:doc-ndk-upgrade
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+27
−1
Open
Document NDK upgrade process #112885
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ Android SDK and NDK can be automatically installed via the following script: | |
#!/usr/bin/env bash | ||
set -e | ||
|
||
NDK_VER=r23c | ||
NDK_VER=r27c | ||
SDK_VER=9123335_latest | ||
SDK_API_LEVEL=33 | ||
SDK_BUILD_TOOLS=33.0.1 | ||
|
@@ -154,3 +154,29 @@ The emulator can be launched with a variety of options. Run `emulator -help` to | |
### Debugging the native runtime code using Android Studio | ||
|
||
See [Debugging Android](../../debugging/mono/android-debugging.md) | ||
|
||
## Upgrading the Android NDK Version in CI Pipelines | ||
|
||
The Android NDK LTS version is released annually. CI pipelines retrieve the NDK version from Docker images hosted in the [dotnet-buildtools-prereqs-docker](https://github.com/dotnet/dotnet-buildtools-prereqs-docker) repository. | ||
For reference, see an example Dockerfile: | ||
[Azure Linux 3.0 .NET 10.0 Android Dockerfile](https://github.com/dotnet/dotnet-buildtools-prereqs-docker/blob/main/src/azurelinux/3.0/net10.0/android/amd64/Dockerfile). | ||
|
||
To upgrade the NDK version used in CI for building and testing Android, follow these steps: | ||
|
||
### 1. Verify the New NDK Version Locally | ||
- Download the new NDK version. | ||
- Test the local build using the new NDK by building a sample Android app. | ||
- Ensure **AOT** and **AOT_WITH_LIBRARY_FILES** are enabled in the build. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The phrase 'Ensure AOT and AOT_WITH_LIBRARY_FILES are enabled in the build' could be clearer if 'AOT' is defined. Consider specifying what 'AOT' stands for. Copilot is powered by AI, so mistakes are possible. Review output carefully before use. |
||
|
||
### 2. Test the New NDK in CI and Fix Issues | ||
- Create a new Docker image containing the updated NDK version. | ||
- Open a **draft PR** in the **runtime** repository that updates the Dockerfile reference to use the new image. | ||
- Monitor CI results and fix any failures. | ||
- Once CI is green, **commit only the necessary changes** (e.g., fixes, build adjustments) to the respective branch. | ||
- **Do not** change the Docker image reference in the final commit. | ||
|
||
### 3. Update the NDK Version in the Prerequisites Repository | ||
- Update the NDK version in the [dotnet-buildtools-prereqs-docker](https://github.com/dotnet/dotnet-buildtools-prereqs-docker) repository by modifying the Dockerfile. | ||
- The updated NDK will automatically flow to all builds of a given branch once merged. | ||
|
||
By following these steps, you ensure a smooth upgrade of the Android NDK in CI while maintaining stability and compatibility. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we update our codespaces container definition? (I can do it, just want to make sure its the right thing to do)
runtime/.devcontainer/android/Dockerfile
Line 31 in 2a19c9d