Skip to content

Commit

Permalink
Updates code for downloading pinned VMs from files.squeak.org/base; m…
Browse files Browse the repository at this point in the history
…inor clean-up and cosmetics
  • Loading branch information
marceltaeumel committed Jan 5, 2022
1 parent f6ade00 commit 7466d7d
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 19 deletions.
48 changes: 33 additions & 15 deletions helpers_bundles.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,51 @@ download_and_extract_all_vms() {
echo "...downloading and sourcing VM versions file..."
curl -f -s --retry 3 -o "${TMP_PATH}/vm-versions" "${VM_BASE}/${VM_VERSIONS}"
source "${TMP_PATH}/vm-versions"
if [[ -z "${VERSION_VM_ARMV6}" ]] || [[ -z "${VERSION_VM_LINUX}" ]] || \
[[ -z "${VERSION_VM_MACOS}" ]] || [[ -z "${VERSION_VM_WIN}" ]]; then
print_error "...could not determine all required VM versions!"
exit 1
fi

download_and_extract_vm "macOS" "${VM_BASE}/${VM_MAC_X86}.zip" "${TMP_PATH}/${VM_MAC_X86}"
download_and_extract_vm "Linux" "${VM_BASE}/${VM_LIN_X86}.zip" "${TMP_PATH}/${VM_LIN_X86}"
download_and_extract_vm "Windows" "${VM_BASE}/${VM_WIN_X86}.zip" "${TMP_PATH}/${VM_WIN_X86}"
if is_64bit; then

if [[ -z "${VERSION_VM_LINUX_ARM}" ]] || \
[[ -z "${VERSION_VM_LINUX_X86}" ]] || \
[[ -z "${VERSION_VM_MACOS_ARM}" ]] || \
[[ -z "${VERSION_VM_MACOS_X86}" ]] || \
[[ -z "${VERSION_VM_WIN_X86}" ]]; then
print_error "...could not determine all required VM versions!"
exit 1
fi

download_and_extract_vm "macOS (x64)" "${VM_BASE}/${VM_MAC_X86}.zip" "${TMP_PATH}/${VM_MAC_X86}"
download_and_extract_vm "macOS (ARMv8)" "${VM_BASE}/${VM_MAC_ARM}.zip" "${TMP_PATH}/${VM_MAC_ARM}"
# unified binary will be constructed on-the-fly
# download_and_extract_vm "macOS (unified)" "${VM_BASE}/${VM_MAC}.zip" "${TMP_PATH}/${VM_MAC}"
download_and_extract_vm "Linux (x64)" "${VM_BASE}/${VM_LIN_X86}.zip" "${TMP_PATH}/${VM_LIN_X86}"
download_and_extract_vm "Linux (ARMv8)" "${VM_BASE}/${VM_LIN_ARM}.zip" "${TMP_PATH}/${VM_LIN_ARM}"
download_and_extract_vm "Windows (x64)" "${VM_BASE}/${VM_WIN_X86}.zip" "${TMP_PATH}/${VM_WIN_X86}"
else # 32-bit

if [[ -z "${VERSION_VM_LINUX_ARM}" ]] || \
[[ -z "${VERSION_VM_LINUX_X86}" ]] || \
[[ -z "${VERSION_VM_WIN_X86}" ]]; then
print_error "...could not determine all required VM versions!"
exit 1
fi

# ARMv6 currently only supported on 32-bit
if is_32bit; then
download_and_extract_vm "ARMv6" "${VM_BASE}/${VM_ARM6}.zip" "${TMP_PATH}/${VM_ARM6}"
download_and_extract_vm "Linux (x86)" "${VM_BASE}/${VM_LIN_X86}.zip" "${TMP_PATH}/${VM_LIN_X86}"
download_and_extract_vm "Linux (ARMv6)" "${VM_BASE}/${VM_LIN_ARM}.zip" "${TMP_PATH}/${VM_LIN_ARM}"
download_and_extract_vm "Windows (x86)" "${VM_BASE}/${VM_WIN_X86}.zip" "${TMP_PATH}/${VM_WIN_X86}"
fi

end_group
}

