Skip to content

Android: now that build-docker is run on CI, push Android API minimum to 23#536

Merged
justice-adams-apple merged 1 commit into
swiftlang:mainfrom
finagolfin:droid
May 21, 2026
Merged

Android: now that build-docker is run on CI, push Android API minimum to 23#536
justice-adams-apple merged 1 commit into
swiftlang:mainfrom
finagolfin:droid

Conversation

@finagolfin
Copy link
Copy Markdown
Member

@finagolfin finagolfin commented Mar 25, 2026

and remove unneeded source modifications for both build-{docker,local}

@finagolfin finagolfin requested a review from shahmishal as a code owner March 25, 2026 07:58
Comment thread swift-ci/sdks/android/build-docker Outdated

# This `git grep` invocation in a trunk test fails in our Docker for some
# reason, so just turn it into a plain `grep` again.
perl -pi -e 's:"git",:#:' ${WORKDIR}/source/swift-project/swift/test/Misc/verify-swift-feature-testing.test-sh
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.

We never knew why this was needed, some filesystem issue in our local testing that presumably doesn't affect whatever Docker config the official CI uses?

@justice-adams-apple, can you try removing this substitution from the official Android CI script too and see if it still works?

# reason, so just turn it into a plain `grep` again.
perl -pi -e 's:"git",:#:' ${WORKDIR}/source/swift-project/swift/test/Misc/verify-swift-feature-testing.test-sh

# Work around swiftlang/swift-driver#1822 for now
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.

Unfortunately, this toolchain issue is still unresolved, so still need this.

perl -pi -g -we "s#(call rm ... \".\{LIBDISPATCH_BUILD_DIR\}\"\n(\s+)fi\n)#\1\2if [[ -d \"\\\${ANDROID_NDK}\" ]]; then call ln -sf \"\\\${SWIFT_BUILD_PATH}/lib/swift\" \"\\\${ANDROID_NDK}/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib\"; fi#" ${WORKDIR}/source/swift-project/swift/utils/build-script-impl

# disable backtrace() for Android (needs either API33+ or libandroid-execinfo, or to manually add in backtrace backport)
perl -pi -e 's;os\(Android\);os\(AndroidDISABLED\);g' ${WORKDIR}/source/swift-project/swift-testing/Sources/Testing/SourceAttribution/Backtrace.swift
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.

Fixed by swiftlang/swift-testing#1356, which is in 6.3 also, but we kept this patch around since we nominally supported 6.2 also.

Now that 6.3 is out, we don't need it, so the CI team can also remove this line from your Android CI scripts.

rm ${WORKDIR}/source/swift-project/swift/test/Interop/SwiftToCxx/stdlib/stdlib-in-cxx-no-diagnostics-generated-header.cpp
rm ${WORKDIR}/source/swift-project/swift/test/Reflection/typeref_decoding_packs.swift
rm ${WORKDIR}/source/swift-project/swift/test/Reflection/typeref_lowering.swift
rm ${WORKDIR}/source/swift-project/swift/test/Reflection/typeref_lowering_packs.swift
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.

These tests were all disabled upstream in swiftlang/swift#86034 and swiftlang/swift#88056 instead, while typeref_lowering.swift was likely fixed by the recent build directory deletions.

@finagolfin
Copy link
Copy Markdown
Member Author

I'm setting up GitHub CI with build-local, swift-android-sdk#19, which will allow us to build and test these Android SDKs much more often and in more configurations than the official Android CI.

@finagolfin
Copy link
Copy Markdown
Member Author

I will redo this once #538 is merged and the CI starts using this script.

@finagolfin finagolfin marked this pull request as draft April 10, 2026 22:44
@finagolfin finagolfin changed the title Android: remove unneeded changes from #528, since build-{docker,local} are not run on the CI anyway Android: now that build-docker is run on CI, push Android API minimum to 23 Apr 15, 2026
@finagolfin finagolfin marked this pull request as ready for review May 1, 2026 23:10
@finagolfin
Copy link
Copy Markdown
Member Author

This is ready to go, just waiting on final approval from @swiftlang/android-workgroup on pushing down to API 23.

@finagolfin
Copy link
Copy Markdown
Member Author

@justice-adams-apple, this is ready to go in, now that swiftlang/swift#88996 was approved and swiftlang/swift#88435 merged, ie the Windows toolchain CI version of this change to API 23 for the Swift 6.4 and trunk branches. The Android workgroup would like to keep all these non-6.3 CI that build the Android SDKs synced to the same Android API version.

@justice-adams-apple
Copy link
Copy Markdown
Contributor

@finagolfin so main and 6.4 CI for post-merge should target API 23? Same NDK I assume?

@finagolfin
Copy link
Copy Markdown
Member Author

Yes, all 6.4 and main CI should build Android SDKs against API 23 from now on.

Same NDK 28c for now, with NDK 30 beta 1 dependent on that extra linux runner job we discussed, until NDK 30 beta 2 is out, after which we switch all 6.4 and trunk CI to beta 2.

Copy link
Copy Markdown

@albertoblue87-netizen albertoblue87-netizen left a comment

Choose a reason for hiding this comment

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

Done

Comment thread swift-ci/sdks/android/build-docker Outdated
# disable backtrace() for Android (needs either API33+ or libandroid-execinfo, or to manually add in backtrace backport)
perl -pi -e 's;os\(Android\);os\(AndroidDISABLED\);g' ${WORKDIR}/source/swift-project/swift-testing/Sources/Testing/SourceAttribution/Backtrace.swift

# Push trunk back to build against Android API 24 with NDK 28c
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we adjust this comment to reflect the new functionality?

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.

Done

@finagolfin
Copy link
Copy Markdown
Member Author

Hold on, made a mistake

…inimum to 23

and remove unneeded source modifications for both `build-{docker,local}`
@finagolfin
Copy link
Copy Markdown
Member Author

OK, ready for merge, as I had missed the non-6.3 check in my earlier commit, fixed now.

@justice-adams-apple justice-adams-apple merged commit 3420056 into swiftlang:main May 21, 2026
1 check passed
@finagolfin finagolfin deleted the droid branch May 21, 2026 16:44
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.

3 participants