Skip to content

Commit f5b3582

Browse files
Fixes for Xcode build with artifact bundle (#34)
1 parent 37f999a commit f5b3582

9 files changed

Lines changed: 105 additions & 76 deletions

File tree

.github/actions/select-xcode/action.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
name: Select Xcode with Swift 6.2+
22
description: >
3-
Select the newest Xcode 26+ install on the runner so a swift-tools-version
3+
Select an installed Xcode 26+ on the runner so a swift-tools-version
44
6.2 Package.swift resolves. macos-latest currently defaults to Xcode 16.4,
55
which ships Swift 6.1.0 and rejects 6.2 manifests with
66
"is using Swift tools version 6.2.0 but the installed version is 6.1.0".
7+
By default picks the newest installed Xcode 26+; pass `version` to pin
8+
a specific major.minor (e.g. `26.3`) for matrix coverage.
79
810
# TODO: remove this action and every `- uses: ./.github/actions/select-xcode`
911
# call site once GitHub's macos-latest image defaults to an Xcode that ships
@@ -12,15 +14,25 @@ description: >
1214
# (look for "(default)" in the Xcode table). When the default version meets
1315
# the package's swift-tools-version, the explicit selection becomes redundant.
1416

17+
inputs:
18+
version:
19+
description: >
20+
Xcode version glob to match (e.g. "26.3" matches Xcode_26.3*.app).
21+
Defaults to "26", which picks the newest Xcode 26+ installed.
22+
required: false
23+
default: "26"
24+
1525
runs:
1626
using: composite
1727
steps:
1828
- shell: bash
29+
env:
30+
XCODE_VERSION: ${{ inputs.version }}
1931
run: |
2032
set -euo pipefail
21-
xcode=$(ls -d /Applications/Xcode_26*.app 2>/dev/null | sort -V | tail -1)
33+
xcode=$(ls -d /Applications/Xcode_${XCODE_VERSION}*.app 2>/dev/null | sort -V | tail -1)
2234
if [[ -z "$xcode" ]]; then
23-
echo "No Xcode 26+ installed on this runner image." >&2
35+
echo "No Xcode matching /Applications/Xcode_${XCODE_VERSION}*.app installed on this runner image." >&2
2436
ls /Applications | grep -i xcode >&2 || true
2537
exit 1
2638
fi

.github/workflows/ci.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,28 @@ permissions:
1212

1313
jobs:
1414
test-pinned:
15-
name: Test (pinned artifactbundle)
16-
runs-on: macos-latest
15+
# Matrix Xcode coverage to catch issues like the SE-0482 artifactbundle
16+
# module-map import failure reported on Xcode 26.3 (issue #33), which
17+
# the "newest 26+" picker on macos-latest does not exercise.
18+
# Xcode 26.4+ requires macOS 26 (Tahoe), so it must run on macos-26;
19+
# 26.3 is the highest Xcode that installs on macos-15 (Sequoia).
20+
name: Test (pinned artifactbundle, Xcode ${{ matrix.xcode }})
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
include:
25+
- os: macos-15
26+
xcode: "26.3"
27+
- os: macos-26
28+
xcode: "26.4"
29+
- os: macos-26
30+
xcode: "26.5"
31+
runs-on: ${{ matrix.os }}
1732
steps:
1833
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
1934
- uses: ./.github/actions/select-xcode
35+
with:
36+
version: ${{ matrix.xcode }}
2037
- name: Run tests
2138
run: swift test
2239

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import PackageDescription
88
// dependency consumers (both `Context.packageDirectory` and `#filePath` return
99
// synthetic paths during dep evaluation).
1010
let tokenizersRustArtifactBundleURL =
11-
"https://github.com/DePasqualeOrg/swift-tokenizers/releases/download/tokenizers-rust-0.6.1/TokenizersRust-0.6.1.artifactbundle.zip"
11+
"https://github.com/DePasqualeOrg/swift-tokenizers/releases/download/tokenizers-rust-0.6.3/TokenizersRust-0.6.3.artifactbundle.zip"
1212
let tokenizersRustArtifactBundleChecksum =
13-
"8002b3bffd226b10d64cbe632804e5fc5bc7716ec30f2b1e058b95f25637c76c"
13+
"95e42afc2d1edbf2bd0209cd1e2cb202c1059900c1180942377cc3e800b52dc9"
1414

1515
let docsEnabled = Context.environment["TOKENIZERS_ENABLE_DOCS"] == "1"
1616
let localRustArtifactPath = Context.environment["TOKENIZERS_RUST_LOCAL_ARTIFACTBUNDLE_PATH"]

Sources/Tokenizers/RustTokenizer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright © Anthony DePasquale
22

33
import Foundation
4-
@_implementationOnly import TokenizersFFI
4+
import TokenizersFFI
55

66
private struct RustTokenizerDescriptor {
77
let runtimeConfiguration: TokenizerRuntimeConfiguration

0 commit comments

Comments
 (0)