Skip to content

Apply new Android overlay patches to 6.0 devel branch on CI too #156

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
Jul 5, 2024
Merged
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
30 changes: 18 additions & 12 deletions .github/workflows/sdks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,6 @@ jobs:
STUPID_FILE_RENAMING=Tool
else
sed -i "s%r26%ndk/26%" swift/stdlib/cmake/modules/AddSwiftStdlib.cmake
if [ ${{ matrix.version }} = 'devel' ]; then
sed -i "s%canImport(Android%os(Android%" sourcekit-lsp/Sources/SKSupport/Process+Run.swift
git apply -C1 readlink-devel.patch
fi
STUPID_FILE_RENAMING=Command
fi
if [ ${{ matrix.version }} = 'release-25c' ]; then
Expand All @@ -131,8 +127,13 @@ jobs:
git apply -C0 swift-android-foundation-ndk26.patch
if [ ${{ matrix.version }} = 'release-26d' ]; then
git apply swift-android-stdlib-ndk26.patch
elif [ ${{ matrix.version }} = 'trunk' ]; then
else
git apply android-overlay/foundation-fixes.patch android-overlay/import-android.patch android-overlay/swift-argument-parser.patch android-overlay/swift-system-tag.patch android-overlay/yams.patch
if [ ${{ matrix.version }} = 'devel' ]; then
git apply android-overlay/sourcekit-lsp-swiftpm-devel.patch
else
git apply android-overlay/sourcekit-lsp-trunk.patch
fi
fi
fi
sed -i "s%/data/data/com.termux/files%$SDK%" $SDK/usr/lib/pkgconfig/sqlite3.pc
Expand All @@ -159,6 +160,11 @@ jobs:
if [ ! -d ${{ steps.version.outputs.tag }}-ubuntu22.04 ]; then
tar xf ~/${{ steps.version.outputs.tag }}-ubuntu22.04.tar.gz
fi
if [ ${{ matrix.version }} = 'devel' ]; then
sed -i "s%canImport(Glibc%canImport(Android%" ${{ steps.version.outputs.tag }}-ubuntu22.04/usr/bin/swift-package
sed -i "s%import Glibc%import Android%" ${{ steps.version.outputs.tag }}-ubuntu22.04/usr/bin/swift-package
sed -i "s%TSCBasic, would be nice%TSCBasic, would be %" ${{ steps.version.outputs.tag }}-ubuntu22.04/usr/bin/swift-package
fi
./${{ steps.version.outputs.tag }}-ubuntu22.04/usr/bin/swift --version

