Skip to content

Commit e937110

Browse files
[skip ci] Use swift-driver on main scheme
The upstream recently started symlinking swift-driver to swift/swiftc since swiftlang/swift@6a181fb so the existence of swift-driver is now mandatory. We will be able to use swift-driver after swiftlang/swift-driver#1523 is merged.
1 parent 9454add commit e937110

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

tools/build/build-toolchain.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,12 @@ else
4848
echo "Using prebuilt cross compiler..."
4949
"$TOOLS_BUILD_PATH/install-base-toolchain" --scheme "$SCHEME"
5050
CROSS_COMPILER_DESTDIR=$PACKAGING_DIR/base-snapshot
51-
# FIXME: Remove this once we fixed new swift-driver to use llvm-ar
52-
# for WebAssembly target.
53-
rm -f "$CROSS_COMPILER_DESTDIR/usr/bin/swift-driver"
51+
52+
# Only for release/5.9 and release/5.10
53+
if [ "$SCHEME" = "release/5.9" ] || [ "$SCHEME" = "release/5.10" ]; then
54+
# HACK: Remove swift-driver since the old swift-driver used "ar" instead of "llvm-ar"
55+
rm -f "$CROSS_COMPILER_DESTDIR/usr/bin/swift-driver"
56+
fi
5457
fi
5558
"$TOOLS_BUILD_PATH/build-llvm-tools" --toolchain "$CROSS_COMPILER_DESTDIR"
5659

tools/build/package-toolchain

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ class PackageAction(Action):
5555
# $ echo | ./usr/bin/swiftc -target wasm32-unknown-wasi -o /dev/null -
5656
# The new swift-driver doesn't have this hack, so we remove swift-driver from the toolchain for now.
5757
swift_driver_path = os.path.join(dist_toolchain_path, 'usr', 'bin', 'swift-driver')
58-
if os.path.exists(swift_driver_path):
58+
if os.path.exists(swift_driver_path) and \
59+
self.options.scheme == 'release/5.9' and \
60+
self.options.scheme == 'release/5.10':
5961
os.remove(swift_driver_path)
6062

6163
wasi_sysroot_path = os.path.join('..', 'build-sdk', 'wasi-sysroot')

0 commit comments

Comments
 (0)