download_and_extract_all_vms_rc() {
begin_group "Downloading and extracting all VMs (release candidate)..."
begin_group "Downloading and extracting all VMs (RC ${VM_RC_TAG})..."

echo "...downloading and sourcing VM versions file..."
# Use latest release candidate of OSVM
# https://github.com/OpenSmalltalk/opensmalltalk-vm/releases/tag/202112201228
readonly VERSION_VM_LINUX="${VM_RC_TAG}"
readonly VERSION_VM_MACOS="${VM_RC_TAG}"
readonly VERSION_VM_WIN="${VM_RC_TAG}"
readonly VERSION_VM_LINUX_X86="${VM_RC_TAG}"
readonly VERSION_VM_MACOS_X86="${VM_RC_TAG}"
readonly VERSION_VM_WIN_X86="${VM_RC_TAG}"
readonly VERSION_VM_LINUX_ARM="${VM_RC_TAG}"
readonly VERSION_VM_MACOS_ARM="${VM_RC_TAG}"
readonly VERSION_VM_WIN_ARM="n/a"
Expand Down
2 changes: 1 addition & 1 deletion prepare_bundle_linux_x86.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
################################################################################

begin_group "Creating Linux bundle for ${SMALLTALK_VERSION}..."
BUNDLE_NAME_LIN_X86="${IMAGE_NAME}-${VERSION_VM_LINUX}-${BUNDLE_NAME_LIN_X86_SUFFIX}"
BUNDLE_NAME_LIN_X86="${IMAGE_NAME}-${VERSION_VM_LINUX_X86}-${BUNDLE_NAME_LIN_X86_SUFFIX}"
export_variable "BUNDLE_NAME_LIN_X86" "${BUNDLE_NAME_LIN_X86}"
BUNDLE_PATH="${BUILD_PATH}/${BUNDLE_NAME_LIN_X86}"

Expand Down
2 changes: 1 addition & 1 deletion prepare_bundle_macos_arm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
################################################################################

begin_group "Creating macOS bundle for ${SMALLTALK_VERSION}..."
BUNDLE_NAME_MAC_ARM="${IMAGE_NAME}-${VERSION_VM_MACOS}-${BUNDLE_NAME_MAC_ARM_SUFFIX}"
BUNDLE_NAME_MAC_ARM="${IMAGE_NAME}-${VERSION_VM_MACOS_ARM}-${BUNDLE_NAME_MAC_ARM_SUFFIX}"
export_variable "BUNDLE_NAME_MAC_ARM" "${BUNDLE_NAME_MAC_ARM}"
BUNDLE_ID_MAC="org.squeak.$(echo ${SQUEAK_VERSION} | tr '[:upper:]' '[:lower:]')-${IMAGE_BITS}bit"
APP_NAME="${IMAGE_NAME}.app"
Expand Down
2 changes: 1 addition & 1 deletion prepare_bundle_macos_x86.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
################################################################################

begin_group "Creating macOS bundle for ${SMALLTALK_VERSION}..."
BUNDLE_NAME_MAC_X86="${IMAGE_NAME}-${VERSION_VM_MACOS}-${BUNDLE_NAME_MAC_X86_SUFFIX}"
BUNDLE_NAME_MAC_X86="${IMAGE_NAME}-${VERSION_VM_MACOS_X86}-${BUNDLE_NAME_MAC_X86_SUFFIX}"
export_variable "BUNDLE_NAME_MAC_X86" "${BUNDLE_NAME_MAC_X86}"
BUNDLE_ID_MAC="org.squeak.$(echo ${SQUEAK_VERSION} | tr '[:upper:]' '[:lower:]')-${IMAGE_BITS}bit"
APP_NAME="${IMAGE_NAME}.app"
Expand Down
2 changes: 1 addition & 1 deletion prepare_bundle_windows_x86.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
################################################################################

begin_group "Creating Windows bundle for ${SMALLTALK_VERSION}..."
BUNDLE_NAME_WIN_X86="${IMAGE_NAME}-${VERSION_VM_WIN}-${BUNDLE_NAME_WIN_X86_SUFFIX}"
BUNDLE_NAME_WIN_X86="${IMAGE_NAME}-${VERSION_VM_WIN_X86}-${BUNDLE_NAME_WIN_X86_SUFFIX}"
export_variable "BUNDLE_NAME_WIN_X86" "${BUNDLE_NAME_WIN_X86}"
BUNDLE_PATH="${BUILD_PATH}/${BUNDLE_NAME_WIN_X86}"

Expand Down
3 changes: 3 additions & 0 deletions prepare_bundles.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ else
fi
if is_64bit; then
# There are no 32-bit VMs for macOS anymore.
begin_group "Creating unified VM for macOS..."
create_unified_vm_macOS "${TMP_PATH}/${VM_MAC}" "${TMP_PATH}/${VM_MAC_ARM}" "${TMP_PATH}/${VM_MAC_X86}"
end_group
readonly VERSION_VM_MACOS=${VERSION_VM_MACOS_ARM}
fi

if should_codesign; then
Expand Down

0 comments on commit 7466d7d

Please sign in to comment.