Skip to content

Commit 1d7d58a

Browse files
authored
Merge pull request #27576 from ahoppen/install-swiftsyntax-module
[build-script] Fix issue with installing SwiftSyntax if target dir does not exist
2 parents f692420 + 36a7e93 commit 1d7d58a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

utils/build-script-impl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3453,7 +3453,7 @@ for host in "${ALL_HOSTS[@]}"; do
34533453
if [ "${BUILD_LIBPARSER_ONLY}" ]; then
34543454
# We don't have a toolchain so we should install to the specified dir
34553455
DYLIB_DIR="${INSTALL_DESTDIR}"
3456-
MODULE_DIR="${INSTALL_DESTDIR}/${product}.swiftmodule/${SWIFT_HOST_VARIANT_ARCH}"
3456+
MODULE_DIR="${INSTALL_DESTDIR}/${product}.swiftmodule"
34573457
# Create the install dir if it doesn't exist
34583458
call mkdir -p "${INSTALL_DESTDIR}"
34593459
# Install libParser is necessary
@@ -3463,14 +3463,15 @@ for host in "${ALL_HOSTS[@]}"; do
34633463
else
34643464
# We have a toolchain so install to the toolchain
34653465
DYLIB_DIR="${host_install_destdir}${host_install_prefix}/lib/swift/${SWIFT_HOST_VARIANT}"
3466-
MODULE_DIR="${DYLIB_DIR}/${product}.swiftmodule/${SWIFT_HOST_VARIANT_ARCH}"
3466+
MODULE_DIR="${DYLIB_DIR}/${product}.swiftmodule"
34673467
fi
34683468
if [[ "${SKIP_SWIFTSYNTAX_SWIFTSIDE}" ]]; then
34693469
continue
34703470
fi
34713471
set_swiftsyntax_build_command
34723472
if [[ -z "${SKIP_INSTALL_SWIFTSYNTAX_MODULE}" ]] ; then
3473-
call "${swiftsyntax_build_command[@]}" --dylib-dir="${DYLIB_DIR}" --swiftmodule-base-name "${MODULE_DIR}" --install
3473+
mkdir -p "${MODULE_DIR}"
3474+
call "${swiftsyntax_build_command[@]}" --dylib-dir="${DYLIB_DIR}" --swiftmodule-base-name "${MODULE_DIR}/${SWIFT_HOST_VARIANT_ARCH}" --install
34743475
else
34753476
call "${swiftsyntax_build_command[@]}" --dylib-dir="${DYLIB_DIR}" --install
34763477
fi

0 commit comments

Comments
 (0)