Skip to content

Commit ce626c1

Browse files
committed
fix(ci): Fix stale PCH module cache error after mlx-server→SwiftLM rename
The CI cache was built when the repo was named 'mlx-server'. After renaming to 'SwiftLM', clang embedded the old path in the PCH, causing: error: PCH was compiled with module cache path '.../mlx-server/.build/...' but the path is currently '.../SwiftLM/.build/...' Fixes: - build.yml, e2e-test.yml: scope cache key to 'spm-SwiftLM-' so the old 'spm-' prefixed cache is never restored as a partial match - Add 'Clear stale module cache' step (rm ModuleCache/) before swift build to eliminate any stale PCH artifacts that sneak in via partial cache hits - tests/test-server.sh: update comment and default binary path to SwiftLM
1 parent 60cc3e3 commit ce626c1

3 files changed

Lines changed: 18 additions & 6 deletions

File tree

.github/workflows/build.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,20 @@ jobs:
2121
uses: actions/cache@v4
2222
with:
2323
path: .build
24-
key: ${{ runner.os }}-spm-${{ hashFiles('Package.resolved') }}
24+
# Key includes product name so any rename (e.g. mlx-server→SwiftLM)
25+
# automatically busts the cache and prevents stale PCH errors.
26+
key: ${{ runner.os }}-spm-SwiftLM-${{ hashFiles('Package.resolved') }}
2527
restore-keys: |
26-
${{ runner.os }}-spm-
28+
${{ runner.os }}-spm-SwiftLM-
2729
2830
- name: Resolve dependencies
2931
run: swift package resolve
3032

33+
- name: Clear stale module cache
34+
# Prevents: "PCH was compiled with module cache path '…mlx-server…'
35+
# but the path is currently '…SwiftLM…'" after repo rename.
36+
run: find .build -type d -name ModuleCache -exec rm -rf {} + 2>/dev/null || true
37+
3138
- name: Build (Release)
3239
run: swift build -c release
3340

.github/workflows/e2e-test.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,14 @@ jobs:
2424
uses: actions/cache@v4
2525
with:
2626
path: .build
27-
key: ${{ runner.os }}-spm-${{ hashFiles('Package.resolved') }}
27+
key: ${{ runner.os }}-spm-SwiftLM-${{ hashFiles('Package.resolved') }}
2828
restore-keys: |
29-
${{ runner.os }}-spm-
29+
${{ runner.os }}-spm-SwiftLM-
30+
31+
- name: Clear stale module cache
32+
# Prevents: "PCH was compiled with module cache path '…mlx-server…'
33+
# but the path is currently '…SwiftLM…'" after repo rename.
34+
run: find .build -type d -name ModuleCache -exec rm -rf {} + 2>/dev/null || true
3035

3136
- name: Build (Release)
3237
run: swift build -c release

tests/test-server.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# test-server.sh — Integration tests for mlx-server
2+
# test-server.sh — Integration tests for SwiftLM
33
#
44
# Usage:
55
# ./tests/test-server.sh [binary_path] [port]
@@ -9,7 +9,7 @@
99

1010
set -euo pipefail
1111

12-
BINARY="${1:-.build/release/mlx-server}"
12+
BINARY="${1:-.build/release/SwiftLM}"
1313
PORT="${2:-15413}"
1414
HOST="127.0.0.1"
1515
MODEL="mlx-community/Qwen2.5-0.5B-Instruct-4bit" # Smallest model for CI

0 commit comments

Comments
 (0)