Skip to content

[android] Remove ICU build flags since that requirement was dropped in #40340 #40625

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 23, 2021

Conversation

finagolfin
Copy link
Member

Since @Azoy removed libicu as a stdlib dependency, this greatly simplifies the build-script command needed to cross-compile the toolchain for Android. I only removed the Android ICU flags in this pull, but there are other uses for Windows and other platforms that can also be removed. I tested this pull with #35707 by applying the following command that is taken from the Android build preset run on the CI, but removing the flags to build libicu and install the toolchain:

./swift/utils/build-script --release --assertions --no-swift-stdlib-assertions --android
--android-ndk /home/butta/android-ndk-r23b/ --android-arch aarch64 --android-api-level 24
--test --validation-test --long-test --stress-test --test-optimized --lit-args="-v --time-tests"
--build-swift-static-stdlib --build-swift-static-sdk-overlay --build-swift-stdlib-unittest-extra
--host-test --skip-test-linux -j9 --skip-build-compiler-rt

I ran this for both aarch64 and armv7 and only 13 C++ Interop tests failed, which were already broken on the Android CI because of #39605 a couple weeks ago. The good news is those tests progressed further with #35707, but still failed because of some missing headers and other problems with the NDK.

So this pull passes all the same tests as the current Android CI and should be fine. @drodriguez and @compnerd, you two know this code best, please review.

4. Change directories into `libiconv-libicu-android`: `cd libiconv-libicu-android`
5. Run the Swift build script: `./build-swift.sh`
6. Confirm that the various `libicuXYZswift.so` libraries are located in the
`armeabi-v7a` directory.
Copy link
Member Author

Choose a reason for hiding this comment

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

We may need this back if we ever add instructions for cross-compiling swift-corelibs-foundation for Android as in #38441, since that repo still requires libicu, but in the meantime this libicu cross-compilation is no longer needed and we can always resurrect this doc from git if we want it later.

Copy link
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.

The only thing that I’m remotely concerned about is the foundation test. That still requires icu, but assuming that there’s a different script for that/you’ve tested foundation with this change, this looks great!

--android-icu-uc "${ANDROID_ICU_PATH}/armeabi-v7a" \
--android-icu-uc-include "${ANDROID_ICU_PATH}/armeabi-v7a/icu/source/common" \
--android-icu-i18n "${ANDROID_ICU_PATH}/armeabi-v7a" \
--android-icu-i18n-include "${ANDROID_ICU_PATH}/armeabi-v7a/icu/source/i18n" \
Copy link
Member Author

Choose a reason for hiding this comment

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

I just went ahead and got rid of this whole file because it hasn't worked in years. The expanded build preset from #38441 should replace this.

@@ -945,8 +939,6 @@ installable-package=%(installable_package)s

host-test

extra-cmake-options=-DSWIFT_ENABLE_LLD_LINKER:BOOL=OFF
Copy link
Member Author

Choose a reason for hiding this comment

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

This hasn't been used since @davezarzycki removed it in #32042.

@finagolfin
Copy link
Member Author

finagolfin commented Dec 19, 2021

assuming that there’s a different script for that/you’ve tested foundation with this change

Cross-compilation of Foundation uses this CMake config I added this summer to get the path to a cross-compiled libicu in a different way. I haven't actually now tested this pull with that flag yet butand since they're completely separate build paths, I don't see that gettingthe Foundation linking against a cross-compiled libicu wasn't affected.

Thanks for the quick review.


```
$ ARM_DIR=path/to/libiconv-libicu-android/armeabi-v7a
Copy link
Member Author

Choose a reason for hiding this comment

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

Removed this line that I had missed and rebased.

@finagolfin
Copy link
Member Author

@MaxDesiatov, would you run the CI?

@MaxDesiatov
Copy link
Contributor

@swift-ci please test

@MaxDesiatov
Copy link
Contributor

@swift-ci please smoke test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - a3ea28f

@finagolfin
Copy link
Member Author

macOS CI failure appears spurious, as this pull doesn't affect macOS and the only failure I see is FAIL: Testing swift-docc failed but none of the swift-docc tests failed.

@finagolfin
Copy link
Member Author

@davezarzycki, I see you're up: would you merge if that CI failure isn't required to pass? It is spurious.

@davezarzycki
Copy link
Contributor

I lost my window to work today so I don't have time to review this before merging. Maybe @gottesmm can help.

@finagolfin
Copy link
Member Author

@davezarzycki, this pull was already approved and passed most of the CI, just need someone to merge.

@compnerd compnerd merged commit d1bb98b into swiftlang:main Dec 23, 2021
@finagolfin finagolfin deleted the droid-remove-icu branch December 23, 2021 16:50
@finagolfin
Copy link
Member Author

Thanks for getting this in quickly, @compnerd.

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.

5 participants