瀏覽代碼

Updates to enable OpenSSL for Linux

This update will re-introduce the O3DE vendored OpenSSL package for linux. Using O3DE's vendored OpenSSL package for linux will solve problem that was introduced by OpenSSL in AzNetworking which causes a dynamic link dependency on all Gems and executables that pull in a indirect dependency on AzNetworking (which is most of them).

Details of changes to the 3rd Party source scripts:

Updates for OpenSSL for Linux
- Additional parameterization of scripts used for OpenSSL build, install, and test
- Add new build config variable 'custom_additional_template_map' to allow custom template variable mappings to the cmake_find_template file
- Fixed the logic for 'test_package' to follow how custom scripts are executed for the 'custom_build' and 'custom_install' scripts
- Updated the test_OpenSSL project to accept expecting the OpenSSL version string for further validation and added SHA1 hashing as part of the test
- Removed 'FindOpenSSL.cmake.Linux' in favor of the template version
- Switch to only building the OpenSSL static library since the FindOpenSSL only referenced static libraries anyways

Updates for AWSNativeSDK for Linux
- Add direct dependency to existing 3P packages for OpenSSL and zlib (instead of linking to system versions)
- Update AWSNativeSDK to link against the static versions of the existing 3P packages
- Update AWSNativeSDK to build curl from source (based on linking with the existing 3P OpenSSL and zlib statically)
- Update AWSNativeSDK to only use the built static version of curl (libcurl.a) for both static and shared libraries
- Removed logic to build 2 versions of AWSNativeSDK into 1 package (one for system provided OpenSSL 1.1.1 and one for system provided 3.0)
- Generalize the build-linux.sh script for AWSNativeSDK
- Update the Linux package for AWSNativeSDK

Updates for AWSGameliftServer 3P packaging
- Add direct dependency to existing 3P packages for OpenSSL (instead of linking to system versions)
- Update AWSGameliftServer to link against the static versions of the existing 3P packages
- Removed logic to build 2 versions of AWSGameliftServer into 1 package
- Generalize the build-linux.sh script for AWSGameliftServer
- Remove OpenSSL check from FindAWSGameLiftServerSDK.cmake.Linux
- Update the Linux package for AWSGameliftServer
- Add linux testing of the new built package

Updates for Python 3.10.5 for Linux
- Add O3DE package dependencies (depends_on_packages) for python on Linux for OpenSSL and SQLite rather than relying on system libraries from the docker image
- Consolidate Dockerfile.aarch64 and Dockerfile.x86_64 into Dockerfile.linux
- Update 'build-linux.sh' for python
    - Accept additional arguments for architecture and docker base
    - Accept more generalized environments
    - Update logging and messaging
- Update the docker_build_linux.sh
    - Use the 'depends_on_packages' for use with cpython builds (Both are static libs and will eliminate the need for separate distribution of those shared libs)
     - Update 'setuptools' to resolve https://avd.aquasec.com/nvd/cve-2022-40897    
    - Update 'wheel' to resolve https://avd.aquasec.com/nvd/2022/cve-2022-40898/
- Bump revision to 'rev4'
Steve Pham 2 年之前
父節點
當前提交
f7712ed44c
共有 36 個文件被更改,包括 1806 次插入722 次删除
  1. 42 28
      Scripts/extras/pull_and_build_from_git.py
  2. 20 15
      package-system/AWSGameLiftServerSDK/Dockerfile
  3. 4 13
      package-system/AWSGameLiftServerSDK/FindAWSGameLiftServerSDK.cmake.Linux
  4. 124 116
      package-system/AWSGameLiftServerSDK/build-linux.sh
  5. 17 7
      package-system/AWSGameLiftServerSDK/build_config.json
  6. 72 18
      package-system/AWSGameLiftServerSDK/docker_build_linux.sh
  7. 6 45
      package-system/AWSGameLiftServerSDK/install-linux.sh
  8. 55 0
      package-system/AWSGameLiftServerSDK/test-linux.sh
  9. 48 0
      package-system/AWSGameLiftServerSDK/test/CMakeLists.txt
  10. 28 0
      package-system/AWSGameLiftServerSDK/test/test_AWSGameLiftServer.cpp
  11. 32 4
      package-system/AWSNativeSDK/AWSNativeSDK-1.9.50-linux-openssl3.patch
  12. 32 12
      package-system/AWSNativeSDK/Dockerfile
  13. 6 14
      package-system/AWSNativeSDK/FindAWSNativeSDK.cmake.Linux
  14. 128 107
      package-system/AWSNativeSDK/build-linux.sh
  15. 16 2
      package-system/AWSNativeSDK/build_config.json
  16. 162 40
      package-system/AWSNativeSDK/docker_build_aws_sdk.sh
  17. 13 53
      package-system/AWSNativeSDK/install-linux.sh
  18. 52 0
      package-system/OpenSSL/Dockerfile
  19. 1 1
      package-system/OpenSSL/FindOpenSSL.cmake.template
  20. 218 0
      package-system/OpenSSL/build-linux.sh
  21. 56 0
      package-system/OpenSSL/build_config.json
  22. 76 0
      package-system/OpenSSL/docker_build_openssl.sh
  23. 66 0
      package-system/OpenSSL/install-linux.sh
  24. 57 0
      package-system/OpenSSL/test-linux.sh
  25. 108 4
      package-system/OpenSSL/test/test_OpenSSL.c
  26. 0 1
      package-system/Qt/Dockerfile
  27. 0 62
      package-system/python/Dockerfile.aarch64
  28. 63 0
      package-system/python/Dockerfile.linux
  29. 0 62
      package-system/python/Dockerfile.x86_64
  30. 116 47
      package-system/python/build-linux.sh
  31. 13 1
      package-system/python/build_config.json
  32. 144 45
      package-system/python/docker_build_linux.sh
  33. 6 6
      package-system/python/package-linux.sh
  34. 1 1
      package-system/python/test-linux.sh
  35. 8 6
      package_build_list_host_linux-aarch64.json
  36. 16 12
      package_build_list_host_linux.json

+ 42 - 28
Scripts/extras/pull_and_build_from_git.py

@@ -127,6 +127,7 @@ The following keys can only exist at the target platform level as they describe
 
 * custom_additional_libraries             : Any additional dependent system library to include in the find*.cmake file for the library that will
                                             applied to targets that consume this 3P library during linking
+* custom_additional_template_map          : Any additional custom template mappings to apply if a `cmake_find_template` was specified
 
 * depends_on_packages                     : list of name of 3-TUPLES of [package name, package hash, subfolder] that 'find' files live in]
                                             [  ["zlib-1.5.3-rev5",    "some hash", ""],
@@ -466,6 +467,33 @@ class BuildInfo(object):
         self.prebuilt_args = prebuilt_args
         self.skip_git = skip_git
 
+        # Prepare any cmake_find_template format parameters
+        def _build_list_str(indent, key):
+            list_items = self.platform_config.get(key, [])
+            indented_list_items = []
+            for list_item in list_items:
+                indented_list_items.append(f'{" "*(indent*4)}{list_item}')
+            return '\n'.join(indented_list_items)
+
+        cmake_find_template_def_ident_level = package_info.cmake_find_template_custom_indent
+
+        self.cmake_template_env = {
+            "CUSTOM_ADDITIONAL_COMPILE_DEFINITIONS": _build_list_str(cmake_find_template_def_ident_level, 'custom_additional_compile_definitions'),
+            "CUSTOM_ADDITIONAL_LINK_OPTIONS": _build_list_str(cmake_find_template_def_ident_level, 'custom_additional_link_options'),
+            "CUSTOM_ADDITIONAL_LIBRARIES": _build_list_str(cmake_find_template_def_ident_level, 'custom_additional_libraries')
+        }
+
+        # Apply any custom cmake template variable parameters
+        custom_additional_template_map = self.platform_config.get("custom_additional_template_map", {})
+        if custom_additional_template_map:
+            # Validate that the custom map does not include reserved template variables
+            reserved_keys = self.cmake_template_env.keys()
+            for custom_template_variable in custom_additional_template_map.items():
+                if custom_template_variable[0] in reserved_keys:
+                    raise BuildError(f"Invalid entry in 'custom_additional_template_map' build config. Reserved word '{custom_template_variable[0]}' not permitted")
+                self.cmake_template_env[custom_template_variable[0]] = custom_template_variable[1]
+
+
 
     def clone_to_local(self):
         """
@@ -956,22 +984,7 @@ class BuildInfo(object):
 
             template_file_content = self.cmake_find_template.read_text("UTF-8", "ignore")
 
-            def _build_list_str(indent, key):
-                list_items = self.platform_config.get(key, [])
-                indented_list_items = []
-                for list_item in list_items:
-                    indented_list_items.append(f'{" "*(indent*4)}{list_item}')
-                return '\n'.join(indented_list_items)
-
-            cmake_find_template_def_ident_level = self.package_info.cmake_find_template_custom_indent
-
-            template_env = {
-                "CUSTOM_ADDITIONAL_COMPILE_DEFINITIONS": _build_list_str(cmake_find_template_def_ident_level, 'custom_additional_compile_definitions'),
-                "CUSTOM_ADDITIONAL_LINK_OPTIONS": _build_list_str(cmake_find_template_def_ident_level, 'custom_additional_link_options'),
-                "CUSTOM_ADDITIONAL_LIBRARIES": _build_list_str(cmake_find_template_def_ident_level, 'custom_additional_libraries')
-            }
-
-            find_cmake_content = string.Template(template_file_content).substitute(template_env)
+            find_cmake_content = string.Template(template_file_content).substitute(self.cmake_template_env)
 
         elif self.cmake_find_source is not None:
             find_cmake_content = self.cmake_find_source.read_text("UTF-8", "ignore")
@@ -1028,23 +1041,24 @@ class BuildInfo(object):
         pass
 
     def test_package(self):
-        has_test_commands = self.check_build_keys(['custom_test_cmd'])
-        if not has_test_commands:
+
+        custom_test_cmd = self.platform_config.get('custom_test_cmd', [])
+        if not custom_test_cmd:
             print(f"\n\nNo tests defined, skipping test phase.")
             return
 
-        print(f"\n\nRunning Tests...")
+        # Construct the custom build command to execute
+        full_custom_test_cmd = shlex.join(custom_test_cmd).format(python=sys.executable)
+        print(f"\n\nRunning custom test...")
 
-        custom_test_cmds= self.platform_config.get('custom_test_cmd', [])
-        for custom_test_cmd in custom_test_cmds:
+        call_result = subprocess.run(full_custom_test_cmd,
+                                    shell=True,
+                                    capture_output=False,
+                                    cwd=str(self.base_folder),
+                                    env=self.create_custom_env())
+        if call_result.returncode != 0:
+            raise BuildError(f"Error executing custom test command {custom_test_cmd}")
 
-            call_result = subprocess.run(custom_test_cmd,
-                                        shell=True,
-                                        capture_output=False,
-                                        cwd=str(self.base_folder),
-                                        env=self.create_custom_env())
-            if call_result.returncode != 0:
-                raise BuildError(f"Error executing custom test command {custom_test_cmd}")
         print(f"\n... Tests OK!")
 
     def execute(self):

+ 20 - 15
package-system/AWSGameLiftServerSDK/Dockerfile

@@ -5,20 +5,33 @@
 # SPDX-License-Identifier: Apache-2.0 OR MIT
 #
 
-# This docker file uses ubuntu 22.04 as the base image so that the AWS Native C++ libraries will use OpenSSL 3 as the base
-# for its dependencies
-#
-
 
+# The cpu architecture to base the docker base script from
 ARG INPUT_ARCHITECTURE=amd64
+
+# The root to base the docker script base from
 ARG INPUT_IMAGE=ubuntu:20.04
-ARG INPUT_DOCKER_BUILD_SCRIPT
+
+# The build subfolder where the final artifacts are built in this container which will be used to copy the results out of
+ARG INPUT_BUILD_FOLDER=build
+
+# The name of the build script to copy to the docker image to execute
+ARG INPUT_DOCKER_BUILD_SCRIPT=build.sh
+
+# The optional environment variable for list of folders in the mapped temp folders that represent additional 3P dependent packages
+ARG INPUT_DEPENDENT_PACKAGE_FOLDERS
 
 FROM ${INPUT_ARCHITECTURE}/${INPUT_IMAGE}
 
 ARG INPUT_DOCKER_BUILD_SCRIPT
+ARG INPUT_BUILD_FOLDER
+ARG INPUT_DEPENDENT_PACKAGE_FOLDERS
+
+ENV WORKSPACE=/data/workspace
+ENV DOCKER_BUILD_PATH=$WORKSPACE/$INPUT_BUILD_FOLDER
+ENV DOWNLOADED_PACKAGE_FOLDERS=$INPUT_DEPENDENT_PACKAGE_FOLDERS
 
-WORKDIR /data/workspace
+WORKDIR $WORKSPACE
 
 # Initilize apt cache
 RUN apt-get clean && apt-get update
@@ -30,19 +43,11 @@ RUN DEBIAN_FRONTEND="noninteractive" apt-get -y install tzdata locales keyboard-
 RUN apt-get install -y build-essential \
                        git \
                        cmake \
-                       python3 \
-                       ninja-build \
-                       libssl-dev
+                       python3
 
 # Prevent the copying of the src folder from being cached
 ARG CACHEBUST=1
 
-RUN cd /data/workspace && \
-    mkdir src
-
-# Copy the git synced source from the context base to this container
-COPY src  /data/workspace/src/
-
 # Copy the build script specific to this Docker script in order to execute the build
 COPY ${INPUT_DOCKER_BUILD_SCRIPT} /data/workspace/
 

+ 4 - 13
package-system/AWSGameLiftServerSDK/FindAWSGameLiftServerSDK.cmake.Linux

@@ -14,30 +14,21 @@ if (TARGET ${TARGET_WITH_NAMESPACE})
     return()
 endif()
 
-if ("${OPENSSL_VERSION}" STREQUAL "")
-    message(FATAL_ERROR "OpenSSL not detected. The OpenSSL dev package is required for O3DE")
-elseif ("${OPENSSL_VERSION}" VERSION_LESS "3.0.0")
-    set(SRC_OPENSSL_BASE openssl-1)
-else()
-    set(SRC_OPENSSL_BASE openssl-3)
-endif()
-
-
 set(LIB_NAME "AWSGameLiftServerSDK")
 
 set(${LIB_NAME}_INCLUDE_DIR ${CMAKE_CURRENT_LIST_DIR}/${LIB_NAME}/include)
 
 if (LY_MONOLITHIC_GAME)
-    set(AWSGAMELIFTSERVERSDK_LIB_PATH ${CMAKE_CURRENT_LIST_DIR}/${LIB_NAME}/lib/${SRC_OPENSSL_BASE})
+    set(AWSGAMELIFTSERVERSDK_LIB_PATH ${CMAKE_CURRENT_LIST_DIR}/${LIB_NAME}/lib)
 
     set(AWSGAMELIFTSERVERSDK_LIBS
-        ${AWSGAMELIFTSERVERSDK_LIB_PATH}/libaws-cpp-sdk-gamelift-server.a
+        ${AWSGAMELIFTSERVERSDK_LIB_PATH}/${CMAKE_STATIC_LIBRARY_PREFIX}aws-cpp-sdk-gamelift-server${CMAKE_STATIC_LIBRARY_SUFFIX}
     )
 else()
-    set(AWSGAMELIFTSERVERSDK_LIB_PATH ${CMAKE_CURRENT_LIST_DIR}/${LIB_NAME}/bin//${SRC_OPENSSL_BASE})
+    set(AWSGAMELIFTSERVERSDK_LIB_PATH ${CMAKE_CURRENT_LIST_DIR}/${LIB_NAME}/bin/)
 
     set(AWSGAMELIFTSERVERSDK_LIBS
-        ${AWSGAMELIFTSERVERSDK_LIB_PATH}/libaws-cpp-sdk-gamelift-server.so
+        ${AWSGAMELIFTSERVERSDK_LIB_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}aws-cpp-sdk-gamelift-server${CMAKE_SHARED_LIBRARY_SUFFIX}
     )
 endif()
 

+ 124 - 116
package-system/AWSGameLiftServerSDK/build-linux.sh

@@ -7,24 +7,67 @@
 # SPDX-License-Identifier: Apache-2.0 OR MIT
 #
 
-# This script will utilize Docker to build on either AMD64 or AARCH64 architectures. The script will 
-# also build on both Ubuntu 20.04 (focal) and Ubuntu 22.04 (jammy) systems because of the dependencies
-# on OpenSSL 1.1.1 and Open 3.0 respectively
+# This script will utilize Docker to build on either AMD64 or AARCH64 architectures. 
 
-DOCKER_IMAGE_NAME_BASE=aws_gamelift_server_sdk
 DOCKER_BUILD_SCRIPT=docker_build_linux.sh
+TARGET_BUILD_FOLDER=build
+
+#
+# Collect the required arguments for this ubuntu docker-base build script
+#
+
+# Get the base docker image name
+DOCKER_IMAGE_NAME_BASE=$1
+if [ "${DOCKER_IMAGE_NAME_BASE}" == "" ]
+then
+    echo "Missing argument 1: Docker image name for this process"
+    exit 1
+fi
+
+# Get the ubuntu base version (20.04|22.04)
+UBUNTU_BASE=$2
+if [ "${UBUNTU_BASE}" == "" ]
+then
+    echo "Missing argument 2: Ubuntu docker tag"
+    exit 1
+fi
 
 # Determine the host architecture
 CURRENT_HOST_ARCH=$(uname -m)
 
-# Get the path within the source tarball to the root of the source folder for the build
-SDK_SRC_SUBPATH=${1:-.}
-
 # Use the host architecture if not supplied
-TARGET_ARCH=${2:-$(uname -m)}
+TARGET_ARCH=${3:-$(uname -m)}
+
+# Recompute the DOWNLOADED_PACKAGE_FOLDERS to apply to $WORKSPACE/temp inside the Docker script 
+DEP_PACKAGES_FOLDERNAMES_ONLY=${DOWNLOADED_PACKAGE_FOLDERS//$TEMP_FOLDER\//}
+DEP_PACKAGES_DOCKER_FOLDERNAMES=${DOWNLOADED_PACKAGE_FOLDERS//$TEMP_FOLDER/"/data/workspace/temp"}
+
+echo "Executing docker-based build from the following arguments"
+echo "    DOCKER_IMAGE_NAME_BASE     = ${DOCKER_IMAGE_NAME_BASE}"
+echo "    UBUNTU_BASE                = ${UBUNTU_BASE}"
+echo "    DOCKER_BUILD_SCRIPT        = ${DOCKER_BUILD_SCRIPT}"
+echo "    TARGET_BUILD_FOLDER        = ${TARGET_BUILD_FOLDER}"
+echo "    TARGET_ARCH                = ${TARGET_ARCH}"
+echo "    TEMP_FOLDER                = ${TEMP_FOLDER}"
+echo "    DOWNLOADED_PACKAGE_FOLDERS = ${DEP_PACKAGES_FOLDERNAMES_ONLY}"
 
-# Prepare the target install path
-INSTALL_PACKAGE_PATH=${TEMP_FOLDER}/install/
+
+
+#
+# Make sure docker is installed
+#
+DOCKER_VERSION=$(docker --version)
+if [ $? -ne 0 ]
+then
+    echo "Required package docker is not installed"
+    echo "Follow instructions on https://docs.docker.com/engine/install/ubuntu/ to install docker properly"
+    exit 1
+fi
+echo "Detected Docker Version $DOCKER_VERSION"
+
+# 
+# Check the target architecture and determine if the necessary cross compilation requirements are met
+#
 
 # If the host and target architecture does not match, make sure the necessary cross compilation packages are installed
 if [ "${CURRENT_HOST_ARCH}" != ${TARGET_ARCH} ]
@@ -66,16 +109,6 @@ else
     echo "Building ${TARGET_ARCH} natively."
 fi
 
-# Make sure docker is installed
-DOCKER_VERSION=$(docker --version)
-if [ $? -ne 0 ]
-then
-    echo "Required package docker is not installed"
-    echo "Follow instructions on https://docs.docker.com/engine/install/ubuntu/ to install docker properly"
-    exit 1
-fi
-echo "Detected Docker Version $DOCKER_VERSION"
-
 
 # Setup the docker arguments 
 if [ "${TARGET_ARCH}" = "x86_64" ]
@@ -84,7 +117,6 @@ then
 
     DOCKER_INPUT_ARCHITECTURE=amd64
     TARGET_DOCKER_PLATFORM_ARG=linux/amd64
-    DOCKER_BUILD_ARG=1
 
 elif [ "${TARGET_ARCH}" = "aarch64" ] 
 then
@@ -92,125 +124,101 @@ then
 
     DOCKER_INPUT_ARCHITECTURE=arm64v8
     TARGET_DOCKER_PLATFORM_ARG=linux/arm64/v8
-    DOCKER_BUILD_ARG=3
+
 else
     echo "Unsupported architecture ${TARGET_ARCH}"
     exit 1
 fi
 
-# Prepare to build on both Ubuntu 20.04 and Ubuntu 22.04 based docker images
-
+# 
+# Prepare the docker base context based on ${TEMP_FOLDER} 
 mkdir -p ${TEMP_FOLDER}
 cp -f ${DOCKER_BUILD_SCRIPT} ${TEMP_FOLDER}/
 
-# Args
-# $1 : Ubuntu version
-# $2 : Include
-# $3 : Docker run platform
+echo "Building on ubuntu public.ecr.aws/ubuntu/ubuntu:${UBUNTU_BASE}"
 
-function execute_docker() {
+# Build the Docker Image 
+DOCKER_IMAGE_NAME=${DOCKER_IMAGE_NAME_BASE}_${DOCKER_INPUT_ARCHITECTURE}_3p
+echo DOCKER_IMAGE_NAME=${DOCKER_IMAGE_NAME}
 
-    # Determine the openssl version based on the ubuntu version (20.04/OpenSSL 1.1.1.x vs 22.04/OpenSSL 3.x)
-    if [ $1 = "20.04" ]
-    then
-        echo "Preparing for OpenSSL 1.1.1.x version"
-        BIN_SUBFOLDER_NAME=openssl-1
-    elif [ $1 = "22.04" ]
-    then
-        echo "Preparing for OpenSSL 3.x version"
-        BIN_SUBFOLDER_NAME=openssl-3
-    else
-        echo "Unsupported base build image ubuntu version ${1}"
-        exit 1
-    fi
+echo "Building the docker build script for ${DOCKER_IMAGE_NAME_BASE} on ${DOCKER_INPUT_ARCHITECTURE} for Ubuntu $1"
+echo ""
 
-    # Build the Docker Image 
-    DOCKER_IMAGE_NAME=${DOCKER_IMAGE_NAME_BASE}_focal_${DOCKER_INPUT_ARCHITECTURE}_3p
+CMD_DOCKER_BUILD="\
+docker build --build-arg INPUT_DOCKER_BUILD_SCRIPT=${DOCKER_BUILD_SCRIPT}\
+ --build-arg INPUT_ARCHITECTURE=${DOCKER_INPUT_ARCHITECTURE}\
+ --build-arg INPUT_IMAGE=ubuntu:${UBUNTU_BASE}\
+ --build-arg INPUT_DEPENDENT_PACKAGE_FOLDERS=${DEP_PACKAGES_DOCKER_FOLDERNAMES}\
+ -f Dockerfile -t ${DOCKER_IMAGE_NAME}:latest temp "
 
-    echo "Building the docker build script for ${DOCKER_IMAGE_NAME_BASE} on ${DOCKER_INPUT_ARCHITECTURE} for Ubuntu $1"
-    echo ""
-    echo docker build --build-arg INPUT_DOCKER_BUILD_SCRIPT=${DOCKER_BUILD_SCRIPT} \
-                 --build-arg INPUT_ARCHITECTURE=${DOCKER_INPUT_ARCHITECTURE} \
-                 --build-arg INPUT_IMAGE=ubuntu:${1} \
-                 -f Dockerfile -t ${DOCKER_IMAGE_NAME}:latest temp 
-    docker build --build-arg INPUT_DOCKER_BUILD_SCRIPT=${DOCKER_BUILD_SCRIPT} \
-                 --build-arg INPUT_ARCHITECTURE=${DOCKER_INPUT_ARCHITECTURE} \
-                 --build-arg INPUT_IMAGE=ubuntu:${1} \
-                 -f Dockerfile -t ${DOCKER_IMAGE_NAME}:latest temp 
-    if [ $? -ne 0 ]
-    then
-        echo "Error occurred creating Docker image ${DOCKER_IMAGE_NAME}:latest." 
-        exit 1
-    fi
+echo $CMD_DOCKER_BUILD
+eval $CMD_DOCKER_BUILD
+if [ $? -ne 0 ]
+then
+    echo "Error occurred creating Docker image ${DOCKER_IMAGE_NAME}:latest." 
+    exit 1
+fi
 
-    # Run the build script in the docker image
-    echo "Running build script in the docker image ${DOCKER_IMAGE_NAME}"
-    echo ""
-    echo docker run --platform ${TARGET_DOCKER_PLATFORM_ARG} \
-                   -it --tty \
-                   ${DOCKER_IMAGE_NAME}:latest /data/workspace/${DOCKER_BUILD_SCRIPT} ${SDK_SRC_SUBPATH}
-    docker run --platform ${TARGET_DOCKER_PLATFORM_ARG} \
-               --tty \
-               ${DOCKER_IMAGE_NAME}:latest /data/workspace/${DOCKER_BUILD_SCRIPT} ${SDK_SRC_SUBPATH}
-    if [ $? -ne 0 ]
-    then
-        echo Failed to build from docker image ${DOCKER_IMAGE_NAME}:latest
-        echo "To log into and troubleshoot the docker container, run the following command:"
-        echo ""
-        echo "docker run --platform ${TARGET_DOCKER_PLATFORM_ARG} -it --tty ${DOCKER_IMAGE_NAME}:latest"
-        echo ""
-        exit 1
-    fi
+# Prepare the target build folder to copy from the docker container on successful run of the docker script
+INSTALL_PACKAGE_PATH=${TEMP_FOLDER}/${TARGET_BUILD_FOLDER}/
 
-    echo "Build Complete"
+# Run the build script in the docker image
+echo "Running build script in the docker image ${DOCKER_IMAGE_NAME}"
+echo ""
 
-    # Copy the build artifacts from the docker image
+CMD_DOCKER_RUN="\
+docker run --platform ${TARGET_DOCKER_PLATFORM_ARG}\
+ --tty\
+ -v ${TEMP_FOLDER}:/data/workspace/temp:ro\
+ ${DOCKER_IMAGE_NAME}:latest /data/workspace/${DOCKER_BUILD_SCRIPT}"
 
-    # Capture the Docker Image ID
-    IMAGE_ID=$(docker images -q ${DOCKER_IMAGE_NAME}:latest)
-    if [ -z $IMAGE_ID ]
-    then
-        echo "Error: Cannot find Image ID for ${DOCKER_IMAGE_NAME}"
-        exit 1
-    fi
+echo $CMD_DOCKER_RUN
+eval $CMD_DOCKER_RUN
+if [ $? -ne 0 ]
+then
+    echo Failed to build from docker image ${DOCKER_IMAGE_NAME}:latest
+    echo "To log into and troubleshoot the docker container, run the following command:"
+    echo ""
+    echo "docker run --platform ${TARGET_DOCKER_PLATFORM_ARG} -it --tty -v ${TEMP_FOLDER}:/data/workspace/temp:ro ${DOCKER_IMAGE_NAME}:latest"
+    echo ""
+    exit 1
+fi
 
-    # Capture the container ID
-    echo "Capturing the Container ID"
-    CONTAINER_ID=$(docker container ls -l -q --filter "ancestor=${DOCKER_IMAGE_NAME}:latest")
-    if [ -z $CONTAINER_ID ]
-    then
-        echo "Error: Cannot find Container ID for Image ${DOCKER_IMAGE_NAME}"
-        exit 1
-    fi
+echo "Build Complete"
 
-    DOCKER_BUILD_ROOT=/data/workspace/build/
+# Copy the build artifacts from the docker image
 
-    if [ ! -f ${INSTALL_PACKAGE_PATH}/include ]
-    then
-        docker cp $CONTAINER_ID:${DOCKER_BUILD_ROOT}/build_static/prefix/include  ${INSTALL_PACKAGE_PATH}/
-    fi
-    if [ ! -f ${INSTALL_PACKAGE_PATH}/cmake ]
-    then
-        docker cp $CONTAINER_ID:${DOCKER_BUILD_ROOT}/build_static/prefix/cmake  ${INSTALL_PACKAGE_PATH}/
-    fi
+# Capture the Docker Image ID
+IMAGE_ID=$(docker images -q ${DOCKER_IMAGE_NAME}:latest)
+if [ -z $IMAGE_ID ]
+then
+    echo "Error: Cannot find Image ID for ${DOCKER_IMAGE_NAME}"
+    exit 1
+fi
 
-    docker cp $CONTAINER_ID:${DOCKER_BUILD_ROOT}/build_static/prefix/lib  ${INSTALL_PACKAGE_PATH}/lib/${BIN_SUBFOLDER_NAME}
-    docker cp $CONTAINER_ID:${DOCKER_BUILD_ROOT}/build_shared/prefix/lib  ${INSTALL_PACKAGE_PATH}/bin/${BIN_SUBFOLDER_NAME}
-}
+# Capture the container ID
+echo "Capturing the Container ID"
+CONTAINER_ID=$(docker container ls -l -q --filter "ancestor=${DOCKER_IMAGE_NAME}:latest")
+if [ -z $CONTAINER_ID ]
+then
+    echo "Error: Cannot find Container ID for Image ${DOCKER_IMAGE_NAME}"
+    exit 1
+fi
 
-rm -rf ${INSTALL_PACKAGE_PATH}
+DOCKER_BUILD_ROOT=/data/workspace/${TARGET_BUILD_FOLDER}
 
-mkdir -p ${INSTALL_PACKAGE_PATH}
-mkdir -p ${INSTALL_PACKAGE_PATH}/lib
-mkdir -p ${INSTALL_PACKAGE_PATH}/bin
 
-# Build for Ubuntu 20.04
-execute_docker 20.04 
+rm -rf ${INSTALL_PACKAGE_PATH}
+mkdir -p ${INSTALL_PACKAGE_PATH}
 
-# Build for Ubuntu 22.04
-execute_docker 22.04 
+echo "Copying from $CONTAINER_ID:${DOCKER_BUILD_ROOT} to ${TEMP_FOLDER}/"
+docker cp $CONTAINER_ID:${DOCKER_BUILD_ROOT}  ${TEMP_FOLDER}/ 
+if [ $? -ne 0 ]
+then
+    echo "Error copying build from docker image ${DOCKER_IMAGE_NAME}:latest." 
+    exit 1
+fi
 
-echo "Build successful"
+echo "Built ${DOCKER_IMAGE_NAME_BASE} into ${INSTALL_PACKAGE_PATH} successfully"
 
 exit 0
-

+ 17 - 7
package-system/AWSGameLiftServerSDK/build_config.json

@@ -2,7 +2,7 @@
     "src_package_url": "https://gamelift-release.s3-us-west-2.amazonaws.com/GameLift-SDK-Release-5.0.0.zip",
     "src_package_sha1": "25cfa89252a934925c14830ba75e91855bf02e5d",
     "package_name": "AWSGameLiftServerSDK",
-    "package_version": "5.0.0-rev2",
+    "package_version": "5.0.0-rev3",
     "package_url": "https://aws.amazon.com/documentation/gamelift/",
     "package_license": "Apache-2.0",
     "package_license_file": "GameLift-SDK-Release-5.0.0/GameLift-SDK-Release-5.0.0/GameLift-Cpp-ServerSDK-5.0.0/LICENSE_AMAZON_GAMELIFT_SDK.TXT",
@@ -10,29 +10,39 @@
     "Platforms": {
         "Linux": {
             "Linux":{
+                "depends_on_packages": [
+                    [ "OpenSSL-1.1.1t-rev1-linux", "63aea898b7afe8faccd0c7261e62d2f8b7b870f678a4520d5be81e5815542b39", "" ]
+                ],
                 "patch_file":"aws_gamelift_5.0.0.patch",
                 "cmake_find_source": "FindAWSGameLiftServerSDK.cmake.Linux",
                 "custom_build_cmd": [
                     "./build-linux.sh",
-                    "GameLift-SDK-Release-5.0.0/GameLift-SDK-Release-5.0.0/GameLift-Cpp-ServerSDK-5.0.0",
+                    "aws_gamelift_5_5_0",
+                    "20.04",
                     "x86_64"
                 ],
+                "custom_test_cmd" : [
+                   "./test-linux.sh",
+                   "x86_64"
+                ],
                 "custom_install_cmd": [
-                    "./install-linux.sh",
-                    "GameLift-SDK-Release-5.0.0/GameLift-SDK-Release-5.0.0/GameLift-Cpp-ServerSDK-5.0.0"
+                    "./install-linux.sh"
                 ]
               },
               "Linux-aarch64":  {
+                "depends_on_packages": [
+                    [ "OpenSSL-1.1.1t-rev1-linux-aarch64", "f32721bec9c82d1bd7fb244d78d5dc4e2a47e7b808bb36027236ad377e241ea5", "" ]
+                ],
                 "patch_file":"aws_gamelift_5.0.0.patch",
                 "cmake_find_source": "FindAWSGameLiftServerSDK.cmake.Linux",
                 "custom_build_cmd": [
                     "./build-linux.sh",
-                    "GameLift-SDK-Release-5.0.0/GameLift-SDK-Release-5.0.0/GameLift-Cpp-ServerSDK-5.0.0",
+                    "aws_gamelift_5_5_0",
+                    "20.04",
                     "aarch64"
                 ],
                 "custom_install_cmd": [
-                    "./install-linux.sh",
-                    "GameLift-SDK-Release-5.0.0/GameLift-SDK-Release-5.0.0/GameLift-Cpp-ServerSDK-5.0.0"
+                    "./install-linux.sh"
                 ]
             }
         }

+ 72 - 18
package-system/AWSGameLiftServerSDK/docker_build_linux.sh

@@ -7,16 +7,44 @@
 #
 
 
-WORKSPACE_DIR=/data/workspace
-SDK_SRC_SUBPATH=${1:-.}
-SRC_PATH=${WORKSPACE_DIR}/src/${SDK_SRC_SUBPATH}
+# Validate the bld path input
+BUILD_FOLDER=${DOCKER_BUILD_PATH}
+if [ "${BUILD_FOLDER}" == "" ]
+then
+    echo "Missing required build target folder environment"
+    exit 1
+elif [ "${BUILD_FOLDER}" == "temp" ]
+then
+    echo "Build target folder environment cannot be 'temp'"
+    exit 1
+fi
+
+# Copy the source folder from the read-only $WORKSPACE/temp/src to $WORKSPACE/src
+# since the build process will write/modify the source path
+echo "Preparing source folder '$WORKSPACE/src'"
+cp -r $WORKSPACE/temp/src/GameLift-SDK-Release-5.0.0/GameLift-SDK-Release-5.0.0/GameLift-Cpp-ServerSDK-5.0.0 $WORKSPACE/src || (echo "Error copying src from $WORKSPACE/temp" && exit 1)
+
+SRC_PATH=$WORKSPACE/src
 
 if [ ! -d ${SRC_PATH} ]
 then
-    echo "Unable to locate source path at ${SRC_PATH}"
+    echo "Missing expected source path at ${SRC_PATH}"
     exit 1
 fi
 
+# Prepare the build root
+BUILD_PATH_ROOT=${WORKSPACE}/aws/build
+if [ -d ${BUILD_PATH_ROOT} ]
+then
+    rm -rf ${BUILD_PATH_ROOT}
+fi
+mkdir -p ${BUILD_PATH_ROOT}
+
+# Apply an additional linker flag option to resolve 'undefined reference to `dlopen' errors
+export LDFLAGS="-Wl,--no-as-needed -ldl"
+
+echo "Preparing BUILD_PATH_ROOT '${BUILD_PATH_ROOT}'"
+
 # Perform a cmake project generation and build
 # 
 # Arguments:
@@ -27,35 +55,61 @@ build_package() {
 
     echo "Generating $1"
 
-    cmake -G Ninja -S ${SRC_PATH} -B $1 -DBUILD_SHARED_LIBS=$2 -DCMAKE_BUILD_TYPE=Release
+    lib_type=$1
+    if [ "$lib_type" == "Shared" ]
+    then
+        build_shared=ON
+    else
+        build_shared=OFF
+    fi
+    CMD_CMAKE_GENERATE="\
+    cmake -S ${SRC_PATH} -B ${BUILD_PATH_ROOT}/${lib_type} \
+          -G \"Unix Makefiles\" \
+          -DBUILD_SHARED_LIBS=$build_shared \
+          -DCMAKE_BUILD_TYPE=Release \
+          -DCMAKE_MODULE_PATH=$DOWNLOADED_PACKAGE_FOLDERS"
+    echo $CMD_CMAKE_GENERATE
+    eval $CMD_CMAKE_GENERATE
     if [ $? -ne 0 ]
     then
-        echo "Error generating AWS Gamelift Server SDK for $1" 
+        echo "Error generating AWS Gamelift Server SDK build" 
         exit 1
-    fi
-    cmake --build $1
+    fi          
+
+    CMD_CMAKE_BUILD="\
+    cmake --build ${BUILD_PATH_ROOT}/${lib_type}"
+    echo $CMD_CMAKE_BUILD
+    eval $CMD_CMAKE_BUILD
     if [ $? -ne 0 ]
     then
-        echo "Error building AWS Gamelift Server SDK for $1" 
+        echo "Error building the ${lib_type} configuration for AWS Gamelift Server SDK"
         exit 1
     fi
 
-    if [ ! -d $1/prefix ]
+    if [ ! -d ${BUILD_PATH_ROOT}/${lib_type}/prefix ]
     then
-        echo "Error installing AWS Gamelift Server SDK for $1" 
+        echo "Error locating built binaries at ${BUILD_PATH_ROOT}/${lib_type}/prefix"
         exit 1
     fi
 }
 
-BUILD_PATH_ROOT=${WORKSPACE_DIR}/build
+# Build the shared library file
+build_package Shared
+
+# Build the static library file
+build_package Static
+
+# Prepare the build folder to copy out of the docker image and copy the required build artifacts
+mkdir -p ${BUILD_FOLDER}
 
-#### Build Static ####
-echo "Building Static/Release ..."
-build_package ${BUILD_PATH_ROOT}/build_static OFF
+cp -r ${BUILD_PATH_ROOT}/Static/prefix/include ${BUILD_FOLDER}/
+cp -r ${BUILD_PATH_ROOT}/Static/prefix/cmake ${BUILD_FOLDER}/
+cp -r ${BUILD_PATH_ROOT}/Static/prefix/lib ${BUILD_FOLDER}/
+cp -r ${BUILD_PATH_ROOT}/Shared/prefix/lib ${BUILD_FOLDER}/bin
 
-#### Build Shared ####
-echo "Building Shared/Release..."
-build_package ${BUILD_PATH_ROOT}/build_shared ON
+# Copy the license and notice files
+cp $WORKSPACE/temp/src/GameLift-SDK-Release-5.0.0/GameLift-SDK-Release-5.0.0/GameLift-Cpp-ServerSDK-5.0.0/LICENSE_AMAZON_GAMELIFT_SDK.TXT ${BUILD_FOLDER}/
+cp $WORKSPACE/temp/src/GameLift-SDK-Release-5.0.0/GameLift-SDK-Release-5.0.0/GameLift-Cpp-ServerSDK-5.0.0/NOTICE_C++_AMAZON_GAMELIFT_SDK.TXT ${BUILD_FOLDER}/
 
 echo "Build Succeeded."
 

+ 6 - 45
package-system/AWSGameLiftServerSDK/install-linux.sh

@@ -9,58 +9,19 @@
 echo "TEMP_FOLDER=${TEMP_FOLDER}"
 echo "TARGET_INSTALL_ROOT=${TARGET_INSTALL_ROOT}"
 
-# Get the path within the source tarball to the root of the source folder for the build
-SDK_SRC_SUBPATH=${1:-.}
-
 # Get the install path from the build as the source for the final install package
-SRC_INSTALL_PACKAGE_PATH=${TEMP_FOLDER}/install/
+SRC_INSTALL_PACKAGE_PATH=${TEMP_FOLDER}/build/
 if [ ! -d ${SRC_INSTALL_PACKAGE_PATH} ]
 then
     echo "Invalid source package path ${SRC_INSTALL_PACKAGE_PATH}"
     exit 1
 fi
 
-# Copy an additional notice file
-ADDITIONAL_NOTICE_FILE=${TEMP_FOLDER}/src/${SDK_SRC_SUBPATH}/NOTICE_C++_AMAZON_GAMELIFT_SDK.TXT
-if [ ! -f ${ADDITIONAL_NOTICE_FILE} ]
-then
-    echo "Invalid source package path ${SRC_INSTALL_PACKAGE_PATH}"
-    exit 1
-fi
-echo "Copying the additional notice file ${ADDITIONAL_NOTICE_FILE} -> ${TARGET_INSTALL_ROOT}"
-cp ${TEMP_FOLDER}/src/${SDK_SRC_SUBPATH}/NOTICE_C++_AMAZON_GAMELIFT_SDK.TXT ${TARGET_INSTALL_ROOT}
-
-
-# Copy folder with messaging and error checks
-# 
-# Arguments:
-#   $1 : Source folder
-#   $2 : Destination folder
-copy_folder() {
-
-    SRC_FOLDER=$1
-    TGT_FOLDER=$2
-    if [ ! -d ${SRC_FOLDER} ]
-    then
-        echo "Invalid source folder copy path ${SRC_FOLDER}"
-        exit 1
-    fi
-    echo "Copying ${SRC_FOLDER} -> ${TGT_FOLDER}"
-    cp -r ${SRC_FOLDER} ${TGT_FOLDER}/
-    if [ $? -ne 0 ]
-    then
-        echo "Error copying ${SRC_FOLDER} -> ${TGT_FOLDER}"
-        exit 1
-    fi
-}
-
-copy_folder ${SRC_INSTALL_PACKAGE_PATH}/include ${TARGET_INSTALL_ROOT}/
-
-copy_folder ${SRC_INSTALL_PACKAGE_PATH}/cmake ${TARGET_INSTALL_ROOT}/
-
-copy_folder ${SRC_INSTALL_PACKAGE_PATH}/bin ${TARGET_INSTALL_ROOT}/
-
-copy_folder ${SRC_INSTALL_PACKAGE_PATH}/lib ${TARGET_INSTALL_ROOT}/
+cp -r ${SRC_INSTALL_PACKAGE_PATH}/include ${TARGET_INSTALL_ROOT}/
+cp -r ${SRC_INSTALL_PACKAGE_PATH}/cmake ${TARGET_INSTALL_ROOT}/
+cp -r ${SRC_INSTALL_PACKAGE_PATH}/bin ${TARGET_INSTALL_ROOT}/
+cp -r ${SRC_INSTALL_PACKAGE_PATH}/lib ${TARGET_INSTALL_ROOT}/
+cp -r ${SRC_INSTALL_PACKAGE_PATH}/NOTICE_C++_AMAZON_GAMELIFT_SDK.TXT ${TARGET_INSTALL_ROOT}/
 
 echo "Installation complete"
 

+ 55 - 0
package-system/AWSGameLiftServerSDK/test-linux.sh

@@ -0,0 +1,55 @@
+#!/bin/bash
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+#
+
+
+# Reset any existing test folder
+rm -rf temp/build_test
+mkdir temp/build_test
+
+# Make sure we are running on the target architecture
+TARGET_ARCH=${1:-$(uname -m)}
+
+CURRENT_HOST_ARCH=$(uname -m)
+if [ "${CURRENT_HOST_ARCH}" != ${TARGET_ARCH} ]
+then
+    echo "Warning: Tests for packages on target ${TARGET_ARCH} can only be run on ${TARGET_ARCH}. Skipping tests."
+    exit 0
+fi
+
+echo "TEMP=${TEMP_FOLDER}"
+
+TEST_CMAKE_MODULE_PATH="${TEMP_FOLDER}/OpenSSL-1.1.1t-rev1-linux;$PACKAGE_ROOT"
+echo "TEST_CMAKE_MODULE_PATH=${TEST_CMAKE_MODULE_PATH}"
+
+# Build the test program
+cmake -S test -B temp/build_test -DCMAKE_MODULE_PATH="$TEST_CMAKE_MODULE_PATH" -DCMAKE_BUILD_TYPE=Release
+if [ $? -ne 0 ]
+then
+    echo "Error generating the test project"
+    exit 1
+fi
+
+cmake --build temp/build_test -v
+if [ $? -ne 0 ]
+then
+    echo "Error building the test project"
+    exit 1
+fi
+
+echo Executing test_AWSGameLift 
+./temp/build_test/test_AWSGameLift 
+if [ $? -ne 0 ]
+then
+    echo "Package test failed"
+    exit 1
+fi
+
+echo "Package test passed"
+
+exit 0

+ 48 - 0
package-system/AWSGameLiftServerSDK/test/CMakeLists.txt

@@ -0,0 +1,48 @@
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+# 
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+#
+
+cmake_minimum_required(VERSION 3.20)
+
+
+# The 3P package uses an O3DE custom cmake function 'ly_target_include_system_directories'. Duplicate it here 
+function(ly_target_include_system_directories)
+
+    set(options)
+    set(oneValueArgs TARGET)
+    set(multiValueArgs)
+
+    cmake_parse_arguments(ly_target_include_system_directories "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
+
+    if(NOT ly_target_include_system_directories_TARGET)
+        message(FATAL_ERROR "Target not provided")
+    endif()
+
+    target_compile_options(${ly_target_include_system_directories_TARGET}
+        INTERFACE
+            ${LY_CXX_SYSTEM_INCLUDE_CONFIGURATION_FLAG}
+    )
+
+    target_include_directories(${ly_target_include_system_directories_TARGET} SYSTEM ${ly_target_include_system_directories_UNPARSED_ARGUMENTS})
+endfunction()
+
+
+# The 3P package uses an O3DE custom cmake function 'ly_add_dependencies'. It is used to mark dependencies that need to be
+# copied to the final executable path, but that is not needed here, so just stub out
+function(ly_add_dependencies TARGET)
+
+endfunction()
+
+
+PROJECT(test_AWSGameLift VERSION 1.0 LANGUAGES CXX)
+
+find_package(OpenSSL)
+find_package(AWSGameLiftServerSDK)
+
+add_executable(test_AWSGameLift test_AWSGameLiftServer.cpp)
+
+target_link_libraries(test_AWSGameLift PRIVATE 3rdParty::OpenSSL 3rdParty::AWSGameLiftServerSDK)

+ 28 - 0
package-system/AWSGameLiftServerSDK/test/test_AWSGameLiftServer.cpp

@@ -0,0 +1,28 @@
+/*
+ Copyright (c) Contributors to the Open 3D Engine Project.
+ For complete copyright and license terms please see the LICENSE at the root of this distribution.
+
+ SPDX-License-Identifier: Apache-2.0 OR MIT
+*/
+
+#include <stdio.h>
+#include <string.h>
+
+#include <aws/gamelift/server/GameLiftServerAPI.h>
+
+int main(int argc, char* argv[])
+{
+    printf("Testing AWSGameliftServerSDK package...\n");
+
+    auto serverVersionResult = Aws::GameLift::Server::GetSdkVersion();
+    if (!serverVersionResult.IsSuccess())
+    {
+        printf("Failed to get AWSGameliftServerSDK version\n");
+        return 1;
+    }
+
+    auto game_lift_version = serverVersionResult.GetResult();
+    printf("AWSGameLiftSDK version %s\n", game_lift_version.c_str());
+
+    return 0;
+}

+ 32 - 4
package-system/AWSNativeSDK/AWSNativeSDK-1.9.50-linux-openssl3.patch

@@ -1,5 +1,33 @@
+diff --git a/aws-cpp-sdk-core/CMakeLists.txt b/aws-cpp-sdk-core/CMakeLists.txt
+index 17b4e46442..f71a925288 100644
+--- a/aws-cpp-sdk-core/CMakeLists.txt
++++ b/aws-cpp-sdk-core/CMakeLists.txt
+@@ -100,7 +100,22 @@ include(CheckCXXSourceRuns)
+ if(ENABLE_CURL_CLIENT)
+     file(GLOB HTTP_CURL_CLIENT_HEADERS "include/aws/core/http/curl/*.h")
+     file(GLOB HTTP_CURL_CLIENT_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/source/http/curl/*.cpp")
+-    set(CMAKE_REQUIRED_LIBRARIES ${CURL_LIBRARIES})
++
++    set(CMAKE_REQUIRED_INCLUDES ${CURL_INCLUDE_DIR})
++
++    set(REQUIRED_CURL_TEST_LIBRARIES ${CURL_LIBRARIES})
++
++    get_filename_component(DEP_CURL_FILE_EXTN ${CURL_LIBRARY} EXT)
++
++    if(DEP_CURL_FILE_EXTN STREQUAL ".a")
++        message("Adding additional static dependencies for curl")
++        LIST(APPEND REQUIRED_CURL_TEST_LIBRARIES ${OPENSSL_LIBRARIES})
++        LIST(APPEND REQUIRED_CURL_TEST_LIBRARIES ${ZLIB_LIBRARIES})
++        SET(CMAKE_REQUIRED_FLAGS "-pthread -ldl")
++    endif()
++
++    set(CMAKE_REQUIRED_LIBRARIES ${REQUIRED_CURL_TEST_LIBRARIES})
++
+     set(CHECK_CURL_HAS_H2 "
+     #include <curl/curl.h>
+     int main() {
 diff --git a/aws-cpp-sdk-core/source/utils/crypto/openssl/CryptoImpl.cpp b/aws-cpp-sdk-core/source/utils/crypto/openssl/CryptoImpl.cpp
-index 3855dda43e..87c75f2db1 100644
+index af3e33e045..228625417e 100644
 --- a/aws-cpp-sdk-core/source/utils/crypto/openssl/CryptoImpl.cpp
 +++ b/aws-cpp-sdk-core/source/utils/crypto/openssl/CryptoImpl.cpp
 @@ -51,6 +51,11 @@ namespace Aws
@@ -14,7 +42,7 @@ index 3855dda43e..87c75f2db1 100644
  
  #if OPENSSL_VERSION_LESS_1_1
                  static const char* OPENSSL_INTERNALS_TAG = "OpenSSLCallbackState";
-@@ -412,8 +417,11 @@ namespace Aws
+@@ -328,8 +333,11 @@ namespace Aws
                  HMACRAIIGuard() {
  #if OPENSSL_VERSION_LESS_1_1
                      m_ctx = Aws::New<HMAC_CTX>("AllocSha256HAMCOpenSSLContext");
@@ -27,7 +55,7 @@ index 3855dda43e..87c75f2db1 100644
  #endif
                      assert(m_ctx != nullptr);
                  }
-@@ -421,17 +429,28 @@ namespace Aws
+@@ -337,17 +345,28 @@ namespace Aws
                  ~HMACRAIIGuard() {
  #if OPENSSL_VERSION_LESS_1_1
                      Aws::Delete<HMAC_CTX>(m_ctx);
@@ -57,7 +85,7 @@ index 3855dda43e..87c75f2db1 100644
              };
  
              HashResult Sha256HMACOpenSSLImpl::Calculate(const ByteBuffer& toSign, const ByteBuffer& secret)
-@@ -441,20 +460,36 @@ namespace Aws
+@@ -357,20 +376,36 @@ namespace Aws
                  memset(digest.GetUnderlyingData(), 0, length);
  
                  HMACRAIIGuard guard;

+ 32 - 12
package-system/AWSNativeSDK/Dockerfile

@@ -6,15 +6,38 @@
 #
 
 
+# The cpu architecture to base the docker base script from
 ARG INPUT_ARCHITECTURE=amd64
+
+# The root to base the docker script base from
 ARG INPUT_IMAGE=ubuntu:20.04
-ARG INPUT_DOCKER_BUILD_SCRIPT
+
+# The build subfolder where the final artifacts are built in this container which will be used to copy the results out of
+ARG INPUT_BUILD_FOLDER=build
+
+# The name of the build script to copy to the docker image to execute
+ARG INPUT_DOCKER_BUILD_SCRIPT=build.sh
+
+# The git tag to use for the branch for cloning curl from git
+ARG INPUT_DEP_CURL_GIT_TAG
+
+# The optional environment variable for list of folders in the mapped temp folders that represent additional 3P dependent packages
+ARG INPUT_DEPENDENT_PACKAGE_FOLDERS
+
 
 FROM ${INPUT_ARCHITECTURE}/${INPUT_IMAGE}
 
 ARG INPUT_DOCKER_BUILD_SCRIPT
+ARG INPUT_BUILD_FOLDER
+ARG INPUT_DEPENDENT_PACKAGE_FOLDERS
+ARG INPUT_DEP_CURL_GIT_TAG
+
+ENV WORKSPACE=/data/workspace
+ENV DOCKER_BUILD_PATH=$WORKSPACE/$INPUT_BUILD_FOLDER
+ENV DOWNLOADED_PACKAGE_FOLDERS=$INPUT_DEPENDENT_PACKAGE_FOLDERS
+
 
-WORKDIR /data/workspace
+WORKDIR $WORKSPACE
 
 # Initilize apt cache
 RUN apt-get clean && apt-get update
@@ -26,20 +49,17 @@ RUN DEBIAN_FRONTEND="noninteractive" apt-get -y install tzdata locales keyboard-
 RUN apt-get install -y cmake \
                        clang-12 \
                        ninja-build \
-                       libssl-dev \
-                       libssh-dev \
-                       zlib1g-dev \
-                       libcurl4-openssl-dev
+                       git \
+                       build-essential \
+                       autoconf \
+                       libtool
 
 
+RUN mkdir -p $WORKSPACE/curl && \
+    git -C $WORKSPACE/curl clone https://github.com/curl/curl.git --single-branch --recursive --branch $INPUT_DEP_CURL_GIT_TAG src
+
 # Prevent the copying of the src folder from being cached
 ARG CACHEBUST=1
 
-RUN cd /data/workspace && \
-    mkdir src
-
-# Copy the git synced source from the context base to this container
-COPY src  /data/workspace/src/
-
 # Copy the build script specific to this Docker script in order to execute the build
 COPY ${INPUT_DOCKER_BUILD_SCRIPT} /data/workspace/

+ 6 - 14
package-system/AWSNativeSDK/FindAWSNativeSDK.cmake.Linux

@@ -14,28 +14,18 @@ set(AWS_BASE_PATH ${CMAKE_CURRENT_LIST_DIR}/${AWSNATIVESDK_PACKAGE_NAME})
 # Include Path
 set(AWSNATIVESDK_INCLUDE_PATH ${AWS_BASE_PATH}/include)
 
-# Determine the specific openssl-dependent lib/binary paths
-if ("${OPENSSL_VERSION}" STREQUAL "")
-    message(FATAL_ERROR "OpenSSL not detected. The OpenSSL dev package is required for O3DE")
-elseif ("${OPENSSL_VERSION}" VERSION_LESS "3.0.0")
-    set(SRC_OPENSSL_BASE openssl-1)
-else()
-    set(SRC_OPENSSL_BASE openssl-3)
-endif()
-
 # Determine the lib path
 if(LY_MONOLITHIC_GAME)
-    set(AWSNATIVE_SDK_LIB_PATH ${AWS_BASE_PATH}/lib/${SRC_OPENSSL_BASE})
+    # Monolithic builds uses the static libraries
+    set(AWSNATIVE_SDK_LIB_PATH ${AWS_BASE_PATH}/lib)
 else()
-    set(AWSNATIVE_SDK_LIB_PATH ${AWS_BASE_PATH}/bin/${SRC_OPENSSL_BASE})
+    # Non-monolithic builds uses the shared libraries
+    set(AWSNATIVE_SDK_LIB_PATH ${AWS_BASE_PATH}/bin)
 endif()
 
 # AWS Compile Definitions
 set(AWSNATIVESDK_COMPILE_DEFINITIONS AWS_CUSTOM_MEMORY_MANAGEMENT PLATFORM_SUPPORTS_AWS_NATIVE_SDK)
 
-set(AWSNATIVESDK_BUILD_DEPENDENCIES
-    curl # The one bundled with the aws sdk in 3rdParty doesn't use the right openssl
-)
 
 # Helper function to define individual AWSNativeSDK Libraries
 function(ly_declare_aws_library)
@@ -103,6 +93,7 @@ set(CORE_STATIC_LIBS
     ${AWSNATIVE_SDK_LIB_PATH}/libaws-c-cal.a
     ${AWSNATIVE_SDK_LIB_PATH}/libaws-c-common.a
     ${AWSNATIVE_SDK_LIB_PATH}/libs2n.a
+    ${AWSNATIVE_SDK_LIB_PATH}/libcurl.a
 )
 
 if(LY_MONOLITHIC_GAME)
@@ -120,6 +111,7 @@ else()
             Core
         LIB_FILE 
             aws-cpp-sdk-core
+            curl
     )
 endif()
 

+ 128 - 107
package-system/AWSNativeSDK/build-linux.sh

@@ -8,20 +8,73 @@
 #
 
 # This script will utilize Docker to build on either AMD64 or AARCH64 architectures. The script will 
-# also build on both Ubuntu 20.04 (focal) and Ubuntu 22.04 (jammy) systems because of the dependencies
-# on OpenSSL 1.1.1 and Open 3.0 respectively
+# also build on both Ubuntu based docker images
 
-DOCKER_IMAGE_NAME_BASE=aws_native_sdk
 DOCKER_BUILD_SCRIPT=docker_build_aws_sdk.sh
+TARGET_BUILD_FOLDER=build
+
+#
+# Collect the required arguments for this ubuntu docker-base build script
+#
+
+# Get the base docker image name
+DOCKER_IMAGE_NAME_BASE=$1
+if [ "${DOCKER_IMAGE_NAME_BASE}" == "" ]
+then
+    echo "Missing argument 1: Docker image name for this this process"
+    exit 1
+fi
+
+# Get the ubuntu base version (16.04|18.04|20.04|22.04)
+UBUNTU_BASE=$2
+if [ "${UBUNTU_BASE}" == "" ]
+then
+    echo "Missing argument 2: Ubuntu docker tag"
+    exit 1
+fi
+
+# Get the dependent curl git tag to pull the dependent library source
+DEP_CURL_GIT_TAG=$3
+if [ "${DEP_CURL_GIT_TAG}" == "" ]
+then
+    echo "Missing argument 3: dependent curl git tag"
+    exit 1
+fi
 
 # Determine the host architecture
 CURRENT_HOST_ARCH=$(uname -m)
 
 # Use the host architecture if not supplied
-TARGET_ARCH=${1:-$(uname -m)}
+TARGET_ARCH=${4:-$(uname -m)}
+
+# Recompute the DOWNLOADED_PACKAGE_FOLDERS to apply to $WORKSPACE/temp inside the Docker script 
+DEP_PACKAGES_FOLDERNAMES_ONLY=${DOWNLOADED_PACKAGE_FOLDERS//$TEMP_FOLDER\//}
+DEP_PACKAGES_DOCKER_FOLDERNAMES=${DOWNLOADED_PACKAGE_FOLDERS//$TEMP_FOLDER/"/data/workspace/temp"}
 
-# Prepare the target install path
-INSTALL_PACKAGE_PATH=${TEMP_FOLDER}/install/
+echo "Executing docker-based build from the following arguments"
+echo "    DOCKER_IMAGE_NAME_BASE     = ${DOCKER_IMAGE_NAME_BASE}"
+echo "    UBUNTU_BASE                = ${UBUNTU_BASE}"
+echo "    DOCKER_BUILD_SCRIPT        = ${DOCKER_BUILD_SCRIPT}"
+echo "    TARGET_BUILD_FOLDER        = ${TARGET_BUILD_FOLDER}"
+echo "    TARGET_ARCH                = ${TARGET_ARCH}"
+echo "    TEMP_FOLDER                = ${TEMP_FOLDER}"
+echo "    DOWNLOADED_PACKAGE_FOLDERS = ${DEP_PACKAGES_FOLDERNAMES_ONLY}"
+
+#
+# Make sure docker is installed
+#
+DOCKER_VERSION=$(docker --version)
+if [ $? -ne 0 ]
+then
+    echo "Required package docker is not installed"
+    echo "Follow instructions on https://docs.docker.com/engine/install/ubuntu/ to install docker properly"
+    exit 1
+fi
+echo "Detected Docker Version $DOCKER_VERSION"
+
+# 
+# Check the target architecture and determine if the necessary cross compilation requirements are met
+#
 
 # If the host and target architecture does not match, make sure the necessary cross compilation packages are installed
 if [ "${CURRENT_HOST_ARCH}" != ${TARGET_ARCH} ]
@@ -63,16 +116,6 @@ else
     echo "Building ${TARGET_ARCH} natively."
 fi
 
-# Make sure docker is installed
-DOCKER_VERSION=$(docker --version)
-if [ $? -ne 0 ]
-then
-    echo "Required package docker is not installed"
-    echo "Follow instructions on https://docs.docker.com/engine/install/ubuntu/ to install docker properly"
-    exit 1
-fi
-echo "Detected Docker Version $DOCKER_VERSION"
-
 
 # Setup the docker arguments 
 if [ "${TARGET_ARCH}" = "x86_64" ]
@@ -81,7 +124,6 @@ then
 
     DOCKER_INPUT_ARCHITECTURE=amd64
     TARGET_DOCKER_PLATFORM_ARG=linux/amd64
-    DOCKER_BUILD_ARG=1
 
 elif [ "${TARGET_ARCH}" = "aarch64" ] 
 then
@@ -89,117 +131,96 @@ then
 
     DOCKER_INPUT_ARCHITECTURE=arm64v8
     TARGET_DOCKER_PLATFORM_ARG=linux/arm64/v8
-    DOCKER_BUILD_ARG=3
+
 else
     echo "Unsupported architecture ${TARGET_ARCH}"
     exit 1
 fi
 
-# Prepare to build on both Ubuntu 20.04 and Ubuntu 22.04 based docker images
-
+# 
+# Prepare the docker base context based on ${TEMP_FOLDER} 
 mkdir -p ${TEMP_FOLDER}
 cp -f ${DOCKER_BUILD_SCRIPT} ${TEMP_FOLDER}/
 
-# Args
-# $1 : Ubuntu version
-# $2 : Include
-# $3 : Docker run platform
-
-function execute_docker() {
-
-    # Determine the openssl version based on the ubuntu version (20.04/OpenSSL 1.1.1.x vs 22.04/OpenSSL 3.x)
-    if [ $1 = "20.04" ]
-    then
-        echo "Preparing for OpenSSL 1.1.1.x version"
-        BIN_SUBFOLDER_NAME=openssl-1
-    elif [ $1 = "22.04" ]
-    then
-        echo "Preparing for OpenSSL 3.x version"
-        BIN_SUBFOLDER_NAME=openssl-3
-    else
-        echo "Unsupported base build image ubuntu version ${1}"
-        exit 1
-    fi
-
-    # Build the Docker Image 
-    DOCKER_IMAGE_NAME=${DOCKER_IMAGE_NAME_BASE}_${DOCKER_INPUT_ARCHITECTURE}_3p
+echo "Building on ubuntu public.ecr.aws/ubuntu/ubuntu:${UBUNTU_BASE}"
+
+# Build the Docker Image 
+DOCKER_IMAGE_NAME=${DOCKER_IMAGE_NAME_BASE}_${DOCKER_INPUT_ARCHITECTURE}_3p
+echo DOCKER_IMAGE_NAME=${DOCKER_IMAGE_NAME}
+
+echo "Building the docker build script for ${DOCKER_IMAGE_NAME_BASE} on ${DOCKER_INPUT_ARCHITECTURE} for Ubuntu $1"
+echo ""
+CMD_DOCKER_BUILD="docker build --build-arg INPUT_DOCKER_BUILD_SCRIPT=${DOCKER_BUILD_SCRIPT}\
+ --build-arg INPUT_ARCHITECTURE=${DOCKER_INPUT_ARCHITECTURE} \
+ --build-arg INPUT_IMAGE=ubuntu:${UBUNTU_BASE} \
+ --build-arg INPUT_DEPENDENT_PACKAGE_FOLDERS=\"${DEP_PACKAGES_DOCKER_FOLDERNAMES}\" \
+ --build-arg INPUT_DEP_CURL_GIT_TAG=\"${DEP_CURL_GIT_TAG}\" \
+ -f Dockerfile -t ${DOCKER_IMAGE_NAME}:latest temp"
+echo ${CMD_DOCKER_BUILD}
+eval ${CMD_DOCKER_BUILD}
+if [ $? -ne 0 ]
+then
+    echo "Error occurred creating Docker image ${DOCKER_IMAGE_NAME}:latest." 
+    exit 1
+fi
 
-    echo "Building the docker build script for ${DOCKER_IMAGE_NAME_BASE} on ${DOCKER_INPUT_ARCHITECTURE} for Ubuntu $1"
+# Prepare the target build folder to copy from the docker container on successful run of the docker script
+INSTALL_PACKAGE_PATH=${TEMP_FOLDER}/${TARGET_BUILD_FOLDER}/
+
+# Run the build script in the docker image
+echo "Running build script in the docker image ${DOCKER_IMAGE_NAME}"
+echo ""
+CMD_DOCKER_RUN="docker run --platform ${TARGET_DOCKER_PLATFORM_ARG} \
+ --tty \
+ -v ${TEMP_FOLDER}:/data/workspace/temp:ro \
+ ${DOCKER_IMAGE_NAME}:latest /data/workspace/${DOCKER_BUILD_SCRIPT}"
+echo ${CMD_DOCKER_RUN}
+eval ${CMD_DOCKER_RUN}
+if [ $? -ne 0 ]
+then
+    echo Failed to build from docker image ${DOCKER_IMAGE_NAME}:latest
+    echo "To log into and troubleshoot the docker container, run the following command:"
     echo ""
-    echo docker build --build-arg INPUT_DOCKER_BUILD_SCRIPT=${DOCKER_BUILD_SCRIPT} \
-                 --build-arg INPUT_ARCHITECTURE=${DOCKER_INPUT_ARCHITECTURE} \
-                 --build-arg INPUT_IMAGE=ubuntu:${1} \
-                 -f Dockerfile -t ${DOCKER_IMAGE_NAME}:latest temp 
-    docker build --build-arg INPUT_DOCKER_BUILD_SCRIPT=${DOCKER_BUILD_SCRIPT} \
-                 --build-arg INPUT_ARCHITECTURE=${DOCKER_INPUT_ARCHITECTURE} \
-                 --build-arg INPUT_IMAGE=ubuntu:${1} \
-                 -f Dockerfile -t ${DOCKER_IMAGE_NAME}:latest temp 
-    if [ $? -ne 0 ]
-    then
-        echo "Error occurred creating Docker image ${DOCKER_IMAGE_NAME}:latest." 
-        exit 1
-    fi
-
-    # Run the build script in the docker image
-    echo "Running build script in the docker image ${DOCKER_IMAGE_NAME}"
+    echo "docker run --platform ${TARGET_DOCKER_PLATFORM_ARG} -it --tty -v ${TEMP_FOLDER}:/data/workspace/temp:ro ${DOCKER_IMAGE_NAME}:latest"
     echo ""
-    docker run --platform ${TARGET_DOCKER_PLATFORM_ARG} \
-               --tty \
-               ${DOCKER_IMAGE_NAME}:latest /data/workspace/${DOCKER_BUILD_SCRIPT}
-    if [ $? -ne 0 ]
-    then
-        echo Failed to build from docker image ${DOCKER_IMAGE_NAME}:latest
-        echo "To log into and troubleshoot the docker container, run the following command:"
-        echo ""
-        echo "docker run --platform ${TARGET_DOCKER_PLATFORM_ARG} -it --tty ${DOCKER_IMAGE_NAME}:latest"
-        echo ""
-        exit 1
-    fi
-
-    echo "Build Complete"
+    exit 1
+fi
 
-    # Copy the build artifacts from the docker image
+echo "Build Complete"
 
-    # Capture the Docker Image ID
-    IMAGE_ID=$(docker images -q ${DOCKER_IMAGE_NAME}:latest)
-    if [ -z $IMAGE_ID ]
-    then
-        echo "Error: Cannot find Image ID for ${DOCKER_IMAGE_NAME}"
-        exit 1
-    fi
+# Copy the build artifacts from the docker image
 
-    # Capture the container ID
-    echo "Capturing the Container ID"
-    CONTAINER_ID=$(docker container ls -l -q --filter "ancestor=${DOCKER_IMAGE_NAME}:latest")
-    if [ -z $CONTAINER_ID ]
-    then
-        echo "Error: Cannot find Container ID for Image ${DOCKER_IMAGE_NAME}"
-        exit 1
-    fi
+# Capture the Docker Image ID
+IMAGE_ID=$(docker images -q ${DOCKER_IMAGE_NAME}:latest)
+if [ -z $IMAGE_ID ]
+then
+    echo "Error: Cannot find Image ID for ${DOCKER_IMAGE_NAME}"
+    exit 1
+fi
 
-    DOCKER_BUILD_ROOT=/data/workspace/install
+# Capture the container ID
+echo "Capturing the Container ID"
+CONTAINER_ID=$(docker container ls -l -q --filter "ancestor=${DOCKER_IMAGE_NAME}:latest")
+if [ -z $CONTAINER_ID ]
+then
+    echo "Error: Cannot find Container ID for Image ${DOCKER_IMAGE_NAME}"
+    exit 1
+fi
 
-    if [ ! -f ${INSTALL_PACKAGE_PATH}/include ]
-    then
-        docker cp $CONTAINER_ID:${DOCKER_BUILD_ROOT}/Static/include  ${INSTALL_PACKAGE_PATH}/
-    fi
+DOCKER_BUILD_ROOT=/data/workspace/${TARGET_BUILD_FOLDER}
 
-    docker cp $CONTAINER_ID:${DOCKER_BUILD_ROOT}/Static/lib  ${INSTALL_PACKAGE_PATH}/lib/${BIN_SUBFOLDER_NAME}
-    docker cp $CONTAINER_ID:${DOCKER_BUILD_ROOT}/Shared/lib  ${INSTALL_PACKAGE_PATH}/bin/${BIN_SUBFOLDER_NAME}
-}
 
 rm -rf ${INSTALL_PACKAGE_PATH}
-
 mkdir -p ${INSTALL_PACKAGE_PATH}
-mkdir -p ${INSTALL_PACKAGE_PATH}/lib
-mkdir -p ${INSTALL_PACKAGE_PATH}/bin
 
-# Build for Ubuntu 20.04
-execute_docker 20.04 
-
-# Build for Ubuntu 22.04
-execute_docker 22.04 
+echo "Copying from $CONTAINER_ID:${DOCKER_BUILD_ROOT} to ${TEMP_FOLDER}/"
+docker cp $CONTAINER_ID:${DOCKER_BUILD_ROOT}  ${TEMP_FOLDER}/ 
+if [ $? -ne 0 ]
+then
+    echo "Error copying build from docker image ${DOCKER_IMAGE_NAME}:latest." 
+    exit 1
+fi
 
-echo "Build successful"
+echo "Built ${DOCKER_IMAGE_NAME_BASE} into ${INSTALL_PACKAGE_PATH} successfully"
 
 exit 0

+ 16 - 2
package-system/AWSNativeSDK/build_config.json

@@ -61,11 +61,18 @@
       },
       "Linux":{
          "Linux":{
-            "package_version":"1.9.50-rev3",
+            "depends_on_packages": [
+               [ "OpenSSL-1.1.1t-rev1-linux", "63aea898b7afe8faccd0c7261e62d2f8b7b870f678a4520d5be81e5815542b39", "" ],
+               [ "zlib-1.2.11-rev5-linux", "9be5ea85722fc27a8645a9c8a812669d107c68e6baa2ca0740872eaeb6a8b0fc", "" ]
+            ],
+            "package_version":"1.9.50-rev4",
             "patch_file":"AWSNativeSDK-1.9.50-linux-openssl3.patch",
             "cmake_find_source":"FindAWSNativeSDK.cmake.Linux",
             "custom_build_cmd": [
                "./build-linux.sh",
+               "aws_native_sdk_1_9_50",
+               "20.04",
+               "curl-7_68_0",
                "x86_64"
             ],
             "custom_install_cmd": [
@@ -73,11 +80,18 @@
             ]
          },
          "Linux-aarch64":{
-            "package_version":"1.9.50-rev3",
+            "depends_on_packages": [
+               [ "OpenSSL-1.1.1t-rev1-linux-aarch64", "f32721bec9c82d1bd7fb244d78d5dc4e2a47e7b808bb36027236ad377e241ea5", "" ],
+               [ "zlib-1.2.11-rev5-linux-aarch64", "ce9d1ed2883d77ffc69c7982c078595c1f89ca55ec19d89fe7e6beb05f774775", "" ]
+            ],
+            "package_version":"1.9.50-rev4",
             "patch_file":"AWSNativeSDK-1.9.50-linux-openssl3.patch",
             "cmake_find_source":"FindAWSNativeSDK.cmake.Linux",
             "custom_build_cmd": [
                "./build-linux.sh",
+               "aws_native_sdk_1_9_50",
+               "20.04",
+               "curl-7_68_0",
                "aarch64"
             ],
             "custom_install_cmd": [

+ 162 - 40
package-system/AWSNativeSDK/docker_build_aws_sdk.sh

@@ -6,85 +6,207 @@
 # SPDX-License-Identifier: Apache-2.0 OR MIT
 #
 
-# Validate the src path
-src_path=src
-if [ ! -d $src_path ]
+
+# Validate the bld path input
+BUILD_FOLDER=${DOCKER_BUILD_PATH}
+if [ "${BUILD_FOLDER}" == "" ]
+then
+    echo "Missing required build target folder environment"
+    exit 1
+elif [ "${BUILD_FOLDER}" == "temp" ]
+then
+    echo "Build target folder environment cannot be 'temp'"
+    exit 1
+fi
+
+
+# Locate the dependent OpenSSL package
+OPENSSL_REGEX='(OpenSSL-([A-Za-z0-9\.\-]+)-(linux|linux-aarch64))'
+[[ $DOWNLOADED_PACKAGE_FOLDERS =~ $OPENSSL_REGEX ]]
+DEPENDENT_OPENSSL=${BASH_REMATCH[1]}
+
+if [ $DEPENDENT_OPENSSL == "" ]
+then
+    echo "Unable to detect dependent OpenSSL package"
+    exit 1
+fi
+DEPENDENT_OPENSSL_BASE=$WORKSPACE/temp/${DEPENDENT_OPENSSL}/OpenSSL
+if [ ! -d ${DEPENDENT_OPENSSL_BASE} ]
+then
+    echo "Unable to detect dependent OpenSSL package at ${DEPENDENT_OPENSSL_BASE}"
+    exit 1
+fi
+echo "Detected dependent OpenSSL package at ${DEPENDENT_OPENSSL_BASE}"
+
+
+# Locate the dependent ZLIB package
+OPENZLIB_REGEX='(zlib-([A-Za-z0-9\.\-]+)-(linux|linux-aarch64))'
+[[ $DOWNLOADED_PACKAGE_FOLDERS =~ $OPENZLIB_REGEX ]]
+DEPENDENT_ZLIB=${BASH_REMATCH[1]}
+
+if [ $DEPENDENT_ZLIB == "" ]
+then
+    echo "Unable to detect dependent zlib package"
+    exit 1
+fi
+DEPENDENT_ZLIB_BASE=$WORKSPACE/temp/${DEPENDENT_ZLIB}/zlib
+if [ ! -d ${DEPENDENT_ZLIB_BASE} ]
+then
+    echo "Unable to detect dependent zlib package at ${DEPENDENT_ZLIB_BASE}"
+    exit 1
+fi
+echo "Detected dependent zlib package at ${DEPENDENT_ZLIB_BASE}"
+
+
+# Prepare curl
+CURL_BASE=/data/workspace/curl
+CURL_SRC=${CURL_BASE}/src
+CURL_INSTALL=${CURL_BASE}/install
+if [ ! -d $CURL_BASE ]
+then
+    echo "Unable to find source curl library ($CURL_SRC) from this docker image"
+    exit 1
+fi
+
+# Build curl from source
+pushd $CURL_BASE/src
+
+CMD="autoreconf -fi"
+echo ${CMD}
+eval ${CMD}
+if [ $? -ne 0 ]
+then
+    echo "Failed generating configuration for curl"
+    exit 1
+fi
+
+
+CMD="./configure --with-ssl=${DEPENDENT_OPENSSL_BASE}/ --with-zlib=${DEPENDENT_ZLIB_BASE} --prefix=${CURL_INSTALL} --enable-proxy"
+echo ${CMD}
+eval ${CMD}
+if [ $? -ne 0 ]
 then
-    echo "Missing src path"
+    echo "Failed configuring curl"
     exit 1
 fi
 
+CMD="make"
+echo ${CMD}
+eval ${CMD}
+if [ $? -ne 0 ]
+then
+    echo "Failed building curl"
+    exit 1
+fi
+
+CMD="make install"
+echo ${CMD}
+eval ${CMD}
+if [ $? -ne 0 ]
+then
+    echo "Failed installing curl"
+    exit 1
+fi
+
+popd
+
+# Copy the source folder from the read-only $WORKSPACE/temp/src to $WORKSPACE/src
+# since the build process will write/modify the source path
+echo "Preparing source folder '$WORKSPACE/src'"
+cp -r $WORKSPACE/temp/src $WORKSPACE/ || (echo "Error copying src from $WORKSPACE/temp" && exit 1)
 
-# Make sure the build path is clear
-bld_path=build
-rm -rf $bld_path || (echo "Command: rm -rf $bld_path failed" ; exit 1)
-mkdir $bld_path
+SRC_PATH=$WORKSPACE/src
 
+if [ ! -d ${SRC_PATH} ]
+then
+    echo "Missing expected source path at ${SRC_PATH}"
+    exit 1
+fi
 
-# Make sure the install path is clear
-inst_path=install
-echo "Command: rm -rf $inst_path"
-rm -rf $inst_path || (echo "Command: rm -rf $inst_path failed" ; exit 1)
-mkdir $inst_path
+BUILD_PATH=$WORKSPACE/aws/build
+if [ -d ${BUILD_PATH} ]
+then
+    rm -rf ${BUILD_PATH}
+fi
 
+INSTALL_PATH=${BUILD_FOLDER}
+if [ -d ${INSTALL_PATH} ]
+then
+    rm -rf ${INSTALL_PATH}
+fi
 
 configure_and_build() {
 
     lib_type=$1
-    build_shared=OFF
+    dep_curl_lib=${CURL_INSTALL}/lib/libcurl.a
     if [ "$lib_type" == "Shared" ]
     then
         build_shared=ON
+    else
+        build_shared=OFF
     fi
 
     echo "CMake Configure $build_type $lib_type"
 
-    cmake -S "$src_path" -B "$bld_path/${lib_type}" \
-          -G "Ninja" \
-          -DTARGET_ARCH=LINUX \
-          -DCMAKE_C_COMPILER=/usr/lib/llvm-12/bin/clang \
-          -DCMAKE_CXX_COMPILER=/usr/lib/llvm-12/bin/clang++ \
-          -DCMAKE_CXX_STANDARD=17 \
-          -DCPP_STANDARD=17 \
-          -DCMAKE_C_FLAGS="-fPIC" \
-          -DCMAKE_CXX_FLAGS="-fPIC" \
-          -DENABLE_TESTING=OFF \
-          -DENABLE_RTTI=ON \
-          -DCUSTOM_MEMORY_MANAGEMENT=ON \
-          -DBUILD_ONLY="access-management;cognito-identity;cognito-idp;core;devicefarm;dynamodb;gamelift;identity-management;kinesis;lambda;mobileanalytics;queues;s3;sns;sqs;sts;transfer" \
-          -DBUILD_SHARED_LIBS=$build_shared \
-          -DCMAKE_BUILD_TYPE=Release \
-          -DCMAKE_INSTALL_BINDIR="bin" \
-          -DCMAKE_INSTALL_LIBDIR="lib" 
+    CMD="cmake -S ${SRC_PATH} -B ${BUILD_PATH}/${lib_type} \
+ -G Ninja \
+ -DTARGET_ARCH=LINUX \
+ -DCMAKE_C_COMPILER=/usr/lib/llvm-12/bin/clang \
+ -DCMAKE_CXX_COMPILER=/usr/lib/llvm-12/bin/clang++ \
+ -DCMAKE_CXX_STANDARD=17 \
+ -DCPP_STANDARD=17 \
+ -DCMAKE_C_FLAGS=\"-fPIC -Wno-option-ignored\" \
+ -DCMAKE_CXX_FLAGS=\"-fPIC -Wno-option-ignored\" \
+ -DENABLE_TESTING=OFF \
+ -DENABLE_RTTI=ON \
+ -DCUSTOM_MEMORY_MANAGEMENT=ON \
+ -DBUILD_ONLY=\"access-management;cognito-identity;cognito-idp;core;devicefarm;dynamodb;gamelift;identity-management;kinesis;lambda;mobileanalytics;queues;s3;sns;sqs;sts;transfer\" \
+ -DBUILD_SHARED_LIBS=$build_shared \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_INSTALL_BINDIR=\"bin\" \
+ -DCMAKE_INSTALL_LIBDIR=\"lib\" \
+ -DCMAKE_MODULE_PATH=\"$DOWNLOADED_PACKAGE_FOLDERS\" \
+ -DCURL_INCLUDE_DIR=${CURL_INSTALL}/include \
+ -DCURL_LIBRARY=${dep_curl_lib}"
+
+    echo ${CMD}
+    eval ${CMD}
     if [ $? -ne 0 ]
     then
         echo "Error generating AWS Native SDK build" 
         exit 1
-    fi          
+    fi
 
-    echo "CMake Build $build_type $lib_type to $bld_path/${lib_type}"
-    cmake --build "$bld_path/${lib_type}"
+    CMD="cmake --build \"${BUILD_PATH}/${lib_type}\" "
+    echo ${CMD}
+    eval ${CMD}
     if [ $? -ne 0 ]
     then
         echo "Error building the ${lib_type} AWS Native SDK libraries"
         exit 1
-    fi          
+    fi
 
-    echo "CMake Install $build_type $lib_type to $inst_path/${lib_type}"
-    cmake --install "$bld_path/${lib_type}" --prefix "$inst_path/${lib_type}"
+    CMD="cmake --install \"${BUILD_PATH}/${lib_type}\" --prefix \"${INSTALL_PATH}/${lib_type}\" "
+    echo ${CMD}
+    eval ${CMD}
     if [ $? -ne 0 ]
     then
         echo "Error installing the ${lib_type} AWS Native SDK libraries" 
         exit 1
-    fi          
+    fi
 
+    cp ${dep_curl_lib} ${INSTALL_PATH}/${lib_type}/lib/
 }
 
+# Static
+configure_and_build Static
+
 # Shared
 configure_and_build Shared
 
-# Static
-configure_and_build Static
+# Copy the curl-related copyright and readme
+cp ${CURL_SRC}/README ${INSTALL_PATH}/README.CURL
+cp ${CURL_SRC}/COPYING ${INSTALL_PATH}/COPYING.CURL
 
 echo "Custom Build for AWSNativeSDK finished successfully"
 

+ 13 - 53
package-system/AWSNativeSDK/install-linux.sh

@@ -6,69 +6,29 @@
 # SPDX-License-Identifier: Apache-2.0 OR MIT
 #
 
+
 echo "TEMP_FOLDER=${TEMP_FOLDER}"
 echo "TARGET_INSTALL_ROOT=${TARGET_INSTALL_ROOT}"
 
-SRC_PATH=${TEMP_FOLDER}/src
-BLD_PATH=${TEMP_FOLDER}/build
-INSTALL_PATH=${TEMP_FOLDER}/install
-
-
-# Copy the include folders to the target root folder
-OUT_INCLUDE_PATH=$TARGET_INSTALL_ROOT/include
-
-echo "Copying include headers to ${OUT_INCLUDE_PATH}"
-mkdir -p ${OUT_INCLUDE_PATH}
-cp -f -R "${INSTALL_PATH}/include/"* ${OUT_INCLUDE_PATH}/ 
-if [ $? -ne 0 ]
-then
-    echo "Copying include headers to ${OUT_INCLUDE_PATH} failed."
-    exit 1
-fi
+SRC_PACKAGE_BASE=${TEMP_FOLDER}/build
 
+# Copy the include folder
+cp -r ${SRC_PACKAGE_BASE}/Shared/include $TARGET_INSTALL_ROOT/
 
 # Copy the license file to the target installation root folder
-echo "Copying LICENSE.txt to ${TARGET_INSTALL_ROOT}"
-cp -f ${SRC_PATH}/LICENSE.txt ${TARGET_INSTALL_ROOT}/
-if [ $? -ne 0 ]
-then
-    echo "Copying LICENSE.txt to ${TARGET_INSTALL_ROOT} failed."
-    exit 1
-fi
-
-copy_shared_and_static_libs() {
-
-    local OPENSSL_LABEL=$1
-
-    # Copy the shared libraries to the bin folder
-    OUT_BIN_PATH=${TARGET_INSTALL_ROOT}/bin
-    echo "Copying shared libraries (.so) to ${OUT_BIN_PATH}"
-
-    mkdir -p ${OUT_BIN_PATH}
-    cp -f -R "${INSTALL_PATH}/bin/${OPENSSL_LABEL}" ${OUT_BIN_PATH}
-    if [ $? -ne 0 ]
-    then
-        echo "Copying shared libraries (.so) to ${OUT_BIN_PATH} failed."
-        exit 1
-    fi
-
-    # Copy the static libraries to the lib folder
-    OUT_LIB_PATH=${TARGET_INSTALL_ROOT}/lib
-    echo "Copying static libraries (.a) to ${OUT_LIB_PATH}"
+SRC_PATH=${TEMP_FOLDER}/src
 
-    mkdir -p ${OUT_LIB_PATH}
-    cp -f -R "${INSTALL_PATH}/lib/${OPENSSL_LABEL}" ${OUT_LIB_PATH}
-    if [ $? -ne 0 ]
-    then
-        echo "Copying static libraries (.a) to ${OUT_LIB_PATH} failed."
-        exit 1
-    fi
+echo cp -f ${SRC_PACKAGE_BASE}/README.CURL ${TARGET_INSTALL_ROOT}/
+cp -f ${SRC_PACKAGE_BASE}/README.CURL ${TARGET_INSTALL_ROOT}/
 
-}
+echo cp -f ${SRC_PACKAGE_BASE}/COPYING.CURL ${TARGET_INSTALL_ROOT}/
+cp -f ${SRC_PACKAGE_BASE}/COPYING.CURL ${TARGET_INSTALL_ROOT}/
 
-copy_shared_and_static_libs openssl-1
+echo cp -f -R ${SRC_PACKAGE_BASE}/Shared/lib ${TARGET_INSTALL_ROOT}/bin
+cp -f -R ${SRC_PACKAGE_BASE}/Shared/lib ${TARGET_INSTALL_ROOT}/bin
 
-copy_shared_and_static_libs openssl-3
+echo cp -f -R ${SRC_PACKAGE_BASE}/Static/lib ${TARGET_INSTALL_ROOT}/lib
+cp -f -R ${SRC_PACKAGE_BASE}/Static/lib ${TARGET_INSTALL_ROOT}/lib
 
 echo "Custom Install for AWSNativeSDK finished successfully"
 

+ 52 - 0
package-system/OpenSSL/Dockerfile

@@ -0,0 +1,52 @@
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+
+
+# The cpu architecture to base the docker base script from
+ARG INPUT_ARCHITECTURE=amd64
+
+# The root to base the docker script base from
+ARG INPUT_IMAGE=ubuntu:20.04
+
+# The build subfolder where the final artifacts are built in this container which will be used to copy the results out of
+ARG INPUT_BUILD_FOLDER=build
+
+# The name of the build script to copy to the docker image to execute
+ARG INPUT_DOCKER_BUILD_SCRIPT=build.sh
+
+# The optional environment variable for list of folders in the mapped temp folders that represent additional 3P dependent packages
+ARG INPUT_DEPENDENT_PACKAGE_FOLDERS
+
+
+FROM ${INPUT_ARCHITECTURE}/${INPUT_IMAGE}
+
+ARG INPUT_DOCKER_BUILD_SCRIPT
+ARG INPUT_BUILD_FOLDER
+
+ENV WORKSPACE=/data/workspace
+ENV DOCKER_BUILD_PATH=$WORKSPACE/$INPUT_BUILD_FOLDER
+ENV DOWNLOADED_PACKAGE_FOLDERS=$INPUT_DEPENDENT_PACKAGE_FOLDERS
+
+
+WORKDIR $WORKSPACE
+
+# Initialize apt cache
+RUN apt-get clean && apt-get update
+
+# Setup time zone and locale data (necessary for SSL and HTTPS packages)
+RUN DEBIAN_FRONTEND="noninteractive" apt-get -y install tzdata locales keyboard-configuration
+
+# Install the development packages needed to build AWS Native C++ SDK
+RUN apt-get install -y build-essential \
+                       autoconf \
+                       libtool
+
+# Prevent the copying of the src folder from being cached
+ARG CACHEBUST=1
+
+# Copy the build script specific to this Docker script in order to execute the build
+COPY ${INPUT_DOCKER_BUILD_SCRIPT} /data/workspace/

+ 1 - 1
package-system/OpenSSL/FindOpenSSL.cmake.template

@@ -30,7 +30,7 @@ set(OPENSSL_SSL_LIBRARIES
     $${OPENSSL_SSL_LIBRARY}
     $${OPENSSL_CRYPTO_LIBRARIES})
 set(OPENSSL_LIBRARIES $${OPENSSL_SSL_LIBRARIES})
-set(OPENSSL_VERSION "1.1.1o")
+set(OPENSSL_VERSION "${OPENSSL_VERSION_STRING}")
 
 add_library($${CRYPTO_TARGETNAME} STATIC IMPORTED GLOBAL)
 set_target_properties($${CRYPTO_TARGETNAME} PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES "C")

+ 218 - 0
package-system/OpenSSL/build-linux.sh

@@ -0,0 +1,218 @@
+#!/bin/bash
+
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+
+# This script will utilize Docker to build on either AMD64 or AARCH64 architectures. The script will 
+# also build on both Ubuntu based docker images
+
+DOCKER_BUILD_SCRIPT=docker_build_openssl.sh
+TARGET_BUILD_FOLDER=build
+
+#
+# Collect the required arguments for this ubuntu docker-base build script
+#
+
+# Get the base docker image name
+DOCKER_IMAGE_NAME_BASE=$1
+if [ "${DOCKER_IMAGE_NAME_BASE}" == "" ]
+then
+    echo "Missing argument 1: Docker image name for this this process"
+    exit 1
+fi
+
+# Get the ubuntu base version (16.04|18.04|20.04|22.04)
+UBUNTU_BASE=$2
+if [ "${UBUNTU_BASE}" == "" ]
+then
+    echo "Missing argument 2: Ubuntu docker tag"
+    exit 1
+fi
+
+
+# Determine the host architecture
+CURRENT_HOST_ARCH=$(uname -m)
+
+# Use the host architecture if not supplied
+TARGET_ARCH=${3:-$(uname -m)}
+
+echo "Executing docker-based build from the following arguments"
+echo "    DOCKER_IMAGE_NAME_BASE=${DOCKER_IMAGE_NAME_BASE}"
+echo "    UBUNTU_BASE=${UBUNTU_BASE}"
+echo "    DOCKER_BUILD_SCRIPT=${DOCKER_BUILD_SCRIPT}"
+echo "    TARGET_BUILD_FOLDER=${TARGET_BUILD_FOLDER}"
+echo "    TARGET_ARCH=${TARGET_ARCH}"
+echo ""
+
+
+#
+# Make sure docker is installed
+#
+DOCKER_VERSION=$(docker --version)
+if [ $? -ne 0 ]
+then
+    echo "Required package docker is not installed"
+    echo "Follow instructions on https://docs.docker.com/engine/install/ubuntu/ to install docker properly"
+    exit 1
+fi
+echo "Detected Docker Version $DOCKER_VERSION"
+
+# 
+# Check the target architecture and determine if the necessary cross compilation requirements are met
+#
+
+# If the host and target architecture does not match, make sure the necessary cross compilation packages are installed
+if [ "${CURRENT_HOST_ARCH}" != ${TARGET_ARCH} ]
+then
+    echo "Checking cross compiling requirements."
+    for package_check in docker-ce qemu binfmt-support qemu-user-static
+    do
+        echo "Checking package $package_check"
+        dpkg -s $package_check > /dev/null 2>&1
+        if [ $? -ne 0 ]
+        then
+            echo ""
+            echo "Missing package $package_check. Make sure to install it with your local package manager." 
+            echo ""
+            exit 1
+        fi
+    done
+
+    # Only cross compilation of an ARM64 image on an x86_64 host is supported
+    if [ "${TARGET_ARCH}" = "aarch64" ]
+    then
+        # Make sure qemu-aarch64 is installed properly
+        QEMU_AARCH_COUNT=$(update-binfmts --display | grep qemu-aarch64 | wc -l)
+        if [ $QEMU_AARCH_COUNT -eq 0 ]
+        then
+            echo ""
+            echo "QEMU aarch64 binary format not registered."
+            echo "Run the following command to register"
+            echo ""
+            echo "sudo docker run --rm --privileged multiarch/qemu-user-static --reset -p yes"
+            echo ""
+            exit 1
+        fi
+        echo ""
+        echo "Cross compiling aarch64 on an amd64 machine validated."
+        echo ""
+    fi
+else
+    echo "Building ${TARGET_ARCH} natively."
+fi
+
+
+# Setup the docker arguments 
+if [ "${TARGET_ARCH}" = "x86_64" ]
+then
+    echo "Processing Docker for amd64"
+
+    DOCKER_INPUT_ARCHITECTURE=amd64
+    TARGET_DOCKER_PLATFORM_ARG=linux/amd64
+
+elif [ "${TARGET_ARCH}" = "aarch64" ] 
+then
+    echo "Processing Docker for aarch64"
+
+    DOCKER_INPUT_ARCHITECTURE=arm64v8
+    TARGET_DOCKER_PLATFORM_ARG=linux/arm64/v8
+
+else
+    echo "Unsupported architecture ${TARGET_ARCH}"
+    exit 1
+fi
+
+
+# 
+# Prepare the docker base context based on ${TEMP_FOLDER} 
+mkdir -p ${TEMP_FOLDER}
+cp -f ${DOCKER_BUILD_SCRIPT} ${TEMP_FOLDER}/
+
+
+echo "Building on ubuntu public.ecr.aws/ubuntu/ubuntu:${UBUNTU_BASE}"
+
+# Build the Docker Image 
+DOCKER_IMAGE_NAME=${DOCKER_IMAGE_NAME_BASE}_${DOCKER_INPUT_ARCHITECTURE}_3p
+echo DOCKER_IMAGE_NAME=${DOCKER_IMAGE_NAME}
+
+echo "Building the docker build script for ${DOCKER_IMAGE_NAME_BASE} on ${DOCKER_INPUT_ARCHITECTURE} for Ubuntu $1"
+echo ""
+CMD_DOCKER_BUILD="\
+docker build --build-arg INPUT_DOCKER_BUILD_SCRIPT=${DOCKER_BUILD_SCRIPT}\
+ --build-arg INPUT_ARCHITECTURE=${DOCKER_INPUT_ARCHITECTURE}\
+ --build-arg INPUT_IMAGE=ubuntu:${UBUNTU_BASE}\
+ --build-arg INPUT_DEPENDENT_PACKAGE_FOLDERS=${DOWNLOADED_PACKAGE_FOLDERS}\
+ -f Dockerfile -t ${DOCKER_IMAGE_NAME}:latest temp"
+ echo ${CMD_DOCKER_BUILD}
+ eval ${CMD_DOCKER_BUILD}
+if [ $? -ne 0 ]
+then
+    echo "Error occurred creating Docker image ${DOCKER_IMAGE_NAME}:latest." 
+    exit 1
+fi
+
+# Prepare the target build folder to copy from the docker container on successful run of the docker script
+INSTALL_PACKAGE_PATH=${TEMP_FOLDER}/${TARGET_BUILD_FOLDER}/
+
+# Run the build script in the docker image
+echo "Running build script in the docker image ${DOCKER_IMAGE_NAME}"
+echo ""
+CMD_DOCKER_RUN="\
+docker run --platform ${TARGET_DOCKER_PLATFORM_ARG} \
+  --tty \
+  -v ${TEMP_FOLDER}:/data/workspace/temp:ro \
+  ${DOCKER_IMAGE_NAME}:latest /data/workspace/${DOCKER_BUILD_SCRIPT}"
+echo ${CMD_DOCKER_RUN}
+eval ${CMD_DOCKER_RUN}
+if [ $? -ne 0 ]
+then
+    echo Failed to build from docker image ${DOCKER_IMAGE_NAME}:latest
+    echo "To log into and troubleshoot the docker container, run the following command:"
+    echo ""
+    echo "docker run --platform ${TARGET_DOCKER_PLATFORM_ARG} -v ${TEMP_FOLDER}:/data/workspace/temp:ro -it --tty ${DOCKER_IMAGE_NAME}:latest"
+    echo ""
+    exit 1
+fi
+
+echo "Build Complete"
+
+# Copy the build artifacts from the docker image
+
+# Capture the Docker Image ID
+IMAGE_ID=$(docker images -q ${DOCKER_IMAGE_NAME}:latest)
+if [ -z $IMAGE_ID ]
+then
+    echo "Error: Cannot find Image ID for ${DOCKER_IMAGE_NAME}"
+    exit 1
+fi
+
+# Capture the container ID
+echo "Capturing the Container ID"
+CONTAINER_ID=$(docker container ls -l -q --filter "ancestor=${DOCKER_IMAGE_NAME}:latest")
+if [ -z $CONTAINER_ID ]
+then
+    echo "Error: Cannot find Container ID for Image ${DOCKER_IMAGE_NAME}"
+    exit 1
+fi
+
+DOCKER_BUILD_ROOT=/data/workspace/${TARGET_BUILD_FOLDER}
+
+
+rm -rf ${INSTALL_PACKAGE_PATH}
+mkdir -p ${INSTALL_PACKAGE_PATH}
+
+echo "Copying from $CONTAINER_ID:${DOCKER_BUILD_ROOT} to ${${TEMP_FOLDER}}/"
+docker cp $CONTAINER_ID:${DOCKER_BUILD_ROOT}  ${TEMP_FOLDER}/ 
+if [ $? -ne 0 ]
+then
+    echo "Error copying build from docker image ${DOCKER_IMAGE_NAME}:latest." 
+    exit 1
+fi
+
+echo "Built ${DOCKER_IMAGE_NAME_BASE} into ${INSTALL_PACKAGE_PATH} successfully"
+
+exit 0

+ 56 - 0
package-system/OpenSSL/build_config.json

@@ -0,0 +1,56 @@
+{
+   "git_url":"https://github.com/openssl/openssl.git",
+   "git_tag":"OpenSSL_1_1_1t",
+   "package_name":"OpenSSL",
+   "package_version":"1.1.1t-rev1",
+   "package_url":"https://github.com/openssl/openssl.git",
+   "package_license":"OpenSSL",
+   "package_license_file":"LICENSE",
+   "cmake_find_target":"FindOpenSSL.cmake",
+   "Platforms":{
+      "Linux":{
+         "Linux":{
+            "cmake_find_template":"FindOpenSSL.cmake.template",
+            "custom_build_cmd": [
+               "./build-linux.sh",
+               "openssl_1_1_1t",
+               "18.04",
+               "x86_64"
+            ],
+            "custom_install_cmd": [
+               "./install-linux.sh",
+               "build"
+            ],
+            "custom_test_cmd" : [
+               "./test-linux.sh",
+               "x86_64"
+            ],
+            "custom_additional_template_map": {
+               "OPENSSL_VERSION_STRING": "1.1.1t",
+               "CRYPTO_LIBRARY_DEPENDENCIES": ""
+            }
+         },
+         "Linux-aarch64":{
+            "cmake_find_template":"FindOpenSSL.cmake.template",
+            "custom_build_cmd": [
+               "./build-linux.sh",
+               "openssl_1_1_1t",
+               "18.04",
+               "aarch64"
+            ],
+            "custom_install_cmd": [
+               "./install-linux.sh",
+               "build"
+            ],
+            "custom_test_cmd" : [
+               "./test-linux.sh",
+               "aarch64"
+            ],
+            "custom_additional_template_map": {
+               "OPENSSL_VERSION_STRING": "1.1.1t",
+               "CRYPTO_LIBRARY_DEPENDENCIES": ""
+            }
+         }
+      }
+   }
+}

+ 76 - 0
package-system/OpenSSL/docker_build_openssl.sh

@@ -0,0 +1,76 @@
+#!/bin/bash
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+
+
+# Validate the bld path input
+BUILD_FOLDER=${DOCKER_BUILD_PATH}
+if [ "${BUILD_FOLDER}" == "" ]
+then
+    echo "Missing required build target folder environment"
+    exit 1
+elif [ "${BUILD_FOLDER}" == "temp" ]
+then
+    echo "Build target folder environment cannot be 'temp'"
+    exit 1
+fi
+
+# Copy the source folder from the read-only $WORKSPACE/temp/src to $WORKSPACE/src
+# since the build process will write/modify the source path
+
+echo "Preparing source folder '$WORKSPACE/src'"
+cp -r $WORKSPACE/temp/src $WORKSPACE/ 
+if [ $? -ne 0 ]
+then
+    echo "Error copying src from $WORKSPACE/tempo"
+    exit 1
+fi
+
+cd $WORKSPACE/src
+echo "Configuring OpenSSL"
+CMD="./config no-shared no-asm --prefix=${BUILD_FOLDER} --openssldir=/etc/ssl LDFLAGS='-Wl,-rpath=\$$ORIGIN'"
+echo $CMD
+eval $CMD
+if [ $? -ne 0 ]
+then
+    echo "Error configuring OpenSSL"
+    exit 1
+fi
+
+echo "Building OpenSSL"
+CMD="make"
+echo $CMD
+eval $CMD
+if [ $? -ne 0 ]
+then
+    echo "Error building OpenSSL"
+    exit 1
+fi
+
+echo "Running OpenSSL tests"
+CMD="make test"
+echo $CMD
+eval $CMD
+if [ $? -ne 0 ]
+then
+    echo "OpenSSL failed tests"
+    exit 1
+fi
+
+echo "Installing OpenSSL to ${BUILD_FOLDER}"
+CMD="make install"
+echo $CMD
+eval $CMD
+if [ $? -ne 0 ]
+then
+    echo "OpenSSL failed to install"
+    exit 1
+fi
+
+echo "Build complete. Build artifacts installed to ${BUILD_FOLDER}"
+
+exit 0

+ 66 - 0
package-system/OpenSSL/install-linux.sh

@@ -0,0 +1,66 @@
+#!/bin/bash
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+
+# Install from the build folder
+TARGET_BUILD_FOLDER=$1
+if [ "${TARGET_BUILD_FOLDER}" == "" ]
+then
+    echo "Missing the target build folder name to create the installation base from"
+    exit 1
+elif [ ${TARGET_BUILD_FOLDER} == "src" ]
+then
+    echo "The target build folder cannot be 'src'"
+    exit 1
+fi
+
+SRC_PATH=${TEMP_FOLDER}/src
+BLD_PATH=${TEMP_FOLDER}/${TARGET_BUILD_FOLDER}
+
+echo "BUILD FOLDER=${BLD_PATH}"
+echo "TARGET_INSTALL_ROOT=${TARGET_INSTALL_ROOT}"
+
+copy_folder_to_target() {
+
+    local FOLDER=$1
+
+    echo cp -rf ${BLD_PATH}/${FOLDER} ${TARGET_INSTALL_ROOT}/
+    cp -rf ${BLD_PATH}/${FOLDER} ${TARGET_INSTALL_ROOT}/
+    if [ $? -ne 0 ]
+    then
+        echo "Error copying the ${FOLDER} folder ${BLD_PATH}/${FOLDER} to ${TARGET_INSTALL_ROOT}/${FOLDER}"
+        exit 1
+    fi
+}
+
+
+rm -rf ${TARGET_INSTALL_ROOT}
+mkdir -p ${TARGET_INSTALL_ROOT}
+
+
+
+# Copy the license file
+echo "Copying LICENSE to ${TARGET_INSTALL_ROOT}"
+cp -f ${SRC_PATH}/LICENSE ${TARGET_INSTALL_ROOT}/
+if [ $? -ne 0 ]
+then
+    echo "Copying LICENSE to ${TARGET_INSTALL_ROOT} failed."
+    exit 1
+fi
+
+# Copy the include folder
+copy_folder_to_target include
+
+# Copy the bin folder
+copy_folder_to_target bin
+
+# Copy the lib folder
+copy_folder_to_target lib
+
+echo "Custom Install for OpenSSL finished successfully"
+
+exit 0

+ 57 - 0
package-system/OpenSSL/test-linux.sh

@@ -0,0 +1,57 @@
+#!/bin/bash
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+#
+
+
+# The expected OPENSSL_VERSION_TEXT (Refer to build_config.json for the current version being built)
+EXPECTED_OPENSSL_VERSION="OpenSSL 1.1.1t  7 Feb 2023"
+
+# The sha256 hash of the above OPENSSL_VERSION_TEXT (Refer to build_config.json for the current version being built)
+EXPECTED_OPENSSL_VERSION_SHA256="92b72d8487f5580f88413f85e7053daf63da2653"
+
+
+# Reset any existing test folder
+rm -rf temp/build_test
+mkdir temp/build_test
+
+# Make sure we are running on the target architecture
+TARGET_ARCH=${1:-$(uname -m)}
+
+CURRENT_HOST_ARCH=$(uname -m)
+if [ "${CURRENT_HOST_ARCH}" != ${TARGET_ARCH} ]
+then
+    echo "Warning: Tests for packages on target ${TARGET_ARCH} can only be run on ${TARGET_ARCH}. Skipping tests."
+    exit 0
+fi
+
+# Build the test program
+cmake -S test -B temp/build_test -DCMAKE_MODULE_PATH="$PACKAGE_ROOT" -DCMAKE_BUILD_TYPE=Release
+if [ $? -ne 0 ]
+then
+    echo "Error generating the test project"
+    exit 1
+fi
+
+cmake --build temp/build_test
+if [ $? -ne 0 ]
+then
+    echo "Error building the test project"
+    exit 1
+fi
+
+echo Executing test_OpenSSL \"${EXPECTED_OPENSSL_VERSION}\" ${EXPECTED_OPENSSL_VERSION_SHA256}
+./temp/build_test/test_OpenSSL "${EXPECTED_OPENSSL_VERSION}" ${EXPECTED_OPENSSL_VERSION_SHA256}
+if [ $? -ne 0 ]
+then
+    echo "Package test failed"
+    exit 1
+fi
+
+echo "Package test passed"
+
+exit 0

+ 108 - 4
package-system/OpenSSL/test/test_OpenSSL.c

@@ -15,21 +15,125 @@
 
 // test whether a header is found
 #include <openssl/ssl.h>
+#include <openssl/sha.h>
+#include <openssl/evp.h>
+#include <openssl/bn.h>
+#include <openssl/crypto.h>
+#include <openssl/rand.h>
+#include <openssl/err.h>
 
-int main()
+int main(int argc, char* argv[])
 {
-    if (OPENSSL_init_ssl(0, NULL) == 0)
+    if (argc<3)
+    {
+        printf("Not enough arguments: %s [SSL Version Text] [SSL Version Text SHA256 Hash]", argv[0]);
+        return 1;
+    }
+
+    const char* inputOpenSSLVersionText = argv[1];
+    printf("Validating version text '%s': ", inputOpenSSLVersionText);
+
+    if (strcmp(OPENSSL_VERSION_TEXT, inputOpenSSLVersionText) != 0)
+    {
+        printf("FAILURE!\n OpenSSL OPENSSL_VERSION_TEXT returned invalid text '%s'. Expecting '%s'.\n", OPENSSL_VERSION_TEXT, inputOpenSSLVersionText);
+        return 1;
+    }
+    else
+    {
+        printf("OK\n");
+    }
+
+    if (OPENSSL_init_crypto(0, NULL) == 0)
     {
         printf("FAILURE! OPENSSL failed call to OPENSSL_init_ssl!\n");
         return 1;
     }
 
-    if (strcmp(OPENSSL_VERSION_TEXT, "OpenSSL 1.1.1o  3 May 2022") != 0)
+    // Compute a sha-1 hash
+    unsigned char hash[SHA_DIGEST_LENGTH];
+    SHA1(inputOpenSSLVersionText, strlen(inputOpenSSLVersionText), hash);
+
+    // Generate a sha1sum string from the hash
+    char sha1_hex[SHA_DIGEST_LENGTH*2+1] = {'\0'};
+    char* p = sha1_hex;
+    for (int i=0; i<SHA_DIGEST_LENGTH;i++, p+=2)
+    {
+        sprintf(p,"%.2x",hash[i]);
+    }
+
+    // Compare against the expected sha1sum (lower) 
+    const char* inputOpenSSLVersionTextHash = argv[2];
+    printf("Validating version text sha1sum '%s': ", inputOpenSSLVersionTextHash);
+
+    if (strcmp(sha1_hex, inputOpenSSLVersionTextHash) != 0)
+    {
+        printf("FAILURE!\n OpenSSL failed sha1 sum comparison (%s != %s)\n", sha1_hex, inputOpenSSLVersionTextHash);
+        return 1;
+    }
+    else
+    {
+        printf("OK\n");
+    }
+
+    int rsa_key_length = 1024u;
+    
+    // Test generating random numbers
+    printf("Generating random %d bit number : ", rsa_key_length);
+    BIGNUM* random_bn = BN_new();
+    if (BN_rand(random_bn, rsa_key_length, 1, 0)!=1)
     {
-        printf("FAILURE! OpenSSL OPENSSL_VERSION_TEXT returned invalid text (%s)!\n", OPENSSL_VERSION_TEXT);
+        printf("FAILURE!\n Failed to generate random number (%ld)\n", ERR_get_error());
         return 1;
     }
 
+    printf("OK\n");
+    char* rand_number_text = BN_bn2hex(random_bn);
+    printf("Random Number: %s\n", rand_number_text);
+
+
+    printf("Generating RSA Key pair (%d bits) : ", rsa_key_length);
+
+    RSA* rsa_key = RSA_new();
+    if (rsa_key == NULL)
+    {
+        printf("FAILURE!\n Failed to create RSA key instance (%ld)\n", ERR_get_error());
+        return 1;
+    }
+
+    // Set the RSA exponent to RSA_F4 (0x10001l) for key generation
+    BIGNUM* rsa_exponent = BN_new();
+    if (BN_set_word(rsa_exponent, RSA_F4)!=1)
+    {
+        printf("FAILURE!\n Failed to generate BN exponent (%ld)\n", ERR_get_error());
+        return 1;
+    }
+
+    if (RSA_generate_key_ex(rsa_key, rsa_key_length, rsa_exponent, NULL) == 0)
+    {
+        printf("FAILURE!\n Failed to generate %d bit RSA key  (%ld)\n", rsa_key_length, ERR_get_error());
+        return 1;
+    }
+    printf("OK\n");
+
+    printf("Private key values:\n");
+    char* rsa_p = BN_bn2hex(RSA_get0_p(rsa_key));
+    char* rsa_q = BN_bn2hex(RSA_get0_q(rsa_key));
+    char* rsa_e = BN_bn2hex(RSA_get0_e(rsa_key));
+    printf("    exponent : %s\n", rsa_e);
+    printf("    prime (p) : %s\n", rsa_p);
+    printf("    prime (q) : %s\n", rsa_q);
+
+    OPENSSL_free(rsa_p);
+    OPENSSL_free(rsa_q);
+    OPENSSL_free(rsa_e);
+
+    BN_free(rsa_exponent);
+    RSA_free(rsa_key);
+
+
     printf("Success: All is ok!\n");
+
+    OPENSSL_cleanup();
+
     return 0;
 }

+ 0 - 1
package-system/Qt/Dockerfile

@@ -40,7 +40,6 @@ RUN apt-get install -y qtbase5-dev \
                        libgbm-dev \
                        libxext-dev \
                        libfontconfig1-dev \ 
-                       libssl-dev \
                        libtiff-dev
 
 # Prepare a target folder within the container to install the build artifacts tp

+ 0 - 62
package-system/python/Dockerfile.aarch64

@@ -1,62 +0,0 @@
-
-# Copyright (c) Contributors to the Open 3D Engine Project.
-# For complete copyright and license terms please see the LICENSE at the root of this distribution.
-#
-# SPDX-License-Identifier: Apache-2.0 OR MIT
-#
-
-FROM arm64v8/ubuntu:20.04
- 
-WORKDIR /data/workspace
-
-ARG DOCKER_BUILD_SCRIPT
-
-# Initilize apt cache
-RUN apt-get clean && apt-get update
-
-# Install the development packages needed to build Qt from source
-RUN DEBIAN_FRONTEND="noninteractive" apt-get install -y build-essential \
-                                                        git \
-                                                        tk8.6-dev \
-                                                        python3 \
-                                                        autoconf \
-                                                        libssl-dev \
-                                                        tcl8.6-dev \
-                                                        libgdbm-compat-dev \
-                                                        liblzma-dev \
-                                                        libsqlite3-dev \
-                                                        libreadline-dev \
-                                                        libtool \
-                                                        texinfo \
-                                                        libbz2-dev \
-                                                        libgdbm-dev
-
-RUN apt upgrade -y
-
-# Get expat lib to update in the cpython src
-RUN git clone https://github.com/libexpat/libexpat.git --branch "R_2_4_6" --depth 1 
-
-# Pre-build Lib FFI 3.4.2
-RUN git clone https://github.com/libffi/libffi.git --branch "v3.4.2" --depth 1 && \
-    cd libffi && \
-    ./autogen.sh && \
-    ./configure --prefix=/data/workspace/ffi_lib --enable-shared=no CFLAGS='-fPIC' CPPFLAGS='-fPIC' && \
-    make install
-
-# Pre-build OpenSSL 1.1.1q
-RUN git clone https://github.com/openssl/openssl.git --branch "OpenSSL_1_1_1q" --depth 1 && \
-    cd openssl && \
-    ./config --prefix=/data/workspace/openssl-local/build --openssldir=/etc/ssl LDFLAGS='-Wl,-rpath=\$$ORIGIN' && \
-    make && \
-    make test && \
-    make install
-
-# Prepare a target folder within the container to install the build artifacts tp
-RUN mkdir -p /data/workspace/build && \
-    mkdir -p /data/workspace/cpython
-
-ARG CACHEBUST=1
-
-# Copy the build script specific to this Docker script in order to execute the build
-COPY ${DOCKER_BUILD_SCRIPT} /data/workspace/
-COPY src /data/workspace/cpython/

+ 63 - 0
package-system/python/Dockerfile.linux

@@ -0,0 +1,63 @@
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+
+
+# The cpu architecture to base the docker base script from
+ARG INPUT_ARCHITECTURE=amd64
+
+# The root to base the docker script base from
+ARG INPUT_IMAGE=ubuntu:20.04
+
+# The build subfolder where the final artifacts are built in this container which will be used to copy the results out of
+ARG INPUT_BUILD_FOLDER=build
+
+# The name of the build script to copy to the docker image to execute
+ARG INPUT_DOCKER_BUILD_SCRIPT=build.sh
+
+# The optional environment variable for list of folders in the mapped temp folders that represent additional 3P dependent packages
+ARG INPUT_DEPENDENT_PACKAGE_FOLDERS
+
+FROM ${INPUT_ARCHITECTURE}/${INPUT_IMAGE}
+
+ARG INPUT_DOCKER_BUILD_SCRIPT
+ARG INPUT_BUILD_FOLDER
+ARG INPUT_DEPENDENT_PACKAGE_FOLDERS
+
+ENV WORKSPACE=/data/workspace
+ENV DOCKER_BUILD_PATH=$WORKSPACE/$INPUT_BUILD_FOLDER
+ENV DOWNLOADED_PACKAGE_FOLDERS=$INPUT_DEPENDENT_PACKAGE_FOLDERS
+
+WORKDIR $WORKSPACE
+
+# Initilize apt cache
+RUN apt-get clean && apt-get update
+
+# Setup time zone and locale data (necessary for SSL and HTTPS packages)
+RUN DEBIAN_FRONTEND="noninteractive" apt-get -y install tzdata locales keyboard-configuration
+
+# Install the development packages needed to build AWS Gamelift
+RUN apt-get install -y autoconf \
+                       build-essential \
+                       cmake \
+                       git \
+                       libbz2-dev \
+                       libgdbm-compat-dev \
+                       libgdbm-dev \
+                       liblzma-dev \
+                       libreadline-dev \
+                       libtool \
+                       python3 \
+                       tcl8.6-dev \
+                       tk8.6-dev \
+                       texinfo \
+                       curl
+
+# Prevent the copying of the src folder from being cached
+ARG CACHEBUST=1
+
+# Copy the build script specific to this Docker script in order to execute the build
+COPY ${INPUT_DOCKER_BUILD_SCRIPT} /data/workspace/

+ 0 - 62
package-system/python/Dockerfile.x86_64

@@ -1,62 +0,0 @@
-
-# Copyright (c) Contributors to the Open 3D Engine Project.
-# For complete copyright and license terms please see the LICENSE at the root of this distribution.
-#
-# SPDX-License-Identifier: Apache-2.0 OR MIT
-#
-
-FROM amd64/ubuntu:20.04
- 
-WORKDIR /data/workspace
-
-ARG DOCKER_BUILD_SCRIPT
-
-# Initilize apt cache
-RUN apt-get clean && apt-get update
-
-# Install the development packages needed to build Qt from source
-RUN DEBIAN_FRONTEND="noninteractive" apt-get install -y build-essential \
-                                                        git \
-                                                        tk8.6-dev \
-                                                        python3 \
-                                                        autoconf \
-                                                        libssl-dev \
-                                                        tcl8.6-dev \
-                                                        libgdbm-compat-dev \
-                                                        liblzma-dev \
-                                                        libsqlite3-dev \
-                                                        libreadline-dev \
-                                                        libtool \
-                                                        texinfo \
-                                                        libbz2-dev \
-                                                        libgdbm-dev
-
-RUN apt upgrade -y
-
-# Get expat lib to update in the cpython src
-RUN git clone https://github.com/libexpat/libexpat.git --branch "R_2_4_6" --depth 1 
-
-# Pre-build Lib FFI 3.4.2
-RUN git clone https://github.com/libffi/libffi.git --branch "v3.4.2" --depth 1 && \
-    cd libffi && \
-    ./autogen.sh && \
-    ./configure --prefix=/data/workspace/ffi_lib --enable-shared=no CFLAGS='-fPIC' CPPFLAGS='-fPIC' && \
-    make install
-
-# Pre-build OpenSSL 1.1.1q
-RUN git clone https://github.com/openssl/openssl.git --branch "OpenSSL_1_1_1q" --depth 1 && \
-    cd openssl && \
-    ./config --prefix=/data/workspace/openssl-local/build --openssldir=/etc/ssl LDFLAGS='-Wl,-rpath=\$$ORIGIN' && \
-    make && \
-    make test && \
-    make install
-
-# Prepare a target folder within the container to install the build artifacts tp
-RUN mkdir -p /data/workspace/build && \
-    mkdir -p /data/workspace/cpython
-
-ARG CACHEBUST=1
-
-# Copy the build script specific to this Docker script in order to execute the build
-COPY ${DOCKER_BUILD_SCRIPT} /data/workspace/
-COPY src /data/workspace/cpython/

+ 116 - 47
package-system/python/build-linux.sh

@@ -9,13 +9,67 @@
 
 # TEMP_FOLDER and TARGET_INSTALL_ROOT get set from the pull_and_build_from_git.py script
 
-LIB_NAME=python3
+# This script will utilize Docker to build on either AMD64 or AARCH64 architectures. 
+
+
+DOCKER_BUILD_SCRIPT=docker_build_linux.sh
+TARGET_BUILD_FOLDER=build
+
+#
+# Collect the required arguments for this ubuntu docker-base build script
+#
+
+# Get the base docker image name
+DOCKER_IMAGE_NAME_BASE=$1
+if [ "${DOCKER_IMAGE_NAME_BASE}" == "" ]
+then
+    echo "Missing argument 1: Docker image name for this this process"
+    exit 1
+fi
+
+# Get the ubuntu base version (16.04|18.04|20.04|22.04)
+UBUNTU_BASE=$2
+if [ "${UBUNTU_BASE}" == "" ]
+then
+    echo "Missing argument 2: Ubuntu docker tag"
+    exit 1
+fi
 
 # Determine the host architecture
 CURRENT_HOST_ARCH=$(uname -m)
 
 # Use the host architecture if not supplied
-TARGET_ARCH=${1:-$(uname -m)}
+TARGET_ARCH=${3:-$(uname -m)}
+
+# Recompute the DOWNLOADED_PACKAGE_FOLDERS to apply to $WORKSPACE/temp inside the Docker script 
+DEP_PACKAGES_FOLDERNAMES_ONLY=${DOWNLOADED_PACKAGE_FOLDERS//$TEMP_FOLDER\//}
+DEP_PACKAGES_DOCKER_FOLDERNAMES=${DOWNLOADED_PACKAGE_FOLDERS//$TEMP_FOLDER/"/data/workspace/temp"}
+
+echo "Executing docker-based build from the following arguments"
+echo "    DOCKER_IMAGE_NAME_BASE     = ${DOCKER_IMAGE_NAME_BASE}"
+echo "    UBUNTU_BASE                = ${UBUNTU_BASE}"
+echo "    DOCKER_BUILD_SCRIPT        = ${DOCKER_BUILD_SCRIPT}"
+echo "    TARGET_BUILD_FOLDER        = ${TARGET_BUILD_FOLDER}"
+echo "    TARGET_ARCH                = ${TARGET_ARCH}"
+echo "    TEMP_FOLDER                = ${TEMP_FOLDER}"
+echo "    DOWNLOADED_PACKAGE_FOLDERS = ${DEP_PACKAGES_FOLDERNAMES_ONLY}"
+
+
+#
+# Make sure docker is installed
+#
+DOCKER_VERSION=$(docker --version)
+if [ $? -ne 0 ]
+then
+    echo "Required package docker is not installed"
+    echo "Follow instructions on https://docs.docker.com/engine/install/ubuntu/ to install docker properly"
+    exit 1
+fi
+echo "Detected Docker Version $DOCKER_VERSION"
+
+# 
+# Check the target architecture and determine if the necessary cross compilation requirements are met
+#
 
 # If the host and target architecture does not match, make sure the necessary cross compilation packages are installed
 if [ "${CURRENT_HOST_ARCH}" != ${TARGET_ARCH} ]
@@ -57,33 +111,31 @@ else
     echo "Building ${TARGET_ARCH} natively."
 fi
 
-# Setup the docker arguments for the target architecture
+
+# Setup the docker arguments 
 if [ "${TARGET_ARCH}" = "x86_64" ]
 then
-    echo "Processing Docker for x86_64"
-    TARGET_DOCKER_FILE=Dockerfile.x86_64
+    echo "Processing Docker for amd64"
+
+    DOCKER_INPUT_ARCHITECTURE=amd64
     TARGET_DOCKER_PLATFORM_ARG=linux/amd64
-    DOCKER_IMAGE_NAME=${LIB_NAME}_linux_3p
+
 elif [ "${TARGET_ARCH}" = "aarch64" ] 
 then
     echo "Processing Docker for aarch64"
-    TARGET_DOCKER_FILE=Dockerfile.aarch64
+
+    DOCKER_INPUT_ARCHITECTURE=arm64v8
     TARGET_DOCKER_PLATFORM_ARG=linux/arm64/v8
-    DOCKER_IMAGE_NAME=${LIB_NAME}_linux_aarch64_3p
+
 else
     echo "Unsupported architecture ${TARGET_ARCH}"
     exit 1
 fi
 
-# Make sure docker is installed
-DOCKER_VERSION=$(docker --version)
-if [ $? -ne 0 ]
-then
-    echo "Required package docker is not installed"
-    echo "Follow instructions on https://docs.docker.com/engine/install/ubuntu/ to install docker properly"
-    exit 1
-fi
-echo "Detected Docker Version $DOCKER_VERSION"
+# 
+# Prepare the docker base context based on ${TEMP_FOLDER} 
+mkdir -p ${TEMP_FOLDER}
+cp -f ${DOCKER_BUILD_SCRIPT} ${TEMP_FOLDER}/
 
 DOCKER_BUILD_SCRIPT=docker_build_linux.sh
 
@@ -93,43 +145,65 @@ then
     exit 1
 fi
 
-# Prepare the docker file and use the temp folder as the context root
-cp -f ${DOCKER_BUILD_SCRIPT} temp/
+# Build the Docker Image 
+DOCKER_IMAGE_NAME=${DOCKER_IMAGE_NAME_BASE}_${DOCKER_INPUT_ARCHITECTURE}_3p
+echo DOCKER_IMAGE_NAME=${DOCKER_IMAGE_NAME}
+
+echo "Building the docker build script for ${DOCKER_IMAGE_NAME_BASE} on ${DOCKER_INPUT_ARCHITECTURE} for Ubuntu $1"
+echo ""
 
-pushd temp
+CMD_DOCKER_BUILD="\
+docker build --build-arg INPUT_DOCKER_BUILD_SCRIPT=${DOCKER_BUILD_SCRIPT}\
+ --build-arg INPUT_ARCHITECTURE=${DOCKER_INPUT_ARCHITECTURE}\
+ --build-arg INPUT_IMAGE=ubuntu:${UBUNTU_BASE}\
+ --build-arg INPUT_DEPENDENT_PACKAGE_FOLDERS=\"${DEP_PACKAGES_DOCKER_FOLDERNAMES}\"\
+ -f Dockerfile.linux -t ${DOCKER_IMAGE_NAME}:latest temp"
+
+echo $CMD_DOCKER_BUILD
+eval $CMD_DOCKER_BUILD
 
-# Build the Docker Image
-echo "Building the docker build script for ${DOCKER_IMAGE_NAME}"
-docker build --build-arg DOCKER_BUILD_SCRIPT=$DOCKER_BUILD_SCRIPT -f ../${TARGET_DOCKER_FILE} -t ${DOCKER_IMAGE_NAME}:latest . 
 if [ $? -ne 0 ]
 then
     echo "Error occurred creating Docker image ${DOCKER_IMAGE_NAME}:latest." 
     exit 1
 fi
 
+# Prepare the target build folder to copy from the docker container on successful run of the docker script
+INSTALL_PACKAGE_PATH=${TEMP_FOLDER}/${TARGET_BUILD_FOLDER}/
 
-# Capture the Docker Image ID
-IMAGE_ID=$(docker images -q ${DOCKER_IMAGE_NAME}:latest)
-if [ -z $IMAGE_ID ]
-then
-    echo "Error: Cannot find Image ID for ${DOCKER_IMAGE_NAME}"
-    exit 1
-fi
+# Run the build script in the docker image
+echo "Running build script in the docker image ${DOCKER_IMAGE_NAME}"
+echo ""
+CMD_DOCKER_RUN="\
+docker run --platform ${TARGET_DOCKER_PLATFORM_ARG}\
+ --tty\
+ -v ${TEMP_FOLDER}:/data/workspace/temp:ro\
+ ${DOCKER_IMAGE_NAME}:latest /data/workspace/${DOCKER_BUILD_SCRIPT}"
 
+echo $CMD_DOCKER_RUN
+eval $CMD_DOCKER_RUN
 
-# Run the Docker Image
-echo "Running build script in the docker image"
-docker run --platform ${TARGET_DOCKER_PLATFORM_ARG} --tty ${DOCKER_IMAGE_NAME}:latest /data/workspace/${DOCKER_BUILD_SCRIPT}
 if [ $? -ne 0 ]
 then
     echo Failed to build from docker image ${DOCKER_IMAGE_NAME}:latest
     echo "To log into and troubleshoot the docker container, run the following command:"
     echo ""
-    echo "docker run --platform ${TARGET_DOCKER_PLATFORM_ARG} -it --tty ${DOCKER_IMAGE_NAME}:latest"
+    echo "docker run --platform ${TARGET_DOCKER_PLATFORM_ARG} -it --tty -v ${TEMP_FOLDER}:/data/workspace/temp:ro ${DOCKER_IMAGE_NAME}:latest"
     echo ""
     exit 1
 fi
 
+echo "Build Complete"
+
+# Copy the build artifacts from the docker image
+
+# Capture the Docker Image ID
+IMAGE_ID=$(docker images -q ${DOCKER_IMAGE_NAME}:latest)
+if [ -z $IMAGE_ID ]
+then
+    echo "Error: Cannot find Image ID for ${DOCKER_IMAGE_NAME}"
+    exit 1
+fi
 
 # Capture the container ID
 echo "Capturing the Container ID"
@@ -140,25 +214,20 @@ then
     exit 1
 fi
 
+DOCKER_BUILD_ROOT=/data/workspace/${TARGET_BUILD_FOLDER}
+
 
-# Copy the build artifacts from the Docker Container
-echo "Copying the built contents from the docker container for image ${DOCKER_IMAGE_NAME}"
+rm -rf ${INSTALL_PACKAGE_PATH}
+mkdir -p ${INSTALL_PACKAGE_PATH}
 
-mkdir -p build
-docker cp $CONTAINER_ID:/data/workspace/package/python/. build  
+echo "Copying from $CONTAINER_ID:${DOCKER_BUILD_ROOT} to ${TEMP_FOLDER}/"
+docker cp $CONTAINER_ID:${DOCKER_BUILD_ROOT}  ${TEMP_FOLDER}/ 
 if [ $? -ne 0 ]
 then
-    echo "Error occurred copying build artifacts from Docker container ($CONTAINER_ID)" 
+    echo "Error copying build from docker image ${DOCKER_IMAGE_NAME}:latest." 
     exit 1
 fi
 
-# Clean up the docker image and container
-echo "Cleaning up container"
-docker container rm $CONTAINER_ID || (echo "Warning: unable to clean up container for image ${DOCKER_IMAGE_NAME}")
-
-echo "Cleaning up image"
-docker rmi --force $IMAGE_ID  || (echo "Warning: unable to clean up image ${DOCKER_IMAGE_NAME}")
-
-popd
+echo "Built ${DOCKER_IMAGE_NAME_BASE} into ${INSTALL_PACKAGE_PATH} successfully"
 
 exit 0

+ 13 - 1
package-system/python/build_config.json

@@ -2,7 +2,7 @@
    "git_url":"https://github.com/python/cpython.git",
    "git_tag":"v3.10.5",
    "package_name":"python",
-   "package_version":"3.10.5-rev3",
+   "package_version":"3.10.5-rev4",
    "package_url":"https://python.org",
    "package_license":"PSF-2.0",
    "package_license_file":"LICENSE",
@@ -11,8 +11,14 @@
    "Platforms":{
       "Linux":{
             "Linux":{
+                "depends_on_packages": [
+                   [ "OpenSSL-1.1.1t-rev1-linux", "63aea898b7afe8faccd0c7261e62d2f8b7b870f678a4520d5be81e5815542b39", "" ],
+                   [ "SQLite-3.37.2-rev1-linux", "bee80d6c6db3e312c1f4f089c90894436ea9c9b74d67256d8c1fb00d4d81fe46", "" ]
+                ],
                "custom_build_cmd": [
                     "./build-linux.sh",
+                    "python_3_10_5",
+                    "20.04",
                     "x86_64"
                 ],
                 "custom_install_cmd": [
@@ -23,8 +29,14 @@
                 ]
             },
             "Linux-aarch64":{
+                "depends_on_packages": [
+                   [ "OpenSSL-1.1.1t-rev1-linux-aarch64", "f32721bec9c82d1bd7fb244d78d5dc4e2a47e7b808bb36027236ad377e241ea5", "" ],
+                   [ "SQLite-3.37.2-rev1-linux-aarch64", "5cc1fd9294af72514eba60509414e58f1a268996940be31d0ab6919383f05118", "" ]
+                ],
                "custom_build_cmd": [
                     "./build-linux.sh",
+                    "python_3_10_5",
+                    "20.04",
                     "aarch64"
                 ],
                 "custom_install_cmd": [

+ 144 - 45
package-system/python/docker_build_linux.sh

@@ -5,77 +5,174 @@
 #
 # SPDX-License-Identifier: Apache-2.0 OR MIT
 
-WORKSPACE=/data/workspace
+# Validate the bld path input
+BUILD_FOLDER=${DOCKER_BUILD_PATH}
+if [ "${BUILD_FOLDER}" == "" ]
+then
+    echo "Missing required build target folder environment"
+    exit 1
+elif [ "${BUILD_FOLDER}" == "temp" ]
+then
+    echo "Build target folder environment cannot be 'temp'"
+    exit 1
+fi
 
-mkdir -p $WORKSPACE/package
 
-cp -f -v $WORKSPACE/libexpat/expat/lib/*.h $WORKSPACE/cpython/Modules/expat/
-cp -f -v $WORKSPACE/libexpat/expat/lib/*.c $WORKSPACE/cpython/Modules/expat/
+# Copy the source folder from the read-only $WORKSPACE/temp/src to $WORKSPACE/src
+# since the build process will write/modify the source path
+SRC_PATH=$WORKSPACE/src
+echo "Preparing source folder '${SRC_PATH}'"
+cp -r $WORKSPACE/temp/src ${SRC_PATH}
 
-echo ""
-echo "--------------- Building cpython from source ---------------"
+
+# The dependent 'depends_on_packages' paths are architecture dependent
+if [ "$(uname -m)" = "x86_64" ]
+then
+    O3DE_OPENSSL_PACKAGE=OpenSSL-1.1.1t-rev1-linux
+    O3DE_SQLITE_PACKAGE=SQLite-3.37.2-rev1-linux
+else
+    O3DE_OPENSSL_PACKAGE=OpenSSL-1.1.1t-rev1-linux-aarch64
+    O3DE_SQLITE_PACKAGE=SQLite-3.37.2-rev1-linux-aarch64
+fi
+
+# Prepare the dependent O3DE package information for OpenSSL
+OPENSSL_BASE=$WORKSPACE/temp/${O3DE_OPENSSL_PACKAGE}/OpenSSL
+echo "Using O3DE OpenSSL package from ${O3DE_OPENSSL_PACKAGE}"
+
+
+# Prepare the dependent O3DE package information for SQLite
+SQLITE_BASE=$WORKSPACE/temp/${O3DE_SQLITE_PACKAGE}/SQLite
+echo "Using O3DE SQLite3 package from ${SQLITE_BASE}"
+
+
+# Prepare the dependent libffi package from github to use 
+LIBFFI_VERSION="v3.4.2"
+LIBFFI_GIT_URL="https://github.com/libffi/libffi.git"
+LIBFFI_SRC=ffi_src
+LIBFFI_SRC_PATH=${WORKSPACE}/${LIBFFI_SRC}
+LIBFFI_LIB_PATH=${WORKSPACE}/ffi_lib
+
+echo "Clone and build libFFI statically from ${FFI_GIT_URL} / ${LIBFFI_VERSION}"
+
+CMD="git -C ${WORKSPACE} clone ${LIBFFI_GIT_URL} --branch ${LIBFFI_VERSION} --depth 1 ${LIBFFI_SRC}"
+echo $CMD
+eval $CMD
+if [ $? -ne 0 ]
+then
+    echo "Failed cloning libffi from ${LIBFFI_GIT_URL}"
+    exit 1
+fi
+
+pushd ${LIBFFI_SRC_PATH}
+
+CMD="./autogen.sh"
+echo $CMD
+eval $CMD
+if [ $? -ne 0 ]
+then
+    echo "'autogen' failed for libffi at ${LIBFFI_SRC_PATH}"
+    exit 1
+fi
+
+
+CMD="./configure --prefix=$LIBFFI_LIB --enable-shared=no CFLAGS='-fPIC' CPPFLAGS='-fPIC' "
+echo $CMD
+eval $CMD
+if [ $? -ne 0 ]
+then
+    echo "'configure' failed for libffi at ${LIBFFI_SRC_PATH}"
+    exit 1
+fi
+
+CMD="make install"
+echo $CMD
+eval $CMD
+if [ $? -ne 0 ]
+then
+    echo "'configure' failed for libffi at ${LIBFFI_SRC_PATH}"
+    exit 1
+fi
+
+popd
+
+# Build CPython from source
+
+echo "Building cpython from source ..."
 echo ""
 
-cd $WORKSPACE/cpython
+pushd ${SRC_PATH}
 
 # Build from the source with optimizations and shared libs enabled , and override the RPATH and bzip include/lib paths
-echo ./configure --prefix=$WORKSPACE/package/python --enable-optimizations --with-openssl=$WORKSPACE/openssl-local/build --enable-shared LDFLAGS='-Wl,-rpath=\$$ORIGIN:\$$ORIGIN/../lib:\$$ORIGIN/../.. -L../ffi_lib/lib' CPPFLAGS='-I../ffi_lib/include' CFLAGS='-I../ffi_lib/include' 
-./configure --prefix=$WORKSPACE/package/python --enable-optimizations --with-openssl=$WORKSPACE/openssl-local/build --enable-shared LDFLAGS='-Wl,-rpath=\$$ORIGIN:\$$ORIGIN/../lib:\$$ORIGIN/../.. -L../ffi_lib/lib' CPPFLAGS='-I../ffi_lib/include' CFLAGS='-I../ffi_lib/include' 
-retVal=$?
-if [ $retVal -ne 0 ]; then
-    echo "Error running configuring optimized build"
-    exit $retVal
+CMD="\
+./configure --prefix=${BUILD_FOLDER}/python\
+ --enable-optimizations\
+ --with-openssl=${OPENSSL_BASE}\
+ --enable-shared LDFLAGS='-Wl,-rpath=\$$ORIGIN:\$$ORIGIN/../lib:\$$ORIGIN/../.. -L../ffi_lib/lib -L'${SQLITE_BASE}'/lib'\
+ CPPFLAGS='-I../ffi_lib/include -I'${SQLITE_BASE}'' CFLAGS='-I../ffi_lib/include -I'${SQLITE_BASE}''"
+echo $CMD
+eval $CMD
+if [ $? -ne 0 ]
+then
+    echo "'configure' failed for cpython at ${SRC_PATH}"
+    exit 1
 fi
 
-make
-retVal=$?
-if [ $retVal -ne 0 ]; then
-    echo "Error compiling optimized build"
-    exit $retVal
+CMD="make"
+echo $CMD
+eval $CMD
+if [ $? -ne 0 ]
+then
+    echo "'make' failed for cpython at ${SRC_PATH}"
+    exit 1
 fi
 
-# Install the newly built python 3.10.5 to the package/python folder
-cd $WORKSPACE/cpython
-
-make install
-retVal=$?
-if [ $retVal -ne 0 ]; then
-    echo "Error installing python to the package folder"
-    exit $retVal
+CMD="make install"
+echo $CMD
+eval $CMD
+if [ $? -ne 0 ]
+then
+    echo "'make install' failed for cpython at ${SRC_PATH}"
+    exit 1
 fi
 
-cd $WORKSPACE/package
+popd
 
-# Copy the python license file
-cp $WORKSPACE/cpython/LICENSE $WORKSPACE/package/python/LICENSE
+echo "Preparing additional python files"
 
-# Symlink python to python3
-cd $WORKSPACE/package/python/bin
-ln -s python3 python
+# Copy the python license
+cp ${SRC_PATH}/LICENSE ${BUILD_FOLDER}/python/LICENSE
 
-# Copy the openssl libraries to the local cpython build for portability
-cp $WORKSPACE/openssl-local/build/lib/libssl.so.1.1 $WORKSPACE/package/python/lib/
-cp $WORKSPACE/openssl-local/build/lib/libcrypto.so.1.1 $WORKSPACE/package/python/lib/
-cd $WORKSPACE/package/python/lib
+# Also copy the openssl license since its linked against the dependent O3DE OpenSSL static package
+cp ${OPENSSL_BASE}/LICENSE ${BUILD_FOLDER}/python/LICENSE.OPENSSL
 
-ln -s libssl.so.1.1 libssl.so.1
-ln -s libcrypto.so.1.1 libcrypto.so.1
+# Create a symlink from python -> python3
+pushd ${BUILD_FOLDER}/python/bin
+ln -s python3 python
+popd
 
-# Copy the openssl license
-cp $WORKSPACE/openssl/LICENSE $WORKSPACE/package/python/LICENSE.OPENSSL
+pushd ${BUILD_FOLDER}
 
+echo "Upgrading pip"
 
-cd $WORKSPACE/package
-echo ""
-echo "--------------- Upgrading pip ---------------"
-echo ""
 # the pip that may come from the above repo can be broken, so we'll use get-pip
 # and then upgrade it.
 curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
 ./python/bin/python3 get-pip.py
 rm get-pip.py
-PYTHONNOUSERSITE=1 ./python/bin/python3 -m pip install --upgrade pip
 
+pushd python/bin
+
+PYTHONNOUSERSITE=1 ./python3 -m pip install --upgrade pip
+
+echo "Upgrading setup tools"
+
+# Update setup tools to resolve https://avd.aquasec.com/nvd/cve-2022-40897
+PYTHONNOUSERSITE=1 ./python3 -m pip install setuptools --upgrade setuptools
+
+# Update wheel to resolve https://avd.aquasec.com/nvd/2022/cve-2022-40898/
+PYTHONNOUSERSITE=1 ./python3 -m pip install wheel --upgrade wheel
+
+popd #python/bin 
 
 # installing pip causes it to put absolute paths to python
 # in the pip files (in bin).  For example, pip will have 
@@ -89,6 +186,8 @@ sed -i "1s+.*+\#\!/bin/sh+" ./python/bin/pip*
 sed -i "2i\\
 \"exec\" \"\`dirname \$0\`/python\" \"\$0\" \"\$\@\" " ./python/bin/pip*
 
+popd # ${BUILD_FOLDER}
+
 echo ""
 echo "--------------- PYTHON WAS BUILT FROM SOURCE ---------------"
 echo ""

+ 6 - 6
package-system/python/package-linux.sh

@@ -6,12 +6,12 @@
 # SPDX-License-Identifier: Apache-2.0 OR MIT
 
 # Install the python build artifacts 
-cp -r temp/build/include $TARGET_INSTALL_ROOT
-cp -r temp/build/bin $TARGET_INSTALL_ROOT
-cp -r temp/build/lib $TARGET_INSTALL_ROOT
-cp -r temp/build/share $TARGET_INSTALL_ROOT
-cp temp/build/LICENSE $TARGET_INSTALL_ROOT/
-cp temp/build/LICENSE.OPENSSL $TARGET_INSTALL_ROOT/
+cp -r temp/build/python/include $TARGET_INSTALL_ROOT
+cp -r temp/build/python/bin $TARGET_INSTALL_ROOT
+cp -r temp/build/python/lib $TARGET_INSTALL_ROOT
+cp -r temp/build/python/share $TARGET_INSTALL_ROOT
+cp temp/build/python/LICENSE $TARGET_INSTALL_ROOT/
+cp temp/build/python/LICENSE.OPENSSL $TARGET_INSTALL_ROOT/
 
 # Install additional cmake files
 cp linux_x64/python-config-version.cmake $TARGET_INSTALL_ROOT/../

+ 1 - 1
package-system/python/test-linux.sh

@@ -5,6 +5,6 @@
 #
 # SPDX-License-Identifier: Apache-2.0 OR MIT
 
-temp/build/bin/python3 quick_validate_python.py
+temp/build/python/bin/python3 quick_validate_python.py
 
 exit $?

+ 8 - 6
package_build_list_host_linux-aarch64.json

@@ -6,9 +6,9 @@
     "build_from_source": {
         "assimp-5.2.5-rev1-linux-aarch64":  "Scripts/extras/pull_and_build_from_git.py ../../package-system/assimp --platform-name Linux-aarch64 --clean",
         "astc-encoder-3.2-rev3-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/astc-encoder --platform-name Linux-aarch64 --clean",
-        "AWSGameLiftServerSDK-5.0.0-rev2-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AWSGameLiftServerSDK --platform-name Linux-aarch64 --clean",
+        "AWSGameLiftServerSDK-5.0.0-rev3-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AWSGameLiftServerSDK --platform-name Linux-aarch64 --clean",
         "AwsIotDeviceSdkCpp-1.15.2-rev1-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AwsIotDeviceSdkCpp --platform-name Linux-aarch64 --clean",
-        "AWSNativeSDK-1.9.50-rev3-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AWSNativeSDK --platform-name Linux-aarch64 --clean",
+        "AWSNativeSDK-1.9.50-rev4-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AWSNativeSDK --platform-name Linux-aarch64 --clean",
         "azslc-1.8.15-rev1-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/azslc --platform-name Linux-aarch64 --clean",
         "cityhash-1.1-rev1-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/cityhash --platform-name Linux-aarch64 --clean",
         "DirectXShaderCompilerDxc-1.6.2112-o3de-rev1-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/DirectXShaderCompiler --platform-name Linux-aarch64 --clean",
@@ -26,13 +26,14 @@
         "OpenEXR-3.1.3-rev4-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/OpenEXR --platform-name Linux-aarch64 --clean",
         "openimageio-opencolorio-2.3.17-rev2-linux-aarch64": "package-system/openimageio-opencolorio/build_openimageio.py --package-name=openimageio-opencolorio-2.3.17-rev2-linux-aarch64 --platform linux-aarch64 --clean",
         "OpenMesh-8.1-rev3-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/OpenMesh --platform-name Linux-aarch64 --clean",
+        "OpenSSL-1.1.1t-rev1-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/OpenSSL --platform-name Linux-aarch64 --clean",
         "OpenXR-1.0.22-rev2-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/OpenXR --platform-name Linux-aarch64 --clean",
         "PhysX-4.1.2.29882248-rev5-linux-aarch64": "package-system/PhysX/build_package_image.py --platform-name linux-aarch64",
         "PhysX-5.1.1-rev1-linux-aarch64": "package-system/PhysX5/build_package_image.py --platform-name linux-aarch64",
         "png-1.6.37-rev2-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/libpng --platform-name Linux-aarch64 --clean",
         "poly2tri-7f0487a-rev1-linux-aarch64": "package-system/poly2tri/build_package_image.py --platform-name linux-aarch64",
         "pyside2-5.15.2.1-py3.10-rev4-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/pyside2 --platform-name Linux-aarch64 --clean",
-        "python-3.10.5-rev3-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/python --platform-name Linux-aarch64 --clean",
+        "python-3.10.5-rev4-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/python --platform-name Linux-aarch64 --clean",
         "qt-5.15.2-rev8-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/Qt --platform-name Linux-aarch64 --clean",
         "SPIRVCross-2021.04.29-rev1-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/SPIRVCross --platform-name Linux-aarch64 --clean",
         "SQLite-3.37.2-rev1-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/sqlite --platform-name Linux-aarch64 --clean",
@@ -45,9 +46,9 @@
     "build_from_folder": {
         "assimp-5.2.5-rev1-linux-aarch64": "package-system/assimp/temp/assimp-linux-aarch64",
         "astc-encoder-3.2-rev3-linux-aarch64": "package-system/astc-encoder/temp/astc-encoder-linux-aarch64",
-        "AWSGameLiftServerSDK-5.0.0-rev2-linux-aarch64": "package-system/AWSGameLiftServerSDK/temp/AWSGameLiftServerSDK-linux-aarch64",
+        "AWSGameLiftServerSDK-5.0.0-rev3-linux-aarch64": "package-system/AWSGameLiftServerSDK/temp/AWSGameLiftServerSDK-linux-aarch64",
         "AwsIotDeviceSdkCpp-1.15.2-rev1-linux-aarch64": "package-system/AwsIotDeviceSdkCpp/temp/AwsIotDeviceSdkCpp-linux-aarch64",
-        "AWSNativeSDK-1.9.50-rev3-linux-aarch64": "package-system/AWSNativeSDK/temp/AWSNativeSDK-linux-aarch64",
+        "AWSNativeSDK-1.9.50-rev4-linux-aarch64": "package-system/AWSNativeSDK/temp/AWSNativeSDK-linux-aarch64",
         "azslc-1.8.15-rev1-linux-aarch64": "package-system/azslc/temp/azslc-linux-aarch64",
         "cityhash-1.1-rev1-linux-aarch64": "package-system/cityhash/temp/cityhash-linux-aarch64",
         "DirectXShaderCompilerDxc-1.6.2112-o3de-rev1-linux-aarch64": "package-system/DirectXShaderCompiler/temp/DirectXShaderCompilerDxc-linux-aarch64",
@@ -65,13 +66,14 @@
         "OpenEXR-3.1.3-rev4-linux-aarch64": "package-system/OpenEXR/temp/OpenEXR-linux-aarch64",
         "openimageio-opencolorio-2.3.17-rev2-linux-aarch64": "package-system/openimageio-opencolorio/temp/package-linux-aarch64",
         "OpenMesh-8.1-rev3-linux-aarch64": "package-system/OpenMesh/temp/OpenMesh-linux-aarch64",
+        "OpenSSL-1.1.1t-rev1-linux-aarch64": "package-system/OpenSSL/temp/OpenSSL-linux-aarch64",
         "OpenXR-1.0.22-rev2-linux-aarch64": "package-system/OpenXR/temp/OpenXR-linux-aarch64",
         "PhysX-4.1.2.29882248-rev5-linux-aarch64": "package-system/PhysX-linux-aarch64",
         "PhysX-5.1.1-rev1-linux-aarch64": "package-system/PhysX5/temp/PhysX5-linux-aarch64",
         "png-1.6.37-rev2-linux-aarch64":  "package-system/libpng/temp/png-linux-aarch64",
         "poly2tri-7f0487a-rev1-linux-aarch64": "package-system/poly2tri-linux-aarch64",
         "pyside2-5.15.2.1-py3.10-rev4-linux-aarch64": "package-system/pyside2/temp/pyside2-linux-aarch64",
-        "python-3.10.5-rev3-linux-aarch64": "package-system/python/temp/python-linux-aarch64",
+        "python-3.10.5-rev4-linux-aarch64": "package-system/python/temp/python-linux-aarch64",
         "qt-5.15.2-rev8-linux-aarch64": "package-system/Qt/temp/qt-linux-aarch64",
         "SPIRVCross-2021.04.29-rev1-linux-aarch64": "package-system/SPIRVCross/temp/SPIRVCross-linux-aarch64",
         "SQLite-3.37.2-rev1-linux-aarch64": "package-system/sqlite/temp/SQLite-linux-aarch64",

+ 16 - 12
package_build_list_host_linux.json

@@ -5,10 +5,10 @@
     "comment4" : "Note:  Build from source occurs before build_from_folder",
     "build_from_source": {
         "assimp-5.2.5-rev1-linux":  "Scripts/extras/pull_and_build_from_git.py ../../package-system/assimp --platform-name Linux --package-root ../../package-system --clean",
-        "AWSGameLiftServerSDK-5.0.0-rev2-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AWSGameLiftServerSDK --platform-name Linux-aarch64 --clean",
-        "AWSGameLiftServerSDK-5.0.0-rev2-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AWSGameLiftServerSDK --platform-name Linux --clean",
-        "AWSNativeSDK-1.9.50-rev3-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AWSNativeSDK --platform-name Linux --clean",
-        "AWSNativeSDK-1.9.50-rev3-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AWSNativeSDK --platform-name Linux-aarch64 --clean",
+        "AWSGameLiftServerSDK-5.0.0-rev3-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AWSGameLiftServerSDK --platform-name Linux-aarch64 --clean",
+        "AWSGameLiftServerSDK-5.0.0-rev3-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AWSGameLiftServerSDK --platform-name Linux --clean",
+        "AWSNativeSDK-1.9.50-rev4-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AWSNativeSDK --platform-name Linux --clean",
+        "AWSNativeSDK-1.9.50-rev4-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AWSNativeSDK --platform-name Linux-aarch64 --clean",
         "cityhash-1.1-rev1-linux":  "Scripts/extras/pull_and_build_from_git.py ../../package-system/cityhash --platform-name Linux --clean",
         "Lua-5.4.4-rev1-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/Lua --platform-name Linux --package-root ../../package-system/Lua/temp --clean",
         "AwsIotDeviceSdkCpp-1.15.2-rev1-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AwsIotDeviceSdkCpp --platform-name Linux --package-root ../../package-system --clean",
@@ -24,6 +24,8 @@
         "OpenEXR-3.1.3-rev4-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/OpenEXR --platform-name Linux --package-root ../../package-system/OpenEXR/temp --clean",
         "OpenXR-1.0.22-rev2-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/OpenXR --platform-name Linux --package-root ../../package-system --clean",
         "openimageio-opencolorio-2.3.17-rev2-linux": "package-system/openimageio-opencolorio/build_openimageio.py --package-name=openimageio-opencolorio-2.3.17-rev2-linux --clean",
+        "OpenSSL-1.1.1t-rev1-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/OpenSSL --platform-name Linux --clean",
+        "OpenSSL-1.1.1t-rev1-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/OpenSSL --platform-name Linux-aarch64 --clean",
         "PhysX-4.1.2.29882248-rev6-linux": "package-system/PhysX/build_package_image.py --platform-name linux",
         "PhysX-5.1.1-rev1-linux": "package-system/PhysX5/build_package_image.py --platform-name linux",
         "NvCloth-v1.1.6-4-gd243404-pr58-rev1-linux": "package-system/NvCloth/build_package_image.py --platform-name linux",
@@ -37,8 +39,8 @@
         "DirectXShaderCompilerDxc-1.6.2112-o3de-rev1-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/DirectXShaderCompiler --platform-name Linux --package-root ../../package-system --clean",
         "azslc-1.8.15-rev2-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/azslc --platform-name Linux --package-root ../../package-system/azslc/temp --clean",
         "tiff-4.2.0.15-rev3-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/tiff --platform-name Linux --package-root ../../package-system --clean",
-        "python-3.10.5-rev3-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/python --platform-name Linux --clean",
-        "python-3.10.5-rev3-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/python --platform-name Linux-aarch64 --clean",
+        "python-3.10.5-rev4-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/python --platform-name Linux --clean",
+        "python-3.10.5-rev4-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/python --platform-name Linux-aarch64 --clean",
         "mikkelsen-1.0.0.4-linux": "package-system/mikkelsen/build_package_image.py",
         "qt-5.15.2-rev8-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/Qt --platform-name Linux --package-root ../../package-system/Qt/temp --clean",
         "zlib-1.2.11-rev5-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/zlib --platform-name Linux --package-root ../../package-system --clean",
@@ -48,10 +50,10 @@
     },
     "build_from_folder": {
         "assimp-5.2.5-rev1-linux": "package-system/assimp-linux",
-        "AWSGameLiftServerSDK-5.0.0-rev2-linux": "package-system/AWSGameLiftServerSDK/temp/AWSGameLiftServerSDK-linux",
-        "AWSGameLiftServerSDK-5.0.0-rev2-linux-aarch64": "package-system/AWSGameLiftServerSDK/temp/AWSGameLiftServerSDK-linux-aarch64",
-        "AWSNativeSDK-1.9.50-rev3-linux": "package-system/AWSNativeSDK/temp/AWSNativeSDK-linux",
-        "AWSNativeSDK-1.9.50-rev3-linux-aarch64": "package-system/AWSNativeSDK/temp/AWSNativeSDK-linux-aarch64",
+        "AWSGameLiftServerSDK-5.0.0-rev3-linux": "package-system/AWSGameLiftServerSDK/temp/AWSGameLiftServerSDK-linux",
+        "AWSGameLiftServerSDK-5.0.0-rev3-linux-aarch64": "package-system/AWSGameLiftServerSDK/temp/AWSGameLiftServerSDK-linux-aarch64",
+        "AWSNativeSDK-1.9.50-rev4-linux": "package-system/AWSNativeSDK/temp/AWSNativeSDK-linux",
+        "AWSNativeSDK-1.9.50-rev4-linux-aarch64": "package-system/AWSNativeSDK/temp/AWSNativeSDK-linux-aarch64",
         "cityhash-1.1-rev1-linux": "package-system/cityhash/temp/cityhash-linux",
         "Lua-5.4.4-rev1-linux": "package-system/Lua/temp/Lua-linux",
         "AwsIotDeviceSdkCpp-1.15.2-rev1-linux": "package-system/AwsIotDeviceSdkCpp-linux",
@@ -67,6 +69,8 @@
         "OpenEXR-3.1.3-rev4-linux": "package-system/OpenEXR/temp/OpenEXR-linux",
         "OpenXR-1.0.22-rev2-linux": "package-system/OpenXR-linux",
         "openimageio-opencolorio-2.3.17-rev2-linux": "package-system/openimageio-opencolorio/temp/package-linux",
+        "OpenSSL-1.1.1t-rev1-linux": "package-system/OpenSSL/temp/OpenSSL-linux",
+        "OpenSSL-1.1.1t-rev1-linux-aarch64": "package-system/OpenSSL/temp/OpenSSL-linux-aarch64",
         "SPIRVCross-2021.04.29-rev1-linux": "package-system/SPIRVCross-linux",
         "squish-ccr-deb557d-rev1-linux": "package-system/squish-ccr/temp/squish-ccr-linux",
         "squish-ccr-deb557d-rev1-linux-aarch64": "package-system/squish-ccr/temp/squish-ccr-linux-aarch64",
@@ -74,8 +78,8 @@
         "DirectXShaderCompilerDxc-1.6.2112-o3de-rev1-linux": "package-system/DirectXShaderCompilerDxc-linux",
         "azslc-1.8.15-rev2-linux": "package-system/azslc/temp/azslc-linux",
         "tiff-4.2.0.15-rev3-linux": "package-system/tiff-linux",
-        "python-3.10.5-rev3-linux": "package-system/python/temp/python-linux",
-        "python-3.10.5-rev3-linux-aarch64": "package-system/python/temp/python-linux-aarch64",
+        "python-3.10.5-rev4-linux": "package-system/python/temp/python-linux",
+        "python-3.10.5-rev4-linux-aarch64": "package-system/python/temp/python-linux-aarch64",
         "PhysX-4.1.2.29882248-rev6-linux": "package-system/PhysX-linux",
         "PhysX-5.1.1-rev1-linux": "package-system/PhysX5/temp/PhysX5-linux",
         "NvCloth-v1.1.6-4-gd243404-pr58-rev1-linux": "package-system/NvCloth-linux",