[Xamarin.Android.Build.Tasks] Use resolved NDK for AOT - #12316
Open
jonathanpeppers wants to merge 1 commit into
Open
[Xamarin.Android.Build.Tasks] Use resolved NDK for AOT#12316jonathanpeppers wants to merge 1 commit into
jonathanpeppers wants to merge 1 commit into
Conversation
The AOT targets pass the public $(AndroidNdkDirectory) property directly to <GetAotAssemblies/>. When that property is unset but ResolveSdks finds an NDK through the configured development environment, AOT incorrectly behaves as if no NDK was found. Pass the resolved $(_AndroidNdkDirectory) value consistently and document the public property used to override NDK discovery. Fixes: #7599 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0f915802-edea-4418-8313-f642a6da9c55
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes an AOT build correctness issue where AOT was using the public $(AndroidNdkDirectory) property (which may be unset) instead of the resolved NDK path discovered by ResolveSdks, causing AOT to behave as if no NDK was found in some environments. It also documents AndroidNdkDirectory for users who need to override NDK discovery.
Changes:
- Wire AOT’s
<GetAotAssemblies />task to use the resolved$(_AndroidNdkDirectory)value. - Add build-properties documentation for
AndroidNdkDirectory, including command-line usage.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.Aot.targets | Passes the resolved NDK path into GetAotAssemblies to align AOT behavior with SDK discovery. |
| Documentation/docs-mobile/building-apps/build-properties.md | Documents AndroidNdkDirectory and how to set it for overriding NDK discovery. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
AOT currently passes the public
$(AndroidNdkDirectory)property directly to<GetAotAssemblies/>. When that property is unset butResolveSdksdiscovers an NDK from the configured environment, AOT incorrectly behaves as though no NDK was found.Use the resolved
$(_AndroidNdkDirectory)value consistently for AOT while retaining$(AndroidNdkDirectory)as the supported discovery override. Document the public property and its command-line usage.Fixes #7599
Pull Request
title and
description
should follow the
commit-messages.mdworkflow documentation, and in particular should include: