From 585caabd950dc7abdee2efe3e29f0dbebb8ac020 Mon Sep 17 00:00:00 2001 From: AMZN-ScottR <24445312+AMZN-ScottR@users.noreply.github.com> Date: Mon, 12 Jul 2021 11:38:05 -0700 Subject: [PATCH 1/2] [installer/2106-3p-license-fix] replaced 3rd party license url arg with auto generated one from version string Signed-off-by: AMZN-ScottR <24445312+AMZN-ScottR@users.noreply.github.com> --- cmake/Packaging.cmake | 51 +++++++++++++++++++------------------------ 1 file changed, 23 insertions(+), 28 deletions(-) diff --git a/cmake/Packaging.cmake b/cmake/Packaging.cmake index d77b5a30f8..a07e1ec1d3 100644 --- a/cmake/Packaging.cmake +++ b/cmake/Packaging.cmake @@ -125,37 +125,32 @@ install(FILES ${_cmake_package_dest} DESTINATION ./Tools/Redistributables/CMake ) -# temporary workaround for acquiring the 3rd party SPDX license manifest, the desired location is from -# another git repository that's private. once it's public, only how the URL is formed should change -set(LY_INSTALLER_3RD_PARTY_LICENSE_URL "" CACHE STRING "URL to the 3rd party SPDX license manifest file for inclusion in packaging.") +# the version string and git tags are intended to be synchronized so it should be safe to use that instead +# of directly calling into git which could get messy in certain scenarios +if(${CPACK_PACKAGE_VERSION} VERSION_GREATER "0.0.0.0") + set(_3rd_party_license_filename SPDX-Licenses.txt) -if(${LY_VERSION_STRING} VERSION_GREATER "0.0.0.0" AND NOT LY_INSTALLER_3RD_PARTY_LICENSE_URL) - message(FATAL_ERROR "Missing required URL for the 3rd party SPDX license manifest file. " - "Please specifiy where to acquire the file via LY_INSTALLER_3RD_PARTY_LICENSE_URL") -endif() + set(_3rd_party_license_url "https://raw.githubusercontent.com/o3de/3p-package-source/${CPACK_PACKAGE_VERSION}/${_3rd_party_license_filename}") + set(_3rd_party_license_dest ${CPACK_BINARY_DIR}/${_3rd_party_license_filename}) -string(REPLACE "/" ";" _url_components ${LY_INSTALLER_3RD_PARTY_LICENSE_URL}) -list(POP_BACK _url_components _3rd_party_license_filename) - -set(_3rd_party_license_dest ${CPACK_BINARY_DIR}/${_3rd_party_license_filename}) - -# use the plain file downloader as we don't have the file hash available and using a dummy will -# delete the file once it fails hash verification -file(DOWNLOAD - ${LY_INSTALLER_3RD_PARTY_LICENSE_URL} - ${_3rd_party_license_dest} - STATUS _status - TLS_VERIFY ON -) -list(POP_FRONT _status _status_code) - -if (${_status_code} EQUAL 0 AND EXISTS ${_3rd_party_license_dest}) - install(FILES ${_3rd_party_license_dest} - DESTINATION . + # use the plain file downloader as we don't have the file hash available and using a dummy will + # delete the file once it fails hash verification + file(DOWNLOAD + ${_3rd_party_license_url} + ${_3rd_party_license_dest} + STATUS _status + TLS_VERIFY ON ) -else() - file(REMOVE ${_3rd_party_license_dest}) - message(FATAL_ERROR "Failed to acquire the 3rd Party license manifest file. Error: ${_status}") + list(POP_FRONT _status _status_code) + + if (${_status_code} EQUAL 0 AND EXISTS ${_3rd_party_license_dest}) + install(FILES ${_3rd_party_license_dest} + DESTINATION . + ) + else() + file(REMOVE ${_3rd_party_license_dest}) + message(FATAL_ERROR "Failed to acquire the 3rd Party license manifest file at ${_3rd_party_license_url}. Error: ${_status}") + endif() endif() # checks for and removes trailing slash From aeae1555febd5a8117f06f56d01f4c4d8c9ea184 Mon Sep 17 00:00:00 2001 From: AMZN-ScottR <24445312+AMZN-ScottR@users.noreply.github.com> Date: Mon, 12 Jul 2021 12:29:27 -0700 Subject: [PATCH 2/2] [installer/2106-3p-license-fix] fixed issue with CrashHandler requiring 4-component version strings Signed-off-by: AMZN-ScottR <24445312+AMZN-ScottR@users.noreply.github.com> --- Code/Tools/CrashHandler/CMakeLists.txt | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Code/Tools/CrashHandler/CMakeLists.txt b/Code/Tools/CrashHandler/CMakeLists.txt index 22d37b2c5d..86e030bd69 100644 --- a/Code/Tools/CrashHandler/CMakeLists.txt +++ b/Code/Tools/CrashHandler/CMakeLists.txt @@ -38,8 +38,19 @@ ly_add_target( string(REPLACE "." ";" version_list "${LY_VERSION_STRING}") list(GET version_list 0 EXE_VERSION_INFO_0) list(GET version_list 1 EXE_VERSION_INFO_1) -list(GET version_list 2 EXE_VERSION_INFO_2) -list(GET version_list 3 EXE_VERSION_INFO_3) + +list(LENGTH version_list version_component_count) +if(${version_component_count} GREATER_EQUAL 3) + list(GET version_list 2 EXE_VERSION_INFO_2) +else() + set(EXE_VERSION_INFO_2 0) +endif() + +if(${version_component_count} GREATER_EQUAL 4) + list(GET version_list 3 EXE_VERSION_INFO_3) +else() + set(EXE_VERSION_INFO_3 0) +endif() ly_add_source_properties( SOURCES Shared/CrashHandler.cpp