tar xf ~/swift-${{ matrix.version }}-android-${{ matrix.arch }}*-sdk.tar.xz
Expand All @@ -169,7 +175,7 @@ jobs:
path: swift-argument-parser
- name: Build Swift Argument Parser package
run: |
if [ ${{ matrix.version }} = 'trunk' ]; then
if [[ ${{ matrix.version }} != 'release'* ]]; then
git apply sdk-config/android-overlay/swift-argument-parser.patch
fi
cd swift-argument-parser
Expand Down Expand Up @@ -199,7 +205,7 @@ jobs:
git apply ../sdk-config/swift-nio-disable-ecn-tests.patch ../sdk-config/swift-nio-filesystem-both-ndks.patch
if [ ${{ matrix.version }} = 'release-25c' ]; then
git apply -R ../sdk-config/swift-nio-ndk26.patch
elif [ ${{ matrix.version }} = 'trunk' ]; then
elif [[ ${{ matrix.version }} != 'release-26d' ]]; then
../sdk-config/${{ steps.version.outputs.tag }}-ubuntu22.04/usr/bin/swift package update
cd .build/checkouts/swift-system/
git apply ../../../../sdk-config/android-overlay/swift-system-checkout.patch
Expand All @@ -224,7 +230,7 @@ jobs:
- name: Build Swift System package
run: |
cd swift-system
if [ ${{ matrix.version }} = 'trunk' ]; then
if [[ ${{ matrix.version }} != 'release'* ]]; then
git apply ../sdk-config/android-overlay/swift-system.patch
fi
../sdk-config/${{ steps.version.outputs.tag }}-ubuntu22.04/usr/bin/swift build --build-tests --destination ../sdk-config/swift-*-sdk/usr/swiftpm-android-${{ matrix.arch }}.json -Xlinker -rpath -Xlinker \$ORIGIN/lib/swift/android
Expand All @@ -251,7 +257,7 @@ jobs:
- name: Build Swift NIO SSH package
run: |
cd sns
if [ ${{ matrix.version }} = 'trunk' ]; then
if [[ ${{ matrix.version }} != 'release'* ]]; then
git apply ../sdk-config/android-overlay/swift-nio-ssh.patch
fi
sed -i "s%url: .*swift-\(\w\+\)\.git.*$%path: \"../swift-\1\"),%g" Package.swift
Expand All @@ -266,7 +272,7 @@ jobs:
cd snl
if [ ${{ matrix.version }} = 'release-25c' ]; then
sed -i "s%#include <time%#include <signal.h>\n#include <time%" Sources/CNIOBoringSSL/include/CNIOBoringSSL_asn1.h
elif [ ${{ matrix.version }} = 'trunk' ]; then
elif [ ${{ matrix.version }} != 'release-26d' ]; then
git apply ../sdk-config/android-overlay/swift-nio-ssl.patch
fi
SWIFTCI_USE_LOCAL_DEPS=1 ../sdk-config/${{ steps.version.outputs.tag }}-ubuntu22.04/usr/bin/swift build --build-tests --destination ../sdk-config/swift-*-sdk/usr/swiftpm-android-${{ matrix.arch }}.json -Xlinker -rpath -Xlinker \$ORIGIN/lib/swift/android
Expand All @@ -277,7 +283,7 @@ jobs:
path: yams
- name: Build Yams package
run: |
if [ ${{ matrix.version }} = 'trunk' ]; then
if [[ ${{ matrix.version }} != 'release'* ]]; then
git apply sdk-config/android-overlay/yams.patch
fi
cd yams
Expand All @@ -292,7 +298,7 @@ jobs:
if: ${{ matrix.arch != 'armv7' }}
run: |
cd snh
if [ ${{ matrix.version }} = 'trunk' ]; then
if [[ ${{ matrix.version }} != 'release'* ]]; then
git apply ../sdk-config/android-overlay/swift-nio-http2.patch
fi
sed -i "s%url: .*swift-\(\w\+\)\.git.*$%path: \"../swift-\1\"),%g" Package.swift
Expand Down
13 changes: 0 additions & 13 deletions android-overlay/import-android.patch
Original file line number Diff line number Diff line change
Expand Up @@ -102,19 +102,6 @@ index e9967f64..0630fe53 100644
// This is a lazily initialised global variable that when read for the first time, will ignore SIGPIPE.
private let globallyIgnoredSIGPIPE: Bool = {
/* no F_SETNOSIGPIPE on Linux :( */
diff --git a/sourcekit-lsp/Sources/SourceKitD/dlopen.swift b/sourcekit-lsp/Sources/SourceKitD/dlopen.swift
index 4adf5b44..07573da1 100644
--- a/sourcekit-lsp/Sources/SourceKitD/dlopen.swift
+++ b/sourcekit-lsp/Sources/SourceKitD/dlopen.swift
@@ -19,6 +19,8 @@ import Darwin
import Glibc
#elseif canImport(Musl)
import Musl
+#elseif canImport(Android)
+import Android
#endif

public final class DLHandle: Sendable {
diff --git a/sourcekit-lsp/Sources/SourceKitD/SKDRequestArray.swift b/sourcekit-lsp/Sources/SourceKitD/SKDRequestArray.swift
index a68c4ae3..f8aed9d7 100644
--- a/sourcekit-lsp/Sources/SourceKitD/SKDRequestArray.swift
Expand Down
39 changes: 39 additions & 0 deletions android-overlay/sourcekit-lsp-swiftpm-devel.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
diff --git a/sourcekit-lsp/Sources/SKSupport/dlopen.swift b/sourcekit-lsp/Sources/SKSupport/dlopen.swift
index 4adf5b44..07573da1 100644
--- a/sourcekit-lsp/Sources/SKSupport/dlopen.swift
+++ b/sourcekit-lsp/Sources/SKSupport/dlopen.swift
@@ -19,6 +19,8 @@ import Darwin
import Glibc
#elseif canImport(Musl)
import Musl
+#elseif canImport(Android)
+import Android
#endif

public final class DLHandle {
diff --git a/swiftpm/Sources/Build/TestObservation.swift b/swiftpm/Sources/Build/TestObservation.swift
index 98a8f5f8e..a86ff4675 100644
--- a/swiftpm/Sources/Build/TestObservation.swift
+++ b/swiftpm/Sources/Build/TestObservation.swift
@@ -132,6 +132,8 @@ public func generateTestObservationCode(buildParameters: BuildParameters) -> Str
@_exported import WinSDK
#elseif os(WASI)
@_exported import WASILibc
+ #elseif canImport(Android)
+ @_exported import Android
#else
@_exported import Darwin.C
#endif
diff --git a/swiftpm/Sources/CoreCommands/SwiftCommandState.swift b/swiftpm/Sources/CoreCommands/SwiftCommandState.swift
index 38c190ec3..27d0762cf 100644
--- a/swiftpm/Sources/CoreCommands/SwiftCommandState.swift
+++ b/swiftpm/Sources/CoreCommands/SwiftCommandState.swift
@@ -39,6 +39,8 @@ import Darwin
import Glibc
#elseif canImport(Musl)
import Musl
+#elseif canImport(Android)
+import Android
#endif

import func TSCBasic.exec
13 changes: 13 additions & 0 deletions android-overlay/sourcekit-lsp-trunk.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/sourcekit-lsp/Sources/SourceKitD/dlopen.swift b/sourcekit-lsp/Sources/SourceKitD/dlopen.swift
index 4adf5b44..07573da1 100644
--- a/sourcekit-lsp/Sources/SourceKitD/dlopen.swift
+++ b/sourcekit-lsp/Sources/SourceKitD/dlopen.swift
@@ -19,6 +19,8 @@ import Darwin
import Glibc
#elseif canImport(Musl)
import Musl
+#elseif canImport(Android)
+import Android
#endif

public final class DLHandle: Sendable {
24 changes: 0 additions & 24 deletions readlink-devel.patch

This file was deleted.