Skip to content

[release/11.0] Fix Android NativeAOT template for updated memory safety rules - #134365

Merged
agocke merged 1 commit into
release/11.0from
backport/pr-134212-to-release/11.0
Sep 23, 2026
Merged

agocke merged 1 commit into
release/11.0from
backport/pr-134212-to-release/11.0

Conversation

@github-actions

@github-actions github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Backport of #134212 to release/11.0

/cc @steveisok @agocke

Customer Impact

  • Customer reported
  • Found internally

Test infra problem

Regression

  • Yes
  • No

Introduces with the latest round of safe/unsafe changes

Testing

Build break CI validates that the build break is gone

Risk

Low - test only change

IMPORTANT: If this backport is for a servicing release, please verify that:

  • For .NET 8 and .NET 9: The PR target branch is release/X.0-staging, not release/X.0.
  • For .NET 10+: The PR target branch is release/X.0 (no -staging suffix).

Package authoring no longer needed in .NET 9

IMPORTANT: Starting with .NET 9, you no longer need to edit a NuGet package's csproj to enable building and bump the version.
Keep in mind that we still need package authoring in .NET 8 and older versions.

Fixes the Android NativeAOT build failure in the runtime-extra-platforms
pipeline after System.Text.Json source-generation tests enabled
`updated-memory-safety-rules`.

The Android test template relied on type-level `unsafe` contexts, which
have no effect under the updated rules. Move the contexts to the pointer
operations and add explicit unsafe contracts to the native imports. The
template remains compatible with the legacy rules.

Validation:
- `./build.sh tasks`
- Compiled the template with legacy memory safety rules
- Compiled the template with updated memory safety rules
- Compiled the `SINGLE_FILE_TEST_RUNNER` path with updated memory safety
rules

> [!NOTE]
> This PR description was generated with GitHub Copilot.

Copilot-Session: e8bb4900-bf72-4876-b479-091185e5b89a
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @agocke, @dotnet/ilc-contrib
See info in area-owners.md if you want to be subscribed.

@steveisok steveisok added the Servicing-approved Approved for servicing release label Sep 21, 2026
@vitek-karas

Copy link
Copy Markdown
Member

/azp run runtime-android

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
1 pipeline(s) were filtered out due to trigger conditions.

@akoeplinger

Copy link
Copy Markdown
Member

/ba-g test failure on osx which is unrelated to the android template changes here

@agocke
agocke merged commit a753324 into release/11.0 Sep 23, 2026
148 of 150 checks passed
@agocke
agocke deleted the backport/pr-134212-to-release/11.0 branch September 23, 2026 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-NativeAOT-coreclr Servicing-approved Approved for servicing release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants