Skip to content

Commit e6cdd9d

Browse files
CI: Install Swift toolchain preserving its usr/bin layout
Flattening the tarball into /usr/local makes SwiftPM derive a bogus toolchain root, so the swiftbuild build system cannot find swiftc.
1 parent 9544834 commit e6cdd9d

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

.github/actions/install-swift/action.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ runs:
3232
zlib1g-dev
3333
curl
3434
35+
# Keep the toolchain's `<root>/usr/bin` layout intact. Flattening it into
36+
# /usr/local breaks toolchain discovery in the swiftbuild build system,
37+
# which derives the toolchain root by stripping `usr/bin` from `swiftc`.
3538
- name: Install Swift
3639
shell: bash
37-
run: curl -fL ${{ inputs.download-url }} | sudo tar xfz - --strip-components=2 -C /usr/local
40+
run: |
41+
sudo mkdir -p /opt/swift
42+
curl -fL ${{ inputs.download-url }} | sudo tar xfz - --strip-components=1 -C /opt/swift
43+
echo "/opt/swift/usr/bin" >> "$GITHUB_PATH"

0 commit comments

Comments
 (0)