Skip to content

Fix postinstall script for 5.3 #2099

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 2 commits into from
Oct 26, 2020
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion utils/darwin-installer-scripts/postinstall
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@

INSTALLED_TOOLCHAIN=$2

ln -fs "${INSTALLED_TOOLCHAIN}" "${INSTALLED_TOOLCHAIN%/*}/swift-latest"
ln -fs "${INSTALLED_TOOLCHAIN}" "${INSTALLED_TOOLCHAIN%/*}/swift-latest.xctoolchain"
9 changes: 4 additions & 5 deletions utils/webassembly/distribute-latest-toolchain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ github() {
curl --header "authorization: Bearer $GITHUB_TOKEN" "$@"
}

latest_run=$(github "${gh_api}/repos/${repository}/actions/workflows/${workflow_name}/runs?head_branch=${branch}&status=completed&conclusion=success" \
latest_run=$(github "${gh_api}/repos/${repository}/actions/workflows/${workflow_name}/runs?head_branch=${branch}&status=success" \
| jq ".workflow_runs | map(select(.head_branch == \"$branch\")) | sort_by(.run_number) | last")

if [ -z "$latest_run" ] || [ "$latest_run" == "null" ]; then
Expand All @@ -28,7 +28,6 @@ fi
artifacts_url=$(echo $latest_run | jq .artifacts_url --raw-output)
head_sha=$(echo $latest_run | jq .head_sha --raw-output)


get_artifact_url() {
local name=$1
github $artifacts_url --fail | jq ".artifacts[] | select(.name == \"$name\") | .archive_download_url" | sed 's/\"//g'
Expand Down Expand Up @@ -112,16 +111,16 @@ sign_toolchain() {
fi
done

${codesign_bin} "${codesign_args[@]}" "${darwin_toolchain}/usr/"
${codesign_bin} "${codesign_args[@]}" "${darwin_toolchain}/"
}

create_installer() {
local darwin_toolchain=$1
local darwin_toolchain_name=$(basename "$darwin_toolchain")
local darwin_toolchain_installer_package="$darwin_toolchain.pkg"
local darwin_toolchain_install_location="/Library/Developer/Toolchains/${darwin_toolchain_name}.xctoolchain"
local darwin_toolchain_version=$(/usr/libexec/PlistBuddy -c "Print Version string" "$darwin_toolchain"/usr/Info.plist)
local darwin_toolchain_bundle_identifier=$(/usr/libexec/PlistBuddy -c "Print CFBundleIdentifier string" "$darwin_toolchain"/usr/Info.plist)
local darwin_toolchain_version=$(/usr/libexec/PlistBuddy -c "Print Version string" "$darwin_toolchain"/Info.plist)
local darwin_toolchain_bundle_identifier=$(/usr/libexec/PlistBuddy -c "Print CFBundleIdentifier string" "$darwin_toolchain"/Info.plist)

"${swift_source_dir}/utils/toolchain-installer" "${darwin_toolchain}/" "${darwin_toolchain_bundle_identifier}" \
"${DARWIN_TOOLCHAIN_INSTALLER_CERT}" "${darwin_toolchain_installer_package}" "${darwin_toolchain_install_location}" \
Expand Down