Android: avoid compiler issue swiftlang/swift#55637 when building the stdlib, where it's picking up a module from another arch#507
Conversation
… stdlib, where it's picking up a module from another arch
|
@shahmishal, this should avoid the flakes we've been seeing on the Android CI, by deleting this build directory for each Android arch after it has been installed. |
| # the build directory, or else we get errors like: | ||
| # error: could not find module '_Builtin_float' for target 'x86_64-unknown-linux-android'; found: aarch64-unknown-linux-android, at: /home/runner/work/_temp/swift-android-sdk/ndk/android-ndk-r27c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/swift/android/_Builtin_float.swiftmodule | ||
| rm -f $ndk_installation/sysroot/usr/lib/swift | ||
| rm -rf $ndk_installation/sysroot/usr/lib/swift/android |
There was a problem hiding this comment.
Is this right? Elsewhere we run ln -s $ndk_installation/lib/clang/$ndk_clang_version $swift_res_root/usr/lib/swift/clang, so maybe we should be deleting from $swift_res_root instead?
Maybe print out the path that is being delete here, and cross reference it with the error message failures like in CI run #60:
02:14:31 <unknown>:0: error: could not find module '_math' for target 'x86_64-unknown-linux-android'; found: aarch64-unknown-linux-android, at: /home/build-user/build/swift-project/Ninja-Release/swift-linux-x86_64/lib/swift/android/_math.swiftmodule/x86_64-unknown-linux-android
There was a problem hiding this comment.
Yeah, that is what I was worried about too, that deleting these files in the build directory through the symlink may not work, but as I mentioned earlier, it does seem to work.
I will look into the underlying compiler issue this week and try to fix or work around the root cause of these flakes.
Hopefully, this stops the random flakes we've been seeing on the Android CI, tested by swift-android-sdk#10 externally first.