Skip to content

Commit 0d13f0b

Browse files
fatbobmanclaude
andcommitted
fix: Use Ubuntu 22.04 Swift downloads with proper fallback chain
- Switch to Ubuntu 22.04 Swift downloads (compatible with Ubuntu 24.04) - Add comprehensive Swift dependencies installation - Implement fallback chain: 6.0.1 -> 6.0.2 -> 5.10.1 - Use correct download URLs: ubuntu2204 instead of ubuntu2004 - Add proper dependency packages for Swift runtime Download URLs verified: - Primary: Swift 6.0.1 for Ubuntu 22.04 - Fallback 1: Swift 6.0.2 for Ubuntu 22.04 - Fallback 2: Swift 5.10.1 for Ubuntu 22.04 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent d20b86f commit 0d13f0b

1 file changed

Lines changed: 32 additions & 14 deletions

File tree

.github/workflows/linux-compatibility.yml

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,29 +24,47 @@ jobs:
2424
continue-on-error: true
2525
id: swift-setup
2626

27-
- name: Install Swift using Swiftly (fallback)
27+
- name: Manual Swift installation (fallback)
2828
if: steps.swift-setup.outcome == 'failure'
2929
run: |
30-
echo "Swift setup failed, installing Swift using Swiftly..."
30+
echo "Swift setup failed, attempting manual installation..."
3131
32-
# Install Swiftly with non-interactive setup
33-
echo "1" | curl -L https://swiftlang.github.io/swiftly/swiftly-install.sh | bash
32+
# Install required dependencies
33+
sudo apt-get update
34+
sudo apt-get install -y binutils git gnupg2 libc6-dev libcurl4-openssl-dev libedit2 libgcc-9-dev libpython3.8 libsqlite3-0 libstdc++-9-dev libxml2-dev libz3-dev pkg-config tzdata unzip zlib1g-dev
3435
35-
# Add Swiftly to PATH for current session
36-
export PATH="$HOME/.local/bin:$PATH"
36+
# Try Swift 6.0.1 for Ubuntu 22.04 (should work on 24.04)
37+
SWIFT_URL="https://download.swift.org/swift-6.0.1-release/ubuntu2204/swift-6.0.1-RELEASE-ubuntu22.04.tar.gz"
38+
echo "Downloading Swift from: $SWIFT_URL"
3739
38-
# Install Swift 6.0 using Swiftly with Ubuntu 22.04 platform
39-
echo "Installing Swift 6.0 using Swiftly..."
40-
$HOME/.local/bin/swiftly install 6.0 --platform ubuntu2204
40+
if curl -fsSL -o swift.tar.gz "$SWIFT_URL"; then
41+
echo "Successfully downloaded Swift 6.0.1 for Ubuntu 22.04"
42+
else
43+
echo "Failed to download Swift 6.0.1, trying 6.0.2..."
44+
SWIFT_URL="https://download.swift.org/swift-6.0.2-release/ubuntu2204/swift-6.0.2-RELEASE-ubuntu22.04.tar.gz"
45+
if curl -fsSL -o swift.tar.gz "$SWIFT_URL"; then
46+
echo "Successfully downloaded Swift 6.0.2 for Ubuntu 22.04"
47+
else
48+
echo "Failed to download Swift 6.0.2, trying 5.10..."
49+
SWIFT_URL="https://download.swift.org/swift-5.10.1-release/ubuntu2204/swift-5.10.1-RELEASE-ubuntu22.04.tar.gz"
50+
curl -fsSL -o swift.tar.gz "$SWIFT_URL"
51+
echo "Downloaded Swift 5.10.1 as fallback"
52+
fi
53+
fi
4154
42-
# Use Swift 6.0
43-
$HOME/.local/bin/swiftly use 6.0
55+
# Extract Swift
56+
echo "Extracting Swift..."
57+
tar xzf swift.tar.gz
4458
45-
# Add Swift to PATH permanently
46-
echo "$HOME/.local/share/swiftly/toolchains/6.0/usr/bin" >> $GITHUB_PATH
59+
# Find the extracted directory
60+
SWIFT_DIR=$(find . -maxdepth 1 -name "swift-*-ubuntu22.04" -type d | head -1)
61+
echo "Swift directory: $SWIFT_DIR"
62+
63+
# Add to PATH
64+
echo "$PWD/$SWIFT_DIR/usr/bin" >> $GITHUB_PATH
4765
4866
# Verify installation
49-
$HOME/.local/share/swiftly/toolchains/6.0/usr/bin/swift --version
67+
"$PWD/$SWIFT_DIR/usr/bin/swift" --version
5068
5169
- name: Verify Swift installation
5270
run: |

0 commit comments

Comments
 (0)