Skip to content

[build-script] Fix issue with installing SwiftSyntax if target dir does not exist #27576

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 8, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions utils/build-script-impl
Original file line number Diff line number Diff line change
Expand Up @@ -3443,7 +3443,7 @@ for host in "${ALL_HOSTS[@]}"; do
if [ "${BUILD_LIBPARSER_ONLY}" ]; then
# We don't have a toolchain so we should install to the specified dir
DYLIB_DIR="${INSTALL_DESTDIR}"
MODULE_DIR="${INSTALL_DESTDIR}/${product}.swiftmodule/${SWIFT_HOST_VARIANT_ARCH}"
MODULE_DIR="${INSTALL_DESTDIR}/${product}.swiftmodule"
# Create the install dir if it doesn't exist
call mkdir -p "${INSTALL_DESTDIR}"
# Install libParser is necessary
Expand All @@ -3453,14 +3453,15 @@ for host in "${ALL_HOSTS[@]}"; do
else
# We have a toolchain so install to the toolchain
DYLIB_DIR="${host_install_destdir}${host_install_prefix}/lib/swift/${SWIFT_HOST_VARIANT}"
MODULE_DIR="${DYLIB_DIR}/${product}.swiftmodule/${SWIFT_HOST_VARIANT_ARCH}"
MODULE_DIR="${DYLIB_DIR}/${product}.swiftmodule"
fi
if [[ "${SKIP_SWIFTSYNTAX_SWIFTSIDE}" ]]; then
continue
fi
set_swiftsyntax_build_command
if [[ -z "${SKIP_INSTALL_SWIFTSYNTAX_MODULE}" ]] ; then
call "${swiftsyntax_build_command[@]}" --dylib-dir="${DYLIB_DIR}" --swiftmodule-base-name "${MODULE_DIR}" --install
mkdir -p "${MODULE_DIR}"
call "${swiftsyntax_build_command[@]}" --dylib-dir="${DYLIB_DIR}" --swiftmodule-base-name "${MODULE_DIR}/${SWIFT_HOST_VARIANT_ARCH}" --install
else
call "${swiftsyntax_build_command[@]}" --dylib-dir="${DYLIB_DIR}" --install
fi
Expand Down