Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 1 addition & 14 deletions swift-ci/sdks/android/build-docker
Original file line number Diff line number Diff line change
Expand Up @@ -50,26 +50,13 @@ if [[ "$SKIP_FETCH" != "true" ]]; then
./scripts/fetch-source.sh --source-dir ${WORKDIR}/source
fi

# 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?


# 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 -0777 -pi -e "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#g" ${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.


# Push trunk back to build against Android API 24 with NDK 28c
if [[ -n "${SWIFT_VERSION}" && ($SWIFT_VERSION == scheme:main || $SWIFT_VERSION == tag:swift-DEV*) ]]; then
ANDROID_NDK_VERSION=android-ndk-r28c
ANDROID_API=24

rm ${WORKDIR}/source/swift-project/swift/test/Interop/Cxx/class/invalid-members/stdlib-containers-of-incomplete.swift
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.

ANDROID_API=23
fi

mkdir -p ${WORKDIR}/products
Expand Down
25 changes: 2 additions & 23 deletions swift-ci/sdks/android/build-local
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
# default architectures to build for
TARGET_ARCHS=${TARGET_ARCHS:-aarch64,x86_64,armv7}

ANDROID_NDK_VERSION=android-ndk-r27d
ANDROID_API=28
ANDROID_NDK_VERSION=android-ndk-r28c
ANDROID_API=23

BASEPATH=$(dirname $(realpath $0))
cd ${BASEPATH}
Expand All @@ -33,12 +33,6 @@ fi
mkdir -p ${WORKDIR}
WORKDIR=$(realpath ${WORKDIR})

# Push trunk back to build against Android API 24 with NDK 28c
if [[ -n "${SWIFT_VERSION}" && ($SWIFT_VERSION == scheme:main || $SWIFT_VERSION == tag:swift-DEV*) ]]; then
ANDROID_NDK_VERSION=android-ndk-r28c
ANDROID_API=24
fi

HOST_OS=ubuntu$(lsb_release -sr)
source ./scripts/toolchain-vars.sh

Expand Down Expand Up @@ -67,25 +61,10 @@ fi

# Check-out and patch the sources
./scripts/fetch-source.sh --source-dir ${WORKDIR}/source
# 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

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

# Disable failing trunk tests when building against NDK 28c
if [[ -n "${SWIFT_VERSION}" && ($SWIFT_VERSION == scheme:main || $SWIFT_VERSION == tag:swift-DEV*) ]]; then
rm ${WORKDIR}/source/swift-project/swift/test/Interop/Cxx/class/invalid-members/stdlib-containers-of-incomplete.swift
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
fi

mkdir -p ${WORKDIR}/products

./scripts/build.sh \
Expand Down
Loading