Skip to content

Commit 6122b3c

Browse files
Migrate ArrowType from class hierarchy to enum.
* Add Dockerfile to generate protos. * Make Flight types Sendable structs where possible. * Replaced data type with enum. * Replaced ArrowType with enum. * Flight tests run under Swift 6.2
1 parent c76668d commit 6122b3c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+14492
-1498
lines changed

Package.swift

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import PackageDescription
2020
let package = Package(
2121
name: "Arrow",
2222
platforms: [
23-
.macOS(.v10_14)
23+
.macOS(.v13)
2424
],
2525
products: [
2626
.library(
@@ -37,6 +37,14 @@ let package = Package(
3737
url: "https://github.com/apple/swift-atomics.git",
3838
from: "1.3.0"
3939
),
40+
.package(
41+
url: "https://github.com/grpc/grpc-swift.git",
42+
from: "1.25.0"
43+
),
44+
.package(
45+
url: "https://github.com/apple/swift-protobuf.git",
46+
from: "1.29.0"
47+
),
4048
],
4149
targets: [
4250
.target(
@@ -56,6 +64,17 @@ let package = Package(
5664
// build: .unsafeFlags(["-warnings-as-errors"])
5765
]
5866
),
67+
.target(
68+
name: "ArrowFlight",
69+
dependencies: [
70+
"Arrow",
71+
.product(name: "GRPC", package: "grpc-swift"),
72+
.product(name: "SwiftProtobuf", package: "swift-protobuf"),
73+
],
74+
swiftSettings: [
75+
// build: .unsafeFlags(["-warnings-as-errors"])
76+
]
77+
),
5978
.testTarget(
6079
name: "ArrowTests",
6180
dependencies: ["Arrow", "ArrowC"],
@@ -66,5 +85,17 @@ let package = Package(
6685
// build: .unsafeFlags(["-warnings-as-errors"])
6786
]
6887
),
88+
.testTarget(
89+
name: "ArrowFlightTests",
90+
dependencies: [
91+
"Arrow",
92+
"ArrowFlight",
93+
.product(name: "GRPC", package: "grpc-swift"),
94+
.product(name: "SwiftProtobuf", package: "swift-protobuf"),
95+
],
96+
swiftSettings: [
97+
// build: .unsafeFlags(["-warnings-as-errors"])
98+
]
99+
),
69100
]
70101
)

README.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
# Swift Arrow
22

3-
A Swift implementation of Apache Arrow, the cross-language development
4-
platform for in-memory analytics.
3+
![Swift 6.2](https://img.shields.io/badge/Swift-6.2-orange?style=for-the-badge&logo=swift&logoColor=white)
54

6-
This is an independent Swift-focused project maintained by the Swift
7-
community. It implements the Apache Arrow specification and is fully
8-
compatible with other Arrow implementations.
5+
A Swift implementation of Apache Arrow, the universal columnar format for fast data interchange and in-memory analytics.
96

10-
## Relationship to Apache Arrow
11-
This project is based on Apache Arrow-Swift and maintains specification compatibility. See [LICENSE](LICENSE) for details.
12-
13-
The decision was made to operate independently of the Apache Software Foundation (ASF). Good project governance requires maintainers with knowledge of Swift and the Swift community. Currently there are no active ASF maintaners with knowledge of Swift. Apache's CI infrastructure for Swift is unmaintained, leading to intermittent CI failures. Moving to a Swift-focused organisation allows decisions to be made according to the requirements of the Swift community.
7+
This project is based on Arrow-Swift, the official Swift implementation of Apache Arrow. The decision was made to at least temporarily operate independently of the Apache Software Foundation (ASF). Currently there are no active ASF maintaners with knowledge of Swift, and the only [Apache approved CI for Swift](https://github.com/apache/infrastructure-actions/blob/main/approved_patterns.yml) is [setup-swift which is unmaintained](https://github.com/swift-actions/setup-swift/issues), leading to intermittent CI failures. This has led to delays in much-needed fixes being implemented.
148

159
Original source: https://github.com/apache/arrow-swift
10+
11+
Changes made since forking Arrow-Swift:
12+
* Moved to the swiftlang workflows: https://github.com/swiftlang/github-workflows
13+
* `ArrowType` has been moved from a class hierarchy to an enum to improve concurrency support.
14+
* A gradual migration from classes to structs, where appropriate, has begun.

Scripts/Dockerfile

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
FROM ubuntu:22.04
2+
3+
# --- Dependencies ---
4+
RUN apt-get update && apt-get install -y \
5+
curl unzip build-essential git libssl-dev libicu-dev libatomic1 \
6+
binutils libc6-dev libgcc-11-dev libstdc++-11-dev libpython3.10 \
7+
libxml2 libcurl4 libedit2 zlib1g-dev \
8+
&& rm -rf /var/lib/apt/lists/*
9+
10+
# --- Install protoc ---
11+
ENV PROTOC_VERSION=28.2
12+
RUN curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-aarch_64.zip \
13+
&& unzip protoc-${PROTOC_VERSION}-linux-aarch_64.zip -d /usr/local \
14+
&& rm protoc-${PROTOC_VERSION}-linux-aarch_64.zip
15+
16+
# --- Install Swift (ARM64 build) ---
17+
ENV SWIFT_VERSION=6.1.1
18+
ENV SWIFT_INSTALL_DIR=/usr/local/swift
19+
RUN curl -LO https://swift.org/builds/swift-${SWIFT_VERSION}-release/ubuntu2204-aarch64/swift-${SWIFT_VERSION}-RELEASE/swift-${SWIFT_VERSION}-RELEASE-ubuntu22.04-aarch64.tar.gz \
20+
&& mkdir -p ${SWIFT_INSTALL_DIR} \
21+
&& tar -xzf swift-${SWIFT_VERSION}-RELEASE-ubuntu22.04-aarch64.tar.gz -C ${SWIFT_INSTALL_DIR} --strip-components=1 \
22+
&& rm swift-${SWIFT_VERSION}-RELEASE-ubuntu22.04-aarch64.tar.gz
23+
24+
# Add Swift to PATH
25+
ENV PATH="${SWIFT_INSTALL_DIR}/usr/bin:${PATH}"
26+
27+
# Verify Swift installation
28+
RUN swift --version
29+
30+
# --- Build Swift Protobuf plugin ---
31+
RUN git clone --depth=1 https://github.com/apple/swift-protobuf.git /swift-protobuf \
32+
&& cd /swift-protobuf \
33+
&& swift build -c release \
34+
&& cp .build/release/protoc-gen-swift /usr/local/bin/ \
35+
&& cd / \
36+
&& rm -rf /swift-protobuf
37+
38+
# --- Build gRPC Swift plugin ---
39+
RUN git clone --depth=1 https://github.com/grpc/grpc-swift.git /grpc-swift \
40+
&& cd /grpc-swift \
41+
&& swift build -c release \
42+
&& cp .build/release/protoc-gen-grpc-swift /usr/local/bin/ \
43+
&& cd / \
44+
&& rm -rf /grpc-swift
45+
46+
# Verify installations
47+
RUN protoc --version \
48+
&& protoc-gen-swift --version \
49+
&& protoc-gen-grpc-swift --version
50+
51+
WORKDIR /src
52+
53+
# Use a more flexible entrypoint
54+
ENTRYPOINT ["protoc"]
55+
CMD ["--help"]

0 commit comments

Comments
 (0)