Skip to content

Conversation

jpobst
Copy link
Contributor

@jpobst jpobst commented Apr 3, 2025

Context: #9914

Backport of #9914, et al to bring support for API-36 to .NET 9 (net9.0-android36.0).

Note our repository does not currently have build system support for having multiple stable API platform versions in a single .NET version. To work around this, this commit treats API-36 as an "unstable" API level for the context of our build system. However it removes the need for users to use $(EnablePreviewFeatures) and thus is a stable platform version to our users.

If we actually updated $(AndroidLatestStableApiLevel) to 36 it would have (at least) the following issues:

  • We would no longer build or ship API-35 for .NET 9
  • net9.0-android would switch from net9.0-android35.0 to net9.0-android36.0 which we do not want. Once shipped, net9.0-android should not change meaning.

Proper multi-stable support would require expanding $(AndroidLatestStableApiLevel) to something akin to $(AndroidMinimumStableApiLevel)/$(AndroidMaximumStableApiLevel) or @(AndroidStableApiLevels). We have chosen not to invest in this work at this time.

@jpobst jpobst force-pushed the dev/jpobst/backport-api-36 branch 2 times, most recently from 4af9680 to de60f48 Compare April 4, 2025 02:25
@jpobst jpobst force-pushed the dev/jpobst/backport-api-36 branch from de60f48 to d3d476e Compare April 7, 2025 19:37
@jpobst jpobst added this to the .NET 9 Servicing milestone Apr 7, 2025
@jpobst jpobst marked this pull request as ready for review April 7, 2025 23:57
@jonpryor
Copy link
Contributor

jonpryor commented Apr 8, 2025

Shouldn't src/Mono.Android/PublicAPI/API-36/PublicAPI.Unshipped.txt be empty, as API-36 is "final"?

Have we run any API comparison between .NET 10's Mono.Android.dll and this new .NET 9 API-36 Mono.Android.dll? I assume they should be identical.

@jpobst
Copy link
Contributor Author

jpobst commented Apr 8, 2025

Shouldn't src/Mono.Android/PublicAPI/API-36/PublicAPI.Unshipped.txt be empty, as API-36 is "final"?

I guess it could be. We generally do it when we ship in Nov, so there is a pretty long lag time between when we mark the Android API "stable" and when we the .NET is "stable". However, I guess we won't have that lag time for backporting. The downside is moving it here but not in main means the branches diverge a bit.

Ultimately it probably doesn't matter too much either way. From a tooling perspective there is no difference between "Shipped" and "Unshipped" files, and I doubt we will be adding new API to .NET 9 in the future.

Have we run any API comparison between .NET 10's Mono.Android.dll and this new .NET 9 API-36 Mono.Android.dll? I assume they should be identical.

Not explicitly, but the PublicAPI.[Un]Shipped files were simply copied from main unchanged, so if there were any differences PublicAPI would be complaining.

@jonpryor jonpryor merged commit 3a3beeb into release/9.0.1xx Apr 8, 2025
57 checks passed
@jonpryor jonpryor deleted the dev/jpobst/backport-api-36 branch April 8, 2025 18:50
@github-actions github-actions bot locked and limited conversation to collaborators May 9, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants