Skip to content

[test] Fix building Android tests on Windows toolchain CI#86694

Merged
finagolfin merged 1 commit intoswiftlang:mainfrom
finagolfin:droid-win
Jan 23, 2026
Merged

[test] Fix building Android tests on Windows toolchain CI#86694
finagolfin merged 1 commit intoswiftlang:mainfrom
finagolfin:droid-win

Conversation

@finagolfin
Copy link
Copy Markdown
Member

Ever since #84574 added Android availability versioning, the Reflection test stopped building for Android unless the API level was in the target triple, so we hacked that into CMake in that pull, but the Windows CI does not pass in SWIFT_ANDROID_API_LEVEL, like build-script does, so pass it in here.

I don't see a way to run the failing build of the Android tests from the Windows toolchain CI in this pull, so will just need review from Windows people like @compnerd or @jeffdav before merging.

@finagolfin finagolfin requested a review from compnerd as a code owner January 21, 2026 19:41
Copy link
Copy Markdown
Member

@compnerd compnerd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please limit this to just the Android builds. I don't think that we should add spurious options to other builds.

utils/build.ps1 Outdated
-SwiftSDK $null `
-BuildTargets check-swift-validation-only_non_executable `
-Defines @{
SWIFT_ANDROID_API_LEVEL = "$AndroidAPILevel";
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This Test-Runtime method is only invoked for Android currently, see the lit overrides 10 lines up where it skips several tests for Android.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please conditionalise it to Android anyway. Setting the environment variable isn't great, and something to fix. But this function is generic - $Platform identifies what platform it is being executed for. The goal is to use this for all platforms, not just Android.

Ever since swiftlang#84574 added Android availability versioning, the Reflection test stopped
building for Android unless the API level was in the target triple, so we hacked that
into CMake in that pull, but the Windows CI does not pass in `SWIFT_ANDROID_API_LEVEL`,
like `build-script` does, so pass it in here when testing Android.
$PlatformDefines = @{}
if ($Platform.OS -eq [OS]::Android) {
$PlatformDefines += @{
SWIFT_ANDROID_API_LEVEL = "$AndroidAPILevel";
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made the change you asked for

@finagolfin
Copy link
Copy Markdown
Member Author

@swift-ci smoke test

@finagolfin finagolfin dismissed compnerd’s stale review January 23, 2026 11:01

Made the change you asked for and would like to get this in now, so we can run it through Win toolchain CI.

@finagolfin finagolfin merged commit f24d72a into swiftlang:main Jan 23, 2026
3 checks passed
@finagolfin finagolfin deleted the droid-win branch January 23, 2026 11:03
finagolfin added a commit that referenced this pull request Jan 28, 2026
… (#86839)

Ever since #84574 added Android availability
versioning, the Reflection test stopped building for Android unless the
API level was in the target triple, so [we hacked that into CMake in
that
pull](https://github.com/swiftlang/swift/pull/84574/files#diff-e2e2a250882f66d531f2a42c201e013fa2d8be892b2880a32d6596710761f470R2549),
but the Windows CI does not pass in `SWIFT_ANDROID_API_LEVEL`, [like
`build-script`
does](https://github.com/swiftlang/swift/blob/9143271dfdc92053a7b9d95000d9fd60e42413c3/utils/build-script-impl#L1632),
so pass it in here.
finagolfin added a commit that referenced this pull request Feb 17, 2026
…in CI again (#87275)

This was fixed in #86694, but the subsequent massive #84906 appears to
have [inadvertently disabled adding the needed Android API
level](https://github.com/swiftlang/swift/pull/84906/changes#diff-c861caa2fcc08744108e542ca836b07e342f537566e8c5f7a21a0e9125331ed9R2774),
as it was started late last year, long before the fix was added.
blevine1 pushed a commit to blevine1/swift that referenced this pull request Feb 24, 2026
…in CI again (swiftlang#87275)

This was fixed in swiftlang#86694, but the subsequent massive swiftlang#84906 appears to
have [inadvertently disabled adding the needed Android API
level](https://github.com/swiftlang/swift/pull/84906/changes#diff-c861caa2fcc08744108e542ca836b07e342f537566e8c5f7a21a0e9125331ed9R2774),
as it was started late last year, long before the fix was added.
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

Successfully merging this pull request may close these issues.

2 participants