Skip to content

Commit

Permalink
Fix trunk swift-driver so it compiles again for armv7 on the CI
Browse files Browse the repository at this point in the history
  • Loading branch information
finagolfin committed Sep 14, 2022
1 parent c9e82f5 commit 043df19
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/sdks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ jobs:
git apply swift-android.patch swift-android-ci.patch
sed -i "s%cross_compile_config%cross_compile_config, '-Xlinker', '-landroid-spawn'%" sourcekit-lsp/Utilities/build-script-helper.py
if [ ${{ matrix.version }} = 'trunk' ]; then
cd swift-driver
patch -p1 < ../package-patches/swift-driver-trunk-armv7.patch
cd ..
fi
./swift/utils/build-script -RA --skip-build-cmark --build-llvm=0 --android --android-ndk $ANDROID_NDK --android-arch ${{ matrix.arch }} --android-api-level $ANDROID_API_LEVEL --build-swift-tools=0 --native-swift-tools-path=`pwd`/$SWIFT_TAG-ubuntu20.04/usr/bin --native-clang-tools-path=`pwd`/$SWIFT_TAG-ubuntu20.04/usr/bin --cross-compile-hosts=android-${{ matrix.arch }} --cross-compile-deps-path=$SDK --skip-local-build --xctest --skip-early-swift-driver --install-swift --install-libdispatch --install-foundation --install-xctest --install-destdir=$SDK --swift-install-components='clang-resource-dir-symlink;license;stdlib;sdk-overlay' --cross-compile-append-host-target-to-destdir=False -b -p --install-llbuild --sourcekit-lsp
patchelf --set-rpath \$ORIGIN $SDK/usr/lib/swift/android/libdispatch.so
Expand Down
22 changes: 22 additions & 0 deletions package-patches/swift-driver-trunk-armv7.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
diff --git a/Sources/SwiftDriver/Utilities/DateAdditions.swift b/Sources/SwiftDriver/Utilities/DateAdditions.swift
index 59a1a107..8a902eaf 100644
--- a/Sources/SwiftDriver/Utilities/DateAdditions.swift
+++ b/Sources/SwiftDriver/Utilities/DateAdditions.swift
@@ -39,7 +39,7 @@ public struct TimePoint: Equatable, Comparable, Hashable {
}

extension TimePoint {
- public static func seconds(_ value: Int) -> TimePoint {
+ public static func seconds(_ value: Int64) -> TimePoint {
precondition(value >= 0,
"Duration value in seconds is \(value), but cannot be negative")
return TimePoint(seconds: UInt64(value), nanoseconds: 0)
@@ -97,7 +97,7 @@ extension TimePoint{
let result: UInt64 = (UInt64(ftTime.dwLowDateTime) << 0)
+ (UInt64(ftTime.dwHighDateTime) << 32)
// Windows ticks in 100 nanosecond intervals.
- return .seconds(Int(result / 10_000_000))
+ return .seconds(Int64(result / 10_000_000))
#else
var tv = timeval()
gettimeofday(&tv, nil)

0 comments on commit 043df19

Please sign in to comment.