Skip to content

Commit

Permalink
swift: update from 5.9.2 to trunk Feb 2 snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
finagolfin committed Feb 12, 2024
1 parent 7b4103d commit 4493a55
Show file tree
Hide file tree
Showing 22 changed files with 346 additions and 7,755 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
target_arch: [aarch64, arm, x86_64]
target_arch: [aarch64] #, arm, x86_64]
fail-fast: false
steps:
- name: Setup arm and aarch64 CPU emulators
Expand Down
6 changes: 3 additions & 3 deletions packages/libdispatch/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ TERMUX_PKG_HOMEPAGE=https://github.com/apple/swift-corelibs-libdispatch
TERMUX_PKG_DESCRIPTION="The libdispatch project, for concurrency on multicore hardware"
TERMUX_PKG_LICENSE="Apache-2.0"
TERMUX_PKG_MAINTAINER="@finagolfin"
TERMUX_PKG_VERSION="1:5.9"
TERMUX_PKG_SRCURL=https://github.com/apple/swift-corelibs-libdispatch/archive/swift-RELEASE.tar.gz
TERMUX_PKG_SHA256=db30ccf6b20963112ab3aad256c2e49a18041a9806cf2f05854fe63a90d688c2
TERMUX_PKG_VERSION="1:5.11"
TERMUX_PKG_SRCURL=https://github.com/apple/swift-corelibs-libdispatch/archive/swift-DEVELOPMENT-SNAPSHOT-2024-02-02-a.tar.gz
TERMUX_PKG_SHA256=709629174cbcdb15136a7e1c2c5a114ae4144e27c7d56c31cd410536cecf2427
TERMUX_PKG_AUTO_UPDATE=false
TERMUX_PKG_DEPENDS="libc++, libblocksruntime"
6 changes: 3 additions & 3 deletions packages/llbuild/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ TERMUX_PKG_HOMEPAGE=https://github.com/apple/swift-llbuild
TERMUX_PKG_DESCRIPTION="A low-level build system, used by the Swift Package Manager"
TERMUX_PKG_LICENSE="Apache-2.0, NCSA"
TERMUX_PKG_MAINTAINER="@finagolfin"
TERMUX_PKG_VERSION=5.9
TERMUX_PKG_SRCURL=https://github.com/apple/swift-llbuild/archive/swift-RELEASE.tar.gz
TERMUX_PKG_SHA256=cc8dfb098db4b0210ca5466f59d3e5fc55c4eedcd835263e6eae7dd719ba8203
TERMUX_PKG_VERSION=5.11
TERMUX_PKG_SRCURL=https://github.com/apple/swift-llbuild/archive/swift-DEVELOPMENT-SNAPSHOT-2024-02-02-a.tar.gz
TERMUX_PKG_SHA256=e8548b74dcc667a3b0533109148614a26c905eb68d5de756e9a96e276f16968a
TERMUX_PKG_DEPENDS="libc++, libandroid-spawn, libsqlite"
TERMUX_PKG_NO_STATICSPLIT=true
58 changes: 29 additions & 29 deletions packages/swift/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ TERMUX_PKG_HOMEPAGE=https://swift.org/
TERMUX_PKG_DESCRIPTION="Swift is a high-performance system programming language"
TERMUX_PKG_LICENSE="Apache-2.0, NCSA"
TERMUX_PKG_MAINTAINER="@finagolfin"
TERMUX_PKG_VERSION=5.9.2
SWIFT_RELEASE="RELEASE"
TERMUX_PKG_VERSION=5.11
SWIFT_RELEASE="DEVELOPMENT-SNAPSHOT-2024-02-02-a"
TERMUX_PKG_SRCURL=https://github.com/apple/swift/archive/swift-$SWIFT_RELEASE.tar.gz
TERMUX_PKG_SHA256=d63c9743fa1d35c8c6203745955375fd69c710897de96d1c6245d2c9e42fbb49
TERMUX_PKG_SHA256=b6cd0e6038601305620940d7b4cd5dcc794f1f91d1efcb5c3d23bf54977e5122
TERMUX_PKG_AUTO_UPDATE=false
TERMUX_PKG_HOSTBUILD=true
TERMUX_PKG_DEPENDS="clang, libandroid-glob, libandroid-posix-semaphore, libandroid-spawn, libcurl, libicu, libicu-static, libsqlite, libuuid, libxml2, libdispatch, llbuild, pkg-config, swift-sdk-${TERMUX_ARCH/_/-}"
Expand Down Expand Up @@ -35,46 +35,46 @@ termux_step_post_get_source() {
mv .temp swift

declare -A library_checksums
library_checksums[swift-cmark]=658f4eb94f271e68af4ae07f4214f58d36dfc8edd7fc17ac44e8c85bec984337
library_checksums[llvm-project]=9df7cacc0107202dcdee8025d5cec9fe413f164e28921372acc61fddd78ed473
library_checksums[swift-experimental-string-processing]=3abc4225789e19defae966f7d9a712c77a5c0366f1d44d37df671048fe62daf6
library_checksums[swift-syntax]=b1918519f5bc6c7820f14242adfe26d9520a91896349a486359d9809b4e89351
library_checksums[swift-corelibs-libdispatch]=b1f3e46ed248df6a3456d20bc23b2d8a12b740a40185d81b668b1d31735cadf2
library_checksums[swift-corelibs-foundation]=e58c529ababd547cf0b205fc0820ccce38a033664625c271110b564f2554dd44
library_checksums[swift-corelibs-xctest]=7f0d21ce0bb15ed5275b0d6e5ee1747344d9756c9f1913a644a0b2142ee1fb19
library_checksums[swift-llbuild]=44bcb0f8c6fa6cccdc16b7e75c996987568d8fde3caf8bc83c24a2e10383406f
library_checksums[swift-argument-parser]=44782ba7180f924f72661b8f457c268929ccd20441eac17301f18eff3b91ce0c
library_checksums[sourcekit-lsp]=66d86a262b68f5dc5898cd0211b93c835b327c21814452ad7b9ab4157cd21c03
library_checksums[swift-corelibs-xctest]=feb537e381769fa85260e4cfaf4c4b10a354a6d94be89fbe7e527d46f5e19988
library_checksums[swift-corelibs-foundation]=7a03aed518d8515ccea8972cfa94c13ad7860a13262b2f572f838c5ff6345451
library_checksums[swift-collections]=d0f584b197860db26fd939175c9d1a7badfe7b89949b4bd52d4f626089776e0a
library_checksums[swift-driver]=6963870f2bb38c9ef9fcb7e5dcb347ca275a06d88ccb4ae6da36dda9647a96d7
library_checksums[swift-argument-parser]=4a10bbef290a2167c5cc340b39f1f7ff6a8cf4e1b5433b68548bf5f1e542e908
library_checksums[swift-syntax]=8b85e50905c67ef2c33c7ab921c09092f74b879ce6381090a12ae023a1f05585
library_checksums[swift-llbuild]=e8548b74dcc667a3b0533109148614a26c905eb68d5de756e9a96e276f16968a
library_checksums[swift-corelibs-libdispatch]=709629174cbcdb15136a7e1c2c5a114ae4144e27c7d56c31cd410536cecf2427
library_checksums[swift-system]=ab771be8a944893f95eed901be0a81a72ef97add6caa3d0981e61b9b903a987d
library_checksums[swift-asn1]=e0da995ae53e6fcf8251887f44d4030f6600e2f8f8451d9c92fcaf52b41b6c35
library_checksums[swift-tools-support-core]=4a860798868cca5bd84abe45e225415b7203c8b66c7f8d728e12bcba608f1d87
library_checksums[swift-package-manager]=10d858faa2643e2741da29969a7fc139dd837b4fa3e4d220067d840462ed2b78
library_checksums[swift-cmark]=fc683a1c36bbba816121594a7da23567cda9dd6b079f645bbcc285ef5bdc2600
library_checksums[indexstore-db]=c92afbc74c314bfb17ed3987d14d2099402d5b32b4bf64f4e99eb51c6465deed
library_checksums[swift-certificates]=fcaca458aab45ee69b0f678b72c2194b15664cc5f6f5e48d0e3f62bc5d1202ca
library_checksums[swift-crypto]=5c860c0306d0393ff06268f361aaf958656e1288353a0e23c3ad20de04319154
library_checksums[llvm-project]=402ea38ab2808bbc143d7459fa96c766db4f8db439c1667d867fe53aaabfbfd1
library_checksums[swift-experimental-string-processing]=350f588b4b6feda6771b92bfb1e55e12c027f763cad2a28164d19b3195272f13
library_checksums[Yams]=ec1ad699c30f0db45520006c63a88cc1c946a7d7b36dff32a96460388c0a4af2
library_checksums[swift-collections]=575cf0f88d9068411f9acc6e3ca5d542bef1cc9e87dc5d69f7b5a1d5aec8c6b6
library_checksums[swift-crypto]=a7b2f5c4887ccd728cdff5d1162b4d4d36bd6c2df9c0c31d5b9b73d341c5c1bb
library_checksums[swift-system]=865b8c380455eef27e73109835142920c60ae4c4f4178a3d12ad04acc83f1371
library_checksums[swift-asn1]=d4470d61788194abbd60ed73965ee0722cc25037e83d41226a8a780088ba524e
library_checksums[swift-certificates]=d7699ce91d65a622c1b9aaa0235cbbbd1be4ddc42a90fce007ff74bef50e8985
library_checksums[swift-driver]=e4db5194e99ebbd605a14b86965b301b5a060482ecd1c5c94a4a099de5754e35
library_checksums[swift-tools-support-core]=e0ab6f07998865549ad4bff34c91a3947a50a0085890d2d32605dfff296980c8
library_checksums[swift-package-manager]=132ae4908fa9c8f10265585f593dc748a021a18b11d6a1881e22d2db2dd1e162
library_checksums[indexstore-db]=a907c8fce27e718c179f6a92b73df62675e44b86612116468ff6ebd3f2997b31
library_checksums[sourcekit-lsp]=0db3e5c56f2889a3be2ff4e9b5a285085459dee6f821c0cdf513eb5c9cc94ae4

for library in "${!library_checksums[@]}"; do \
GH_ORG="apple"
if [ "$library" = "swift-argument-parser" ]; then
SRC_VERSION="1.2.2"
SRC_VERSION="1.2.3"
TAR_NAME=$SRC_VERSION
elif [ "$library" = "swift-asn1" ]; then
SRC_VERSION="0.7.0"
SRC_VERSION="1.0.0"
TAR_NAME=$SRC_VERSION
elif [ "$library" = "swift-certificates" ]; then
SRC_VERSION="0.4.1"
SRC_VERSION="1.0.1"
TAR_NAME=$SRC_VERSION
elif [ "$library" = "swift-collections" ]; then
SRC_VERSION="1.0.1"
SRC_VERSION="1.0.5"
TAR_NAME=$SRC_VERSION
elif [ "$library" = "swift-crypto" ]; then
SRC_VERSION="2.5.0"
SRC_VERSION="3.0.0"
TAR_NAME=$SRC_VERSION
elif [ "$library" = "swift-system" ]; then
SRC_VERSION="1.1.1"
SRC_VERSION="1.2.1"
TAR_NAME=$SRC_VERSION
elif [ "$library" = "Yams" ]; then
GH_ORG="jpsim"
Expand Down Expand Up @@ -133,7 +133,7 @@ termux_step_make() {
SWIFT_BUILD_FLAGS="$SWIFT_BUILD_FLAGS --android
--android-ndk $TERMUX_STANDALONE_TOOLCHAIN --android-arch $SWIFT_ARCH
--build-toolchain-only --skip-local-build --skip-local-host-install
--cross-compile-hosts=android-$SWIFT_ARCH --bootstrapping=off
--cross-compile-hosts=android-$SWIFT_ARCH
--cross-compile-deps-path=$(dirname $TERMUX_PREFIX)
--native-swift-tools-path=$SWIFT_BINDIR
--native-clang-tools-path=$SWIFT_BINDIR
Expand Down
90 changes: 0 additions & 90 deletions packages/swift/swift-android-ndk26.patch
Original file line number Diff line number Diff line change
Expand Up @@ -205,93 +205,3 @@ index 4d6577d0..aa22dade 100644
messages = constructJobSignalledMessages(job: job, error: errorMessage, output: output,
signal: signal, pid: pid).map {
ParsableMessage(name: job.kind.rawValue, kind: .signalled($0))
diff --git a/swift-tools-support-core/Sources/TSCBasic/FileSystem.swift b/swift-tools-support-core/Sources/TSCBasic/FileSystem.swift
index b33b1c6..cd2ce5b 100644
--- a/swift-tools-support-core/Sources/TSCBasic/FileSystem.swift
+++ b/swift-tools-support-core/Sources/TSCBasic/FileSystem.swift
@@ -491,8 +491,8 @@ private struct LocalFileSystem: FileSystem {

func readFileContents(_ path: AbsolutePath) throws -> ByteString {
// Open the file.
- let fp = fopen(path.pathString, "rb")
- if fp == nil {
+ let fpo = fopen(path.pathString, "rb")
+ guard let fp = fpo else {
throw FileSystemError(errno: errno, path)
}
defer { fclose(fp) }
@@ -521,8 +521,8 @@ private struct LocalFileSystem: FileSystem {

func writeFileContents(_ path: AbsolutePath, bytes: ByteString) throws {
// Open the file.
- let fp = fopen(path.pathString, "wb")
- if fp == nil {
+ let fpo = fopen(path.pathString, "wb")
+ guard let fp = fpo else {
throw FileSystemError(errno: errno, path)
}
defer { fclose(fp) }
diff --git a/swift-tools-support-core/Sources/TSCBasic/Process.swift b/swift-tools-support-core/Sources/TSCBasic/Process.swift
index 6c8aa11..71d829c 100644
--- a/swift-tools-support-core/Sources/TSCBasic/Process.swift
+++ b/swift-tools-support-core/Sources/TSCBasic/Process.swift
@@ -144,6 +144,9 @@ public final class Process {

/// The current OS does not support the workingDirectory API.
case workingDirectoryNotSupported
+
+ /// The stdin could not be opened.
+ case stdinNotOpening
}

public enum OutputRedirection {
@@ -677,7 +680,10 @@ public final class Process {
var stdinPipe: [Int32] = [-1, -1]
try open(pipe: &stdinPipe)

- let stdinStream = try LocalFileOutputByteStream(filePointer: fdopen(stdinPipe[1], "wb"), closeOnDeinit: true)
+ guard let fp = fdopen(stdinPipe[1], "wb") else {
+ throw Process.Error.stdinNotOpening
+ }
+ let stdinStream = try LocalFileOutputByteStream(filePointer: fp, closeOnDeinit: true)

// Dupe the read portion of the remote to 0.
posix_spawn_file_actions_adddup2(&fileActions, stdinPipe[0], 0)
@@ -1258,6 +1264,8 @@ extension Process.Error: CustomStringConvertible {
return "could not find executable for '\(program)'"
case .workingDirectoryNotSupported:
return "workingDirectory is not supported in this platform"
+ case .stdinNotOpening:
+ return "could not open stdin on this platform"
}
}
}
diff --git a/swift-tools-support-core/Sources/TSCBasic/WritableByteStream.swift b/swift-tools-support-core/Sources/TSCBasic/WritableByteStream.swift
index aee907e..2047d22 100644
--- a/swift-tools-support-core/Sources/TSCBasic/WritableByteStream.swift
+++ b/swift-tools-support-core/Sources/TSCBasic/WritableByteStream.swift
@@ -790,7 +790,11 @@ public final class LocalFileOutputByteStream: FileOutputByteStream {
override final func writeImpl(_ bytes: ArraySlice<UInt8>) {
bytes.withUnsafeBytes { bytesPtr in
while true {
+ #if os(Android)
+ let n = fwrite(bytesPtr.baseAddress!, 1, bytesPtr.count, filePointer)
+ #else
let n = fwrite(bytesPtr.baseAddress, 1, bytesPtr.count, filePointer)
+ #endif
if n < 0 {
if errno == EINTR { continue }
errorDetected(code: errno)
diff --git a/swift-tools-support-core/Sources/TSCTestSupport/PseudoTerminal.swift b/swift-tools-support-core/Sources/TSCTestSupport/PseudoTerminal.swift
index 59610b6..2797c71 100644
--- a/swift-tools-support-core/Sources/TSCTestSupport/PseudoTerminal.swift
+++ b/swift-tools-support-core/Sources/TSCTestSupport/PseudoTerminal.swift
@@ -24,7 +24,7 @@ public final class PseudoTerminal {
if openpty(&primary, &secondary, nil, nil, nil) != 0 {
return nil
}
- guard let outStream = try? LocalFileOutputByteStream(filePointer: fdopen(secondary, "w"), closeOnDeinit: false) else {
+ guard let outStream = try? LocalFileOutputByteStream(filePointer: fdopen(secondary, "w")!, closeOnDeinit: false) else {
return nil
}
self.outStream = outStream
Loading

0 comments on commit 4493a55

Please sign in to comment.