You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by do...@apache.org on 2026/09/20 20:32:49 UTC
(spark-connect-swift) branch main updated: [SPARK-59675] Migrate `Examples` to Swift 6.4
This is an automated email from the ASF dual-hosted git repository.
dongjoon-hyun pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/spark-connect-swift.git
The following commit(s) were added to refs/heads/main by this push:
new 2c95a5d [SPARK-59675] Migrate `Examples` to Swift 6.4
2c95a5d is described below
commit 2c95a5d31da7f5a84ede38b90ccb821905c91aaa
Author: Dongjoon Hyun <do...@apache.org>
AuthorDate: Sun Sep 20 13:32:42 2026 -0700
[SPARK-59675] Migrate `Examples` to Swift 6.4
### What changes were proposed in this pull request?
This PR migrates all Swift `Examples` (`app`, `pi`, `spark-sql`, `stream`) to Swift 6.4.
- `Package.swift` (4 files): `swift-tools-version: 6.3.2` → `6.4.0`
- `Dockerfile` (4 files): `swift:6.3.3` → `swift:6.4.0` and the `swift-6.3.3-RELEASE` → `swift-6.4.0-RELEASE` static Linux SDK
- `Dockerfile` (4 files): `.build/*-swift-linux-musl/release/<executable>` → `.build/release/<executable>`
- `README.md` (4 files): update the `docker images` example output
The third item is required because Swift 6.4 uses `swiftbuild` as the default build system, which moved the products from `.build/aarch64-swift-linux-musl/release` to `.build/out/Products/Release-staticlinux-aarch64`. `.build/release` is a symlink to the new location and matches `swift build --show-bin-path`.
### Why are the changes needed?
[Swift 6.4.0](https://github.com/swiftlang/swift/releases/tag/swift-6.4.0-RELEASE) (2026-09-15) has been released and CI already builds and tests with it. We had better recommend users the latest Swift version.
### Does this PR introduce _any_ user-facing change?
No, this is an example-only change.
### How was this patch tested?
Pass the CIs.
In addition, I built all four examples with Swift 6.4.0 (`swiftlang-6.4.0.34.1`) without any warning, and built all four Docker images to confirm that the statically linked `musl` binaries run on the `distroless` image. The image sizes in the `README.md` files come from these builds.
```
$ docker images | grep spark-connect-swift
apache/spark-connect-swift:app 112MB 32MB
apache/spark-connect-swift:pi 112MB 32MB
apache/spark-connect-swift:spark-sql 112MB 32MB
apache/spark-connect-swift:stream 112MB 32MB
```
### Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Opus 5
Closes #573 from dongjoon-hyun/SPARK-59675.
Authored-by: Dongjoon Hyun <do...@apache.org>
Signed-off-by: Dongjoon Hyun <do...@apache.org>
---
Examples/app/Dockerfile | 11 +++++------
Examples/app/Package.swift | 2 +-
Examples/app/README.md | 2 +-
Examples/pi/Dockerfile | 11 +++++------
Examples/pi/Package.swift | 2 +-
Examples/pi/README.md | 2 +-
Examples/spark-sql/Dockerfile | 11 +++++------
Examples/spark-sql/Package.swift | 2 +-
Examples/spark-sql/README.md | 4 ++--
Examples/stream/Dockerfile | 11 +++++------
Examples/stream/Package.swift | 2 +-
Examples/stream/README.md | 4 ++--
12 files changed, 30 insertions(+), 34 deletions(-)
diff --git a/Examples/app/Dockerfile b/Examples/app/Dockerfile
index 1086975..173c5af 100644
--- a/Examples/app/Dockerfile
+++ b/Examples/app/Dockerfile
@@ -14,19 +14,18 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-FROM swift:6.3.3 AS builder
+FROM swift:6.4.0 AS builder
WORKDIR /app
-ADD https://download.swift.org/swift-6.3.3-release/static-sdk/swift-6.3.3-RELEASE/swift-6.3.3-RELEASE_static-linux-0.1.0.artifactbundle.tar.gz /tmp/swift-static-sdk.tar.gz
+ADD https://download.swift.org/swift-6.4.0-release/static-sdk/swift-6.4.0-RELEASE/swift-6.4.0-RELEASE_static-linux-0.1.0.artifactbundle.tar.gz /tmp/swift-static-sdk.tar.gz
RUN swift sdk install /tmp/swift-static-sdk.tar.gz && \
rm /tmp/swift-static-sdk.tar.gz
COPY . .
-RUN arch=$(uname -m) && \
- swift build -c release --swift-sdk ${arch}-swift-linux-musl && \
- strip .build/*-swift-linux-musl/release/SparkConnectSwiftApp
+RUN swift build -c release --swift-sdk $(uname -m)-swift-linux-musl && \
+ strip .build/release/SparkConnectSwiftApp
FROM gcr.io/distroless/static-debian12:nonroot
@@ -34,6 +33,6 @@ LABEL org.opencontainers.image.authors="Apache Spark project <dev@spark.apache.o
LABEL org.opencontainers.image.licenses="Apache-2.0"
LABEL org.opencontainers.image.ref.name="Apache Spark Connect for Swift"
-COPY --from=builder --chown=65532:65532 /app/.build/*-swift-linux-musl/release/SparkConnectSwiftApp /opt/spark-app/
+COPY --from=builder --chown=65532:65532 /app/.build/release/SparkConnectSwiftApp /opt/spark-app/
ENTRYPOINT ["/opt/spark-app/SparkConnectSwiftApp"]
diff --git a/Examples/app/Package.swift b/Examples/app/Package.swift
index d42e9c4..5e020a3 100644
--- a/Examples/app/Package.swift
+++ b/Examples/app/Package.swift
@@ -1,4 +1,4 @@
-// swift-tools-version: 6.3.2
+// swift-tools-version: 6.4.0
//
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
diff --git a/Examples/app/README.md b/Examples/app/README.md
index d2a49f7..985a3e9 100644
--- a/Examples/app/README.md
+++ b/Examples/app/README.md
@@ -16,7 +16,7 @@ Build an application Docker image.
$ docker build -t apache/spark-connect-swift:app .
$ docker images apache/spark-connect-swift:app
IMAGE ID DISK USAGE CONTENT SIZE EXTRA
-apache/spark-connect-swift:app 6a04254f603e 116MB 32.8MB
+apache/spark-connect-swift:app 7356821768e5 112MB 32MB
```
Run `app` docker image.
diff --git a/Examples/pi/Dockerfile b/Examples/pi/Dockerfile
index f18a1cb..ee002e8 100644
--- a/Examples/pi/Dockerfile
+++ b/Examples/pi/Dockerfile
@@ -14,19 +14,18 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-FROM swift:6.3.3 AS builder
+FROM swift:6.4.0 AS builder
WORKDIR /app
-ADD https://download.swift.org/swift-6.3.3-release/static-sdk/swift-6.3.3-RELEASE/swift-6.3.3-RELEASE_static-linux-0.1.0.artifactbundle.tar.gz /tmp/swift-static-sdk.tar.gz
+ADD https://download.swift.org/swift-6.4.0-release/static-sdk/swift-6.4.0-RELEASE/swift-6.4.0-RELEASE_static-linux-0.1.0.artifactbundle.tar.gz /tmp/swift-static-sdk.tar.gz
RUN swift sdk install /tmp/swift-static-sdk.tar.gz && \
rm /tmp/swift-static-sdk.tar.gz
COPY . .
-RUN arch=$(uname -m) && \
- swift build -c release --swift-sdk ${arch}-swift-linux-musl && \
- strip .build/*-swift-linux-musl/release/SparkConnectSwiftPi
+RUN swift build -c release --swift-sdk $(uname -m)-swift-linux-musl && \
+ strip .build/release/SparkConnectSwiftPi
FROM gcr.io/distroless/static-debian12:nonroot
@@ -34,6 +33,6 @@ LABEL org.opencontainers.image.authors="Apache Spark project <dev@spark.apache.o
LABEL org.opencontainers.image.licenses="Apache-2.0"
LABEL org.opencontainers.image.ref.name="Apache Spark Connect for Swift"
-COPY --from=builder --chown=65532:65532 /app/.build/*-swift-linux-musl/release/SparkConnectSwiftPi /opt/spark-app/
+COPY --from=builder --chown=65532:65532 /app/.build/release/SparkConnectSwiftPi /opt/spark-app/
ENTRYPOINT ["/opt/spark-app/SparkConnectSwiftPi"]
diff --git a/Examples/pi/Package.swift b/Examples/pi/Package.swift
index df5ca0b..85be0de 100644
--- a/Examples/pi/Package.swift
+++ b/Examples/pi/Package.swift
@@ -1,4 +1,4 @@
-// swift-tools-version: 6.3.2
+// swift-tools-version: 6.4.0
//
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
diff --git a/Examples/pi/README.md b/Examples/pi/README.md
index f39ade2..980fd62 100644
--- a/Examples/pi/README.md
+++ b/Examples/pi/README.md
@@ -16,7 +16,7 @@ Build an application Docker image.
$ docker build -t apache/spark-connect-swift:pi .
$ docker images apache/spark-connect-swift:pi
IMAGE ID DISK USAGE CONTENT SIZE EXTRA
-apache/spark-connect-swift:pi b4d99bb06afe 116MB 32.8MB
+apache/spark-connect-swift:pi 8f553c8177a1 112MB 32MB
```
Run `pi` docker image.
diff --git a/Examples/spark-sql/Dockerfile b/Examples/spark-sql/Dockerfile
index 3435fe5..9032b80 100644
--- a/Examples/spark-sql/Dockerfile
+++ b/Examples/spark-sql/Dockerfile
@@ -14,19 +14,18 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-FROM swift:6.3.3 AS builder
+FROM swift:6.4.0 AS builder
WORKDIR /app
-ADD https://download.swift.org/swift-6.3.3-release/static-sdk/swift-6.3.3-RELEASE/swift-6.3.3-RELEASE_static-linux-0.1.0.artifactbundle.tar.gz /tmp/swift-static-sdk.tar.gz
+ADD https://download.swift.org/swift-6.4.0-release/static-sdk/swift-6.4.0-RELEASE/swift-6.4.0-RELEASE_static-linux-0.1.0.artifactbundle.tar.gz /tmp/swift-static-sdk.tar.gz
RUN swift sdk install /tmp/swift-static-sdk.tar.gz && \
rm /tmp/swift-static-sdk.tar.gz
COPY . .
-RUN arch=$(uname -m) && \
- swift build -c release --swift-sdk ${arch}-swift-linux-musl && \
- strip .build/*-swift-linux-musl/release/SparkConnectSwiftSQLRepl
+RUN swift build -c release --swift-sdk $(uname -m)-swift-linux-musl && \
+ strip .build/release/SparkConnectSwiftSQLRepl
FROM gcr.io/distroless/static-debian12:nonroot
@@ -34,6 +33,6 @@ LABEL org.opencontainers.image.authors="Apache Spark project <dev@spark.apache.o
LABEL org.opencontainers.image.licenses="Apache-2.0"
LABEL org.opencontainers.image.ref.name="Apache Spark Connect for Swift"
-COPY --from=builder --chown=65532:65532 /app/.build/*-swift-linux-musl/release/SparkConnectSwiftSQLRepl /opt/spark-app/
+COPY --from=builder --chown=65532:65532 /app/.build/release/SparkConnectSwiftSQLRepl /opt/spark-app/
ENTRYPOINT ["/opt/spark-app/SparkConnectSwiftSQLRepl"]
diff --git a/Examples/spark-sql/Package.swift b/Examples/spark-sql/Package.swift
index 8b9750d..19aee19 100644
--- a/Examples/spark-sql/Package.swift
+++ b/Examples/spark-sql/Package.swift
@@ -1,4 +1,4 @@
-// swift-tools-version: 6.3.2
+// swift-tools-version: 6.4.0
//
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
diff --git a/Examples/spark-sql/README.md b/Examples/spark-sql/README.md
index c9ecb87..9dc46a7 100644
--- a/Examples/spark-sql/README.md
+++ b/Examples/spark-sql/README.md
@@ -15,8 +15,8 @@ Build an application Docker image.
```bash
$ docker build -t apache/spark-connect-swift:spark-sql .
$ docker images apache/spark-connect-swift:spark-sql
-IMAGE ID DISK USAGE CONTENT SIZE EXTRA
-apache/spark-connect-swift:spark-sql 3e13bf9066e7 116MB 32.8MB
+IMAGE ID DISK USAGE CONTENT SIZE EXTRA
+apache/spark-connect-swift:spark-sql 5c9de468a27d 112MB 32MB
```
Run `spark-sql` docker image.
diff --git a/Examples/stream/Dockerfile b/Examples/stream/Dockerfile
index 93f898b..6a7781d 100644
--- a/Examples/stream/Dockerfile
+++ b/Examples/stream/Dockerfile
@@ -14,19 +14,18 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-FROM swift:6.3.3 AS builder
+FROM swift:6.4.0 AS builder
WORKDIR /app
-ADD https://download.swift.org/swift-6.3.3-release/static-sdk/swift-6.3.3-RELEASE/swift-6.3.3-RELEASE_static-linux-0.1.0.artifactbundle.tar.gz /tmp/swift-static-sdk.tar.gz
+ADD https://download.swift.org/swift-6.4.0-release/static-sdk/swift-6.4.0-RELEASE/swift-6.4.0-RELEASE_static-linux-0.1.0.artifactbundle.tar.gz /tmp/swift-static-sdk.tar.gz
RUN swift sdk install /tmp/swift-static-sdk.tar.gz && \
rm /tmp/swift-static-sdk.tar.gz
COPY . .
-RUN arch=$(uname -m) && \
- swift build -c release --swift-sdk ${arch}-swift-linux-musl && \
- strip .build/*-swift-linux-musl/release/SparkConnectSwiftNetworkWordCount
+RUN swift build -c release --swift-sdk $(uname -m)-swift-linux-musl && \
+ strip .build/release/SparkConnectSwiftNetworkWordCount
FROM gcr.io/distroless/static-debian12:nonroot
@@ -34,6 +33,6 @@ LABEL org.opencontainers.image.authors="Apache Spark project <dev@spark.apache.o
LABEL org.opencontainers.image.licenses="Apache-2.0"
LABEL org.opencontainers.image.ref.name="Apache Spark Connect for Swift"
-COPY --from=builder --chown=65532:65532 /app/.build/*-swift-linux-musl/release/SparkConnectSwiftNetworkWordCount /opt/spark-app/
+COPY --from=builder --chown=65532:65532 /app/.build/release/SparkConnectSwiftNetworkWordCount /opt/spark-app/
ENTRYPOINT ["/opt/spark-app/SparkConnectSwiftNetworkWordCount"]
diff --git a/Examples/stream/Package.swift b/Examples/stream/Package.swift
index c808fd3..ede4346 100644
--- a/Examples/stream/Package.swift
+++ b/Examples/stream/Package.swift
@@ -1,4 +1,4 @@
-// swift-tools-version: 6.3.2
+// swift-tools-version: 6.4.0
//
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
diff --git a/Examples/stream/README.md b/Examples/stream/README.md
index 3ad3796..0533221 100644
--- a/Examples/stream/README.md
+++ b/Examples/stream/README.md
@@ -23,8 +23,8 @@ Build an application Docker image.
```bash
$ docker build -t apache/spark-connect-swift:stream .
$ docker images apache/spark-connect-swift:stream
-IMAGE ID DISK USAGE CONTENT SIZE EXTRA
-apache/spark-connect-swift:stream de938ec0a289 116MB 32.8MB
+IMAGE ID DISK USAGE CONTENT SIZE EXTRA
+apache/spark-connect-swift:stream fd07cc72bb59 112MB 32MB
```
Run `stream` docker image.
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org