From a07450df7f6d3cd6738e4ef5adfabd55c90a0647 Mon Sep 17 00:00:00 2001 From: Steve Pham <82231385+spham-amzn@users.noreply.github.com> Date: Wed, 3 Apr 2024 16:31:17 -0700 Subject: [PATCH 01/15] * Update / Fix the git URL * Update the dependent packages for linux * Add a symlink to the python package in the docker build script to correct the build Signed-off-by: Steve Pham <82231385+spham-amzn@users.noreply.github.com> --- package-system/pyside2/Dockerfile | 2 +- package-system/pyside2/build-linux.sh | 8 ++++---- package-system/pyside2/build_config.json | 12 ++++++------ package-system/pyside2/docker_build_linux.sh | 15 ++++++++++----- package_build_list_host_linux-aarch64.json | 4 ++-- package_build_list_host_linux.json | 4 ++-- 6 files changed, 25 insertions(+), 20 deletions(-) diff --git a/package-system/pyside2/Dockerfile b/package-system/pyside2/Dockerfile index 6b5fc2db..221584ce 100644 --- a/package-system/pyside2/Dockerfile +++ b/package-system/pyside2/Dockerfile @@ -75,7 +75,7 @@ RUN if [ "$(uname -m)" = "aarch64" ]; then \ # Copy the build script specific to this Docker script in order to execute the build ARG CACHEBUST=1 -COPY ${DOCKER_BUILD_SCRIPT} /data/workspace/ COPY src /data/workspace/src/ +COPY ${DOCKER_BUILD_SCRIPT} /data/workspace/ ENTRYPOINT ["/bin/bash"] diff --git a/package-system/pyside2/build-linux.sh b/package-system/pyside2/build-linux.sh index d733cfbc..f1571570 100755 --- a/package-system/pyside2/build-linux.sh +++ b/package-system/pyside2/build-linux.sh @@ -11,11 +11,11 @@ if [ "$(uname -m)" = "aarch64" ] then - PYTHON_FOLDER_NAME=python-3.10.5-rev2-linux-aarch64 - QT_FOLDER_NAME=qt-5.15.2-rev8-linux-aarch64 + PYTHON_FOLDER_NAME=python-3.10.13-rev2-linux-aarch64 + QT_FOLDER_NAME=qt-5.15.2-rev9-linux-aarch64 else - PYTHON_FOLDER_NAME=python-3.10.5-rev2-linux - QT_FOLDER_NAME=qt-5.15.2-rev8-linux + PYTHON_FOLDER_NAME=python-3.10.13-rev2-linux + QT_FOLDER_NAME=qt-5.15.2-rev9-linux fi DOCKER_BUILD_SCRIPT=docker_build_linux.sh diff --git a/package-system/pyside2/build_config.json b/package-system/pyside2/build_config.json index 013f632d..890f649b 100644 --- a/package-system/pyside2/build_config.json +++ b/package-system/pyside2/build_config.json @@ -1,8 +1,8 @@ { - "git_url": "https://code.qt.io/cgit/pyside/pyside-setup.git", + "git_url": "https://code.qt.io/pyside/pyside-setup", "git_tag": "v5.15.2.1", "package_name": "pyside2", - "package_version": "5.15.2.1-py3.10-rev4", + "package_version": "5.15.2.1-py3.10-rev5", "package_url": "https://code.qt.io/cgit/pyside/pyside-setup.git", "package_license": "custom", "package_license_file": "pyside2/LICENSE.LGPLv3", @@ -30,8 +30,8 @@ "Linux": { "Linux": { "depends_on_packages" :[ - ["python-3.10.5-rev2-linux", "eda1fdc9129fb70df2d63bd21d0876c83c4f7021864f22c85850f4a8ff8cf1bf", ""], - ["qt-5.15.2-rev8-linux", "613d6a404b305ce0e715c57c936dc00318fb9f0d2d3f6609f8454c198f993095", ""] + ["python-3.10.13-rev2-linux", "a7832f9170a3ac93fbe678e9b3d99a977daa03bb667d25885967e8b4977b86f8", ""], + ["qt-5.15.2-rev9-linux", "db4bcd2003262f4d8c7d7da832758824fc24e53da5895edef743f67a64a5c734", ""] ], "cmake_find_source": "Findpyside2.cmake", "custom_build_cmd": [ @@ -43,8 +43,8 @@ }, "Linux-aarch64": { "depends_on_packages" :[ - ["python-3.10.5-rev2-linux-aarch64", "a02bfb612005af364872aac96e569cef1ad84ba65632d88d04b34a99d45b077c", ""], - ["qt-5.15.2-rev8-linux-aarch64", "c437ee1c7a4fe84002352a2f8ed230c822a13dcc80735a4fecf3b3af6e34bb63", ""] + ["python-3.10.13-rev2-linux-aarch64", "30bc2731e2ac54d8e22d36ab15e30b77aefe2dce146ef92d6f20adc0a9c5b14e", ""], + ["qt-5.15.2-rev9-linux-aarch64", "da80840ecd3f7a074edecbb3dedb1ff36c568cfe4943e18d9559e9fca9f151bc", ""] ], "cmake_find_source": "Findpyside2.cmake", "custom_build_cmd": [ diff --git a/package-system/pyside2/docker_build_linux.sh b/package-system/pyside2/docker_build_linux.sh index 6e17c617..81ddaf13 100755 --- a/package-system/pyside2/docker_build_linux.sh +++ b/package-system/pyside2/docker_build_linux.sh @@ -36,6 +36,11 @@ then exit 1 fi +echo Sym-linking python +pushd ${BASE_ROOT}/build +ln -s ${DEP_PYTHON_BASE}/python python +popd + echo Building source pushd ${BASE_ROOT}/src @@ -84,11 +89,11 @@ cp -r $INSTALL_SOURCE/share $PACKAGE_BASE # RPATH fixes -$BASE_ROOT/src/patchelf --set-rpath \$ORIGIN $PACKAGE_BASE/lib/libpyside2.abi3.so.5.15.2.1 -$BASE_ROOT/src/patchelf --set-rpath \$ORIGIN $PACKAGE_BASE/lib/libshiboken2.abi3.so.5.15.2.1 -$BASE_ROOT/src/patchelf --set-rpath \$ORIGIN $PACKAGE_BASE/lib/python3.10/site-packages/shiboken2/shiboken2.abi3.so -$BASE_ROOT/src/patchelf --set-rpath \$ORIGIN $PACKAGE_BASE/bin/shiboken2 -$BASE_ROOT/src/patchelf --set-rpath \$ORIGIN $PACKAGE_BASE/bin/pyside2-lupdate +$BASE_ROOT/src/patchelf --force-rpath --set-rpath "\$ORIGIN" $PACKAGE_BASE/lib/libpyside2.abi3.so.5.15.2.1 +$BASE_ROOT/src/patchelf --force-rpath --set-rpath "\$ORIGIN" $PACKAGE_BASE/lib/libshiboken2.abi3.so.5.15.2.1 +$BASE_ROOT/src/patchelf --force-rpath --set-rpath "\$ORIGIN" $PACKAGE_BASE/lib/python3.10/site-packages/shiboken2/shiboken2.abi3.so +$BASE_ROOT/src/patchelf --force-rpath --set-rpath "\$ORIGIN" $PACKAGE_BASE/bin/shiboken2 +$BASE_ROOT/src/patchelf --force-rpath --set-rpath "\$ORIGIN" $PACKAGE_BASE/bin/pyside2-lupdate exit 0 diff --git a/package_build_list_host_linux-aarch64.json b/package_build_list_host_linux-aarch64.json index ea2e7bb4..e75f8d16 100644 --- a/package_build_list_host_linux-aarch64.json +++ b/package_build_list_host_linux-aarch64.json @@ -32,7 +32,7 @@ "PhysX-5.1.1-rev4-linux-aarch64": "package-system/PhysX5/build_package_image.py --package-name PhysX-5.1.1 --package-rev rev4 --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", + "pyside2-5.15.2.1-py3.10-rev5-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/pyside2 --platform-name Linux-aarch64 --clean", "python-3.10.13-rev2-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/python --platform-name Linux-aarch64 --clean", "qt-5.15.2-rev9-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/Qt --platform-name Linux-aarch64 --clean", "sdformat-13.5.0-rev2-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/sdformat --platform-name Linux-aarch64 --clean", @@ -73,7 +73,7 @@ "PhysX-5.1.1-rev4-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", + "pyside2-5.15.2.1-py3.10-rev5-linux-aarch64": "package-system/pyside2/temp/pyside2-linux-aarch64", "python-3.10.13-rev2-linux-aarch64": "package-system/python/temp/python-linux-aarch64", "qt-5.15.2-rev9-linux-aarch64": "package-system/Qt/temp/qt-linux-aarch64", "sdformat-13.5.0-rev2-linux-aarch64": "package-system/sdformat/temp/sdformat-linux-aarch64", diff --git a/package_build_list_host_linux.json b/package_build_list_host_linux.json index 7e87966a..604edec2 100644 --- a/package_build_list_host_linux.json +++ b/package_build_list_host_linux.json @@ -20,7 +20,7 @@ "libsamplerate-0.2.1-rev2-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/libsamplerate --platform-name Linux --package-root ../../package-system --clean", "mcpp-2.7.2_az.1-rev1-linux": "package-system/mcpp/get_and_build_mcpp.py mcpp-2.7.2_az.1-rev1", "OpenMesh-8.1-rev3-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/OpenMesh --platform-name Linux --package-root ../../package-system --clean", - "pyside2-5.15.2.1-py3.10-rev4-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/pyside2 --platform-name Linux --package-root ../../package-system/pyside2/temp --clean", + "pyside2-5.15.2.1-py3.10-rev5-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/pyside2 --platform-name Linux --package-root ../../package-system/pyside2/temp --clean", "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", @@ -67,7 +67,7 @@ "libsamplerate-0.2.1-rev2-linux": "package-system/libsamplerate-linux", "mcpp-2.7.2_az.1-rev1-linux": "package-system/mcpp-linux", "OpenMesh-8.1-rev3-linux": "package-system/OpenMesh-linux", - "pyside2-5.15.2.1-py3.10-rev4-linux": "package-system/pyside2/temp/pyside2-linux", + "pyside2-5.15.2.1-py3.10-rev5-linux": "package-system/pyside2/temp/pyside2-linux", "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", From 36560ee3e44779a204e11f504e42ae3f49c86303 Mon Sep 17 00:00:00 2001 From: Steve Pham <82231385+spham-amzn@users.noreply.github.com> Date: Wed, 3 Apr 2024 22:07:40 -0700 Subject: [PATCH 02/15] * Workaround an issue with patchelf not setting the RPATH properly * Remove temp symlink of python before packaging to fix packaging error outside of the container Signed-off-by: Steve Pham <82231385+spham-amzn@users.noreply.github.com> --- package-system/pyside2/Dockerfile | 6 +++--- package-system/pyside2/docker_build_linux.sh | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/package-system/pyside2/Dockerfile b/package-system/pyside2/Dockerfile index 221584ce..77841d4a 100644 --- a/package-system/pyside2/Dockerfile +++ b/package-system/pyside2/Dockerfile @@ -38,8 +38,8 @@ RUN apt-get install -y cmake \ llvm-12 \ git \ libgl1-mesa-dev \ - libpcre2-dev - + libpcre2-dev \ + chrpath RUN apt-get install -y libclang-12-dev @@ -75,7 +75,7 @@ RUN if [ "$(uname -m)" = "aarch64" ]; then \ # Copy the build script specific to this Docker script in order to execute the build ARG CACHEBUST=1 -COPY src /data/workspace/src/ COPY ${DOCKER_BUILD_SCRIPT} /data/workspace/ +COPY src /data/workspace/src/ ENTRYPOINT ["/bin/bash"] diff --git a/package-system/pyside2/docker_build_linux.sh b/package-system/pyside2/docker_build_linux.sh index 81ddaf13..d44d7728 100755 --- a/package-system/pyside2/docker_build_linux.sh +++ b/package-system/pyside2/docker_build_linux.sh @@ -90,10 +90,25 @@ cp -r $INSTALL_SOURCE/share $PACKAGE_BASE # RPATH fixes $BASE_ROOT/src/patchelf --force-rpath --set-rpath "\$ORIGIN" $PACKAGE_BASE/lib/libpyside2.abi3.so.5.15.2.1 +chrpath -r \$ORIGIN $PACKAGE_BASE/lib/libpyside2.abi3.so.5.15.2.1 + $BASE_ROOT/src/patchelf --force-rpath --set-rpath "\$ORIGIN" $PACKAGE_BASE/lib/libshiboken2.abi3.so.5.15.2.1 +chrpath -r \$ORIGIN $PACKAGE_BASE/lib/libshiboken2.abi3.so.5.15.2.1 + $BASE_ROOT/src/patchelf --force-rpath --set-rpath "\$ORIGIN" $PACKAGE_BASE/lib/python3.10/site-packages/shiboken2/shiboken2.abi3.so +chrpath -r \$ORIGIN $PACKAGE_BASE/lib/python3.10/site-packages/shiboken2/shiboken2.abi3.so + $BASE_ROOT/src/patchelf --force-rpath --set-rpath "\$ORIGIN" $PACKAGE_BASE/bin/shiboken2 +chrpath -r \$ORIGIN $PACKAGE_BASE/bin/shiboken2 + $BASE_ROOT/src/patchelf --force-rpath --set-rpath "\$ORIGIN" $PACKAGE_BASE/bin/pyside2-lupdate +chrpath -r \$ORIGIN "\$ORIGIN" $PACKAGE_BASE/bin/pyside2-lupdate + +# Remove the sym-link python +pushd ${BASE_ROOT}/build +rm python +popd + exit 0 From c656f6ae85e85a31763e74cb4de9fe1e33ab9ffe Mon Sep 17 00:00:00 2001 From: Steve Pham <82231385+spham-amzn@users.noreply.github.com> Date: Wed, 3 Apr 2024 22:15:51 -0700 Subject: [PATCH 03/15] Update package rev to 7 Signed-off-by: Steve Pham <82231385+spham-amzn@users.noreply.github.com> --- package-system/pyside2/build_config.json | 2 +- package_build_list_host_linux-aarch64.json | 4 ++-- package_build_list_host_linux.json | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-system/pyside2/build_config.json b/package-system/pyside2/build_config.json index 890f649b..404ba742 100644 --- a/package-system/pyside2/build_config.json +++ b/package-system/pyside2/build_config.json @@ -2,7 +2,7 @@ "git_url": "https://code.qt.io/pyside/pyside-setup", "git_tag": "v5.15.2.1", "package_name": "pyside2", - "package_version": "5.15.2.1-py3.10-rev5", + "package_version": "5.15.2.1-py3.10-rev7", "package_url": "https://code.qt.io/cgit/pyside/pyside-setup.git", "package_license": "custom", "package_license_file": "pyside2/LICENSE.LGPLv3", diff --git a/package_build_list_host_linux-aarch64.json b/package_build_list_host_linux-aarch64.json index e75f8d16..11891960 100644 --- a/package_build_list_host_linux-aarch64.json +++ b/package_build_list_host_linux-aarch64.json @@ -32,7 +32,7 @@ "PhysX-5.1.1-rev4-linux-aarch64": "package-system/PhysX5/build_package_image.py --package-name PhysX-5.1.1 --package-rev rev4 --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-rev5-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/pyside2 --platform-name Linux-aarch64 --clean", + "pyside2-5.15.2.1-py3.10-rev7-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/pyside2 --platform-name Linux-aarch64 --clean", "python-3.10.13-rev2-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/python --platform-name Linux-aarch64 --clean", "qt-5.15.2-rev9-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/Qt --platform-name Linux-aarch64 --clean", "sdformat-13.5.0-rev2-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/sdformat --platform-name Linux-aarch64 --clean", @@ -73,7 +73,7 @@ "PhysX-5.1.1-rev4-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-rev5-linux-aarch64": "package-system/pyside2/temp/pyside2-linux-aarch64", + "pyside2-5.15.2.1-py3.10-rev7-linux-aarch64": "package-system/pyside2/temp/pyside2-linux-aarch64", "python-3.10.13-rev2-linux-aarch64": "package-system/python/temp/python-linux-aarch64", "qt-5.15.2-rev9-linux-aarch64": "package-system/Qt/temp/qt-linux-aarch64", "sdformat-13.5.0-rev2-linux-aarch64": "package-system/sdformat/temp/sdformat-linux-aarch64", diff --git a/package_build_list_host_linux.json b/package_build_list_host_linux.json index 604edec2..724ef393 100644 --- a/package_build_list_host_linux.json +++ b/package_build_list_host_linux.json @@ -20,7 +20,7 @@ "libsamplerate-0.2.1-rev2-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/libsamplerate --platform-name Linux --package-root ../../package-system --clean", "mcpp-2.7.2_az.1-rev1-linux": "package-system/mcpp/get_and_build_mcpp.py mcpp-2.7.2_az.1-rev1", "OpenMesh-8.1-rev3-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/OpenMesh --platform-name Linux --package-root ../../package-system --clean", - "pyside2-5.15.2.1-py3.10-rev5-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/pyside2 --platform-name Linux --package-root ../../package-system/pyside2/temp --clean", + "pyside2-5.15.2.1-py3.10-rev7-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/pyside2 --platform-name Linux --package-root ../../package-system/pyside2/temp --clean", "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", @@ -67,7 +67,7 @@ "libsamplerate-0.2.1-rev2-linux": "package-system/libsamplerate-linux", "mcpp-2.7.2_az.1-rev1-linux": "package-system/mcpp-linux", "OpenMesh-8.1-rev3-linux": "package-system/OpenMesh-linux", - "pyside2-5.15.2.1-py3.10-rev5-linux": "package-system/pyside2/temp/pyside2-linux", + "pyside2-5.15.2.1-py3.10-rev7-linux": "package-system/pyside2/temp/pyside2-linux", "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", From 6b62c3e540fa1a86ce7a3b823345a557b2b6a9db Mon Sep 17 00:00:00 2001 From: Steve Pham <82231385+spham-amzn@users.noreply.github.com> Date: Thu, 4 Apr 2024 08:10:21 -0700 Subject: [PATCH 04/15] Add the prod S3 bucket to the package downloader Signed-off-by: Steve Pham <82231385+spham-amzn@users.noreply.github.com> --- Scripts/extras/package_downloader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/extras/package_downloader.py b/Scripts/extras/package_downloader.py index 7a3dc900..13bbee2c 100644 --- a/Scripts/extras/package_downloader.py +++ b/Scripts/extras/package_downloader.py @@ -20,7 +20,7 @@ # used if LY_PACKAGE_SERVER_URLS is not set. -DEFAULT_LY_PACKAGE_SERVER_URLS = "https://d2c171ws20a1rv.cloudfront.net" +DEFAULT_LY_PACKAGE_SERVER_URLS = "https://d2c171ws20a1rv.cloudfront.net;https://d3t6xeg4fgfoum.cloudfront.net" possible_download_errors = (ssl.SSLError, URLError, OSError) From b13ac0a5f68bf7192538b45e471c0249343c8d80 Mon Sep 17 00:00:00 2001 From: Steve Pham <82231385+spham-amzn@users.noreply.github.com> Date: Thu, 4 Apr 2024 09:06:33 -0700 Subject: [PATCH 05/15] Add descriptive comments Signed-off-by: Steve Pham <82231385+spham-amzn@users.noreply.github.com> --- package-system/pyside2/docker_build_linux.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/package-system/pyside2/docker_build_linux.sh b/package-system/pyside2/docker_build_linux.sh index d44d7728..73d981f2 100755 --- a/package-system/pyside2/docker_build_linux.sh +++ b/package-system/pyside2/docker_build_linux.sh @@ -89,6 +89,9 @@ cp -r $INSTALL_SOURCE/share $PACKAGE_BASE # RPATH fixes +# Note: 'patchelf' is not setting the RPATH correctly, and chrpath by itself cannot add, only change the rpath. +# So we are working around this by first using patchelf to create the (incorrect) RPATH, and then we can +# us chrpath to change the incorrect RPATH to the correct $ORIGIN one. $BASE_ROOT/src/patchelf --force-rpath --set-rpath "\$ORIGIN" $PACKAGE_BASE/lib/libpyside2.abi3.so.5.15.2.1 chrpath -r \$ORIGIN $PACKAGE_BASE/lib/libpyside2.abi3.so.5.15.2.1 @@ -104,11 +107,9 @@ chrpath -r \$ORIGIN $PACKAGE_BASE/bin/shiboken2 $BASE_ROOT/src/patchelf --force-rpath --set-rpath "\$ORIGIN" $PACKAGE_BASE/bin/pyside2-lupdate chrpath -r \$ORIGIN "\$ORIGIN" $PACKAGE_BASE/bin/pyside2-lupdate -# Remove the sym-link python +# Remove the sym-link python to prevent it from being packaged up in the docker post processing. pushd ${BASE_ROOT}/build rm python popd - exit 0 - From d9294106a8e8f19e4e1c93b1a0506d1e54116306 Mon Sep 17 00:00:00 2001 From: Steve Pham <82231385+spham-amzn@users.noreply.github.com> Date: Fri, 5 Apr 2024 15:52:28 -0700 Subject: [PATCH 06/15] Add aarch64 to linux (for cross platform) for pyside2 Signed-off-by: Steve Pham <82231385+spham-amzn@users.noreply.github.com> --- package_build_list_host_linux.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package_build_list_host_linux.json b/package_build_list_host_linux.json index 724ef393..3a54f8f2 100644 --- a/package_build_list_host_linux.json +++ b/package_build_list_host_linux.json @@ -21,6 +21,7 @@ "mcpp-2.7.2_az.1-rev1-linux": "package-system/mcpp/get_and_build_mcpp.py mcpp-2.7.2_az.1-rev1", "OpenMesh-8.1-rev3-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/OpenMesh --platform-name Linux --package-root ../../package-system --clean", "pyside2-5.15.2.1-py3.10-rev7-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/pyside2 --platform-name Linux --package-root ../../package-system/pyside2/temp --clean", + "pyside2-5.15.2.1-py3.10-rev7-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/pyside2 --platform-name Linux-aarch64 --package-root ../../package-system/pyside2/temp --clean", "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", @@ -68,6 +69,7 @@ "mcpp-2.7.2_az.1-rev1-linux": "package-system/mcpp-linux", "OpenMesh-8.1-rev3-linux": "package-system/OpenMesh-linux", "pyside2-5.15.2.1-py3.10-rev7-linux": "package-system/pyside2/temp/pyside2-linux", + "pyside2-5.15.2.1-py3.10-rev7-linux-aarch64": "package-system/pyside2/temp/pyside2-linux-aarch64", "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", From 8897d77ea16d4c1350d3c22d9f3b38e60c38c722 Mon Sep 17 00:00:00 2001 From: Steve Pham <82231385+spham-amzn@users.noreply.github.com> Date: Fri, 5 Apr 2024 20:40:28 -0700 Subject: [PATCH 07/15] Minor edit Signed-off-by: Steve Pham <82231385+spham-amzn@users.noreply.github.com> --- package-system/pyside2/build_config.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package-system/pyside2/build_config.json b/package-system/pyside2/build_config.json index 404ba742..2946760a 100644 --- a/package-system/pyside2/build_config.json +++ b/package-system/pyside2/build_config.json @@ -48,10 +48,10 @@ ], "cmake_find_source": "Findpyside2.cmake", "custom_build_cmd": [ - "./build-linux.sh" + "build-linux.sh" ], "custom_install_cmd": [ - "./package_linux_aarch64.sh" + "package_linux_aarch64.sh" ] } From bf49bf6367a8e72256704440fb5b79cd28a51061 Mon Sep 17 00:00:00 2001 From: Steve Pham <82231385+spham-amzn@users.noreply.github.com> Date: Fri, 5 Apr 2024 20:42:52 -0700 Subject: [PATCH 08/15] Add status messages Signed-off-by: Steve Pham <82231385+spham-amzn@users.noreply.github.com> --- package-system/pyside2/build-linux.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package-system/pyside2/build-linux.sh b/package-system/pyside2/build-linux.sh index f1571570..e492cb7a 100755 --- a/package-system/pyside2/build-linux.sh +++ b/package-system/pyside2/build-linux.sh @@ -11,9 +11,11 @@ if [ "$(uname -m)" = "aarch64" ] then + echo "Building pyside2 for Linux aarch64" PYTHON_FOLDER_NAME=python-3.10.13-rev2-linux-aarch64 QT_FOLDER_NAME=qt-5.15.2-rev9-linux-aarch64 else + echo "Building pyside2 for Linux x86_64" PYTHON_FOLDER_NAME=python-3.10.13-rev2-linux QT_FOLDER_NAME=qt-5.15.2-rev9-linux fi From 803b0825920389a67b3eead43d8a4ef016a5e2d4 Mon Sep 17 00:00:00 2001 From: Steve Pham <82231385+spham-amzn@users.noreply.github.com> Date: Fri, 5 Apr 2024 20:54:21 -0700 Subject: [PATCH 09/15] Add status messages Signed-off-by: Steve Pham <82231385+spham-amzn@users.noreply.github.com> --- package-system/pyside2/build-linux.sh | 1 + package-system/pyside2/build_config.json | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package-system/pyside2/build-linux.sh b/package-system/pyside2/build-linux.sh index e492cb7a..8cb9acd4 100755 --- a/package-system/pyside2/build-linux.sh +++ b/package-system/pyside2/build-linux.sh @@ -8,6 +8,7 @@ # # TEMP_FOLDER and TARGET_INSTALL_ROOT get set from the pull_and_build_from_git.py script +echo "Starting pyside build" if [ "$(uname -m)" = "aarch64" ] then diff --git a/package-system/pyside2/build_config.json b/package-system/pyside2/build_config.json index 2946760a..404ba742 100644 --- a/package-system/pyside2/build_config.json +++ b/package-system/pyside2/build_config.json @@ -48,10 +48,10 @@ ], "cmake_find_source": "Findpyside2.cmake", "custom_build_cmd": [ - "build-linux.sh" + "./build-linux.sh" ], "custom_install_cmd": [ - "package_linux_aarch64.sh" + "./package_linux_aarch64.sh" ] } From 40f37f01e06f9bc44236598930a780427ffb7713 Mon Sep 17 00:00:00 2001 From: Steve Pham <82231385+spham-amzn@users.noreply.github.com> Date: Fri, 5 Apr 2024 21:04:44 -0700 Subject: [PATCH 10/15] Update custom command to output stdout and stderr to the console Signed-off-by: Steve Pham <82231385+spham-amzn@users.noreply.github.com> --- Scripts/extras/pull_and_build_from_git.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Scripts/extras/pull_and_build_from_git.py b/Scripts/extras/pull_and_build_from_git.py index c3a18630..efa19aae 100644 --- a/Scripts/extras/pull_and_build_from_git.py +++ b/Scripts/extras/pull_and_build_from_git.py @@ -863,6 +863,8 @@ def build_and_install_custom(self): call_result = subprocess.run(full_custom_build_cmd, shell=True, + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, capture_output=False, cwd=str(self.base_folder), env=env_to_use) From faf4b58e8b3be08e616fb8a93ff5368231ad8c15 Mon Sep 17 00:00:00 2001 From: Steve Pham <82231385+spham-amzn@users.noreply.github.com> Date: Sun, 7 Apr 2024 22:52:27 +0000 Subject: [PATCH 11/15] Remove stdout/stderr redirects Signed-off-by: Steve Pham <82231385+spham-amzn@users.noreply.github.com> --- Scripts/extras/pull_and_build_from_git.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/Scripts/extras/pull_and_build_from_git.py b/Scripts/extras/pull_and_build_from_git.py index efa19aae..c3a18630 100644 --- a/Scripts/extras/pull_and_build_from_git.py +++ b/Scripts/extras/pull_and_build_from_git.py @@ -863,8 +863,6 @@ def build_and_install_custom(self): call_result = subprocess.run(full_custom_build_cmd, shell=True, - stdout=subprocess.PIPE, - stderr=subprocess.STDOUT, capture_output=False, cwd=str(self.base_folder), env=env_to_use) From 61d37c5a211a56ad1f355b95f88eee1f29297dd3 Mon Sep 17 00:00:00 2001 From: Steve Pham <82231385+spham-amzn@users.noreply.github.com> Date: Sun, 7 Apr 2024 23:28:20 +0000 Subject: [PATCH 12/15] Change mapping of external folders to copying them to the docker image Signed-off-by: Steve Pham <82231385+spham-amzn@users.noreply.github.com> --- package-system/pyside2/Dockerfile | 2 ++ package-system/pyside2/build-linux.sh | 4 ++-- package-system/pyside2/docker_build_linux.sh | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/package-system/pyside2/Dockerfile b/package-system/pyside2/Dockerfile index 77841d4a..394f73d9 100644 --- a/package-system/pyside2/Dockerfile +++ b/package-system/pyside2/Dockerfile @@ -77,5 +77,7 @@ ARG CACHEBUST=1 COPY ${DOCKER_BUILD_SCRIPT} /data/workspace/ COPY src /data/workspace/src/ +COPY ${PYTHON_FOLDER_NAME} /data/workspace/${PYTHON_FOLDER_NAME}/ +COPY ${QT_FOLDER_NAME} /data/workspace/${QT_FOLDER_NAME}/ ENTRYPOINT ["/bin/bash"] diff --git a/package-system/pyside2/build-linux.sh b/package-system/pyside2/build-linux.sh index 8cb9acd4..6e43361e 100755 --- a/package-system/pyside2/build-linux.sh +++ b/package-system/pyside2/build-linux.sh @@ -80,8 +80,8 @@ fi # Run the Docker Image echo "Running build script in the docker image" -echo docker run -v $TEMP_FOLDER/src:/data/workspace/src -v $TEMP_FOLDER/$QT_FOLDER_NAME:/data/workspace/$QT_FOLDER_NAME -v $TEMP_FOLDER/$PYTHON_FOLDER_NAME:/data/workspace/$PYTHON_FOLDER_NAME --tty ${DOCKER_IMAGE_NAME}:latest /data/workspace/$DOCKER_BUILD_SCRIPT -docker run -v $TEMP_FOLDER/$QT_FOLDER_NAME:/data/workspace/$QT_FOLDER_NAME -v $TEMP_FOLDER/$PYTHON_FOLDER_NAME:/data/workspace/$PYTHON_FOLDER_NAME --tty ${DOCKER_IMAGE_NAME}:latest /data/workspace/$DOCKER_BUILD_SCRIPT +echo docker run -it --tty ${DOCKER_IMAGE_NAME}:latest /data/workspace/$DOCKER_BUILD_SCRIPT +docker run --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 diff --git a/package-system/pyside2/docker_build_linux.sh b/package-system/pyside2/docker_build_linux.sh index 73d981f2..2846792c 100755 --- a/package-system/pyside2/docker_build_linux.sh +++ b/package-system/pyside2/docker_build_linux.sh @@ -20,7 +20,7 @@ echo "Using Qt at ${DEP_QT_BASE}" LOCAL_PYTHON3_BIN=${DEP_PYTHON_BASE}/python/bin/python3 if [ ! -f $LOCAL_PYTHON3_BIN ] then - echo "Required local 3P python not detected" + echo "Required local 3P python not detected at ${LOCAL_PYTHON3_BIN}" exit 1 fi @@ -31,7 +31,7 @@ LOCAL_3P_QTBUILD_QMAKE_PATH=`readlink -f $LOCAL_3P_QTBUILD_PATH/bin/qmake` LOCAL_3P_QTBUILD_LIB_PATH=`readlink -f $LOCAL_3P_QTBUILD_PATH/lib` if [ ! -f "$LOCAL_3P_QTBUILD_QMAKE_PATH" ] then - echo "Missing 3P dependency of Qt $LOCAL_3P_QTBUILD_PATH" + echo "Missing 3P dependency of Qt ${LOCAL_3P_QTBUILD_PATH}" echo exit 1 fi From d1b762c2c7ae1b67327ac0c2af205651f0b3dfa0 Mon Sep 17 00:00:00 2001 From: Steve Pham <82231385+spham-amzn@users.noreply.github.com> Date: Sun, 7 Apr 2024 23:44:54 +0000 Subject: [PATCH 13/15] Fix issue building aarch64 on an x64_64 host Signed-off-by: Steve Pham <82231385+spham-amzn@users.noreply.github.com> --- package-system/pyside2/build-linux.sh | 52 +++++++++++++++++++++++- package-system/pyside2/build_config.json | 8 ++-- 2 files changed, 56 insertions(+), 4 deletions(-) diff --git a/package-system/pyside2/build-linux.sh b/package-system/pyside2/build-linux.sh index 6e43361e..08eab95b 100755 --- a/package-system/pyside2/build-linux.sh +++ b/package-system/pyside2/build-linux.sh @@ -10,7 +10,57 @@ # TEMP_FOLDER and TARGET_INSTALL_ROOT get set from the pull_and_build_from_git.py script echo "Starting pyside build" -if [ "$(uname -m)" = "aarch64" ] +# Determine the host architecture +CURRENT_HOST_ARCH=$(uname -m) + +# Use the host architecture if not supplied +TARGET_ARCH=${1:-$(uname -m)} + +# +# 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 + +if [ "${TARGET_ARCH}" = "aarch64" ] then echo "Building pyside2 for Linux aarch64" PYTHON_FOLDER_NAME=python-3.10.13-rev2-linux-aarch64 diff --git a/package-system/pyside2/build_config.json b/package-system/pyside2/build_config.json index 404ba742..5854d8c2 100644 --- a/package-system/pyside2/build_config.json +++ b/package-system/pyside2/build_config.json @@ -35,7 +35,8 @@ ], "cmake_find_source": "Findpyside2.cmake", "custom_build_cmd": [ - "./build-linux.sh" + "./build-linux.sh", + "x86_64" ], "custom_install_cmd": [ "./package_linux.sh" @@ -48,10 +49,11 @@ ], "cmake_find_source": "Findpyside2.cmake", "custom_build_cmd": [ - "./build-linux.sh" + "./build-linux.sh", + "aarch64" ], "custom_install_cmd": [ - "./package_linux_aarch64.sh" + "./package_linux.sh" ] } From 4f76111a78d44252dc4e62f4e5465e0053686701 Mon Sep 17 00:00:00 2001 From: Steve Pham <82231385+spham-amzn@users.noreply.github.com> Date: Sun, 7 Apr 2024 18:33:17 -0700 Subject: [PATCH 14/15] Update build_linux.sh to work with cross platform args for aarch64 Signed-off-by: Steve Pham <82231385+spham-amzn@users.noreply.github.com> --- package-system/pyside2/Dockerfile | 21 +++- package-system/pyside2/build-linux.sh | 119 ++++++++++++++++++----- package-system/pyside2/build_config.json | 4 + 3 files changed, 116 insertions(+), 28 deletions(-) diff --git a/package-system/pyside2/Dockerfile b/package-system/pyside2/Dockerfile index 394f73d9..c4d65027 100644 --- a/package-system/pyside2/Dockerfile +++ b/package-system/pyside2/Dockerfile @@ -9,14 +9,27 @@ # for its dependencies # -FROM public.ecr.aws/ubuntu/ubuntu:20.04_stable - -WORKDIR /data/workspace +# 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 PYTHON_FOLDER_NAME +ARG QT_FOLDER_NAME +ARG DOCKER_BUILD_SCRIPT + +FROM ${INPUT_ARCHITECTURE}/${INPUT_IMAGE} + +ARG INPUT_ARCHITECTURE +ARG INPUT_IMAGE ARG PYTHON_FOLDER_NAME ARG QT_FOLDER_NAME ARG DOCKER_BUILD_SCRIPT +WORKDIR /data/workspace + # Initilize apt cache RUN apt-get clean && apt-get update @@ -62,7 +75,7 @@ ENV LLVM_CONFIG=/usr/bin/llvm-config-12 # paths. To work around this and make it appear that the dependent 3P python package # was installed in this docker sctructure, we will instead create a symlink from the # 3p package's original path to the actual one mapped to the workspace path -RUN if [ "$(uname -m)" = "aarch64" ]; then \ +RUN if [ "${INPUT_ARCHITECTURE}" = "aarch64" ]; then \ mkdir -p /home/ubuntu/github/3p-package-source/package-system/python/linux_aarch64/package && \ cd /home/ubuntu/github/3p-package-source/package-system/python/linux_aarch64/package && \ ln -s /data/workspace/${PYTHON_FOLDER_NAME}/python python; \ diff --git a/package-system/pyside2/build-linux.sh b/package-system/pyside2/build-linux.sh index 08eab95b..9afcbd78 100755 --- a/package-system/pyside2/build-linux.sh +++ b/package-system/pyside2/build-linux.sh @@ -8,13 +8,63 @@ # # TEMP_FOLDER and TARGET_INSTALL_ROOT get set from the pull_and_build_from_git.py script -echo "Starting pyside build" + +# 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 @@ -60,31 +110,37 @@ else echo "Building ${TARGET_ARCH} natively." fi -if [ "${TARGET_ARCH}" = "aarch64" ] + +# Setup the docker arguments +if [ "${TARGET_ARCH}" = "x86_64" ] then - echo "Building pyside2 for Linux aarch64" - PYTHON_FOLDER_NAME=python-3.10.13-rev2-linux-aarch64 - QT_FOLDER_NAME=qt-5.15.2-rev9-linux-aarch64 -else - echo "Building pyside2 for Linux x86_64" + echo "Processing Docker for amd64" + + DOCKER_INPUT_ARCHITECTURE=amd64 + TARGET_DOCKER_PLATFORM_ARG=linux/amd64 PYTHON_FOLDER_NAME=python-3.10.13-rev2-linux QT_FOLDER_NAME=qt-5.15.2-rev9-linux -fi -DOCKER_BUILD_SCRIPT=docker_build_linux.sh -DOCKER_IMAGE_NAME=pyside2_linux_3p -PYSIDE2_TOOL_PATCH=pyside2-tools.patch +elif [ "${TARGET_ARCH}" = "aarch64" ] +then + echo "Processing Docker for aarch64" + DOCKER_INPUT_ARCHITECTURE=arm64v8 + TARGET_DOCKER_PLATFORM_ARG=linux/arm64/v8 + PYTHON_FOLDER_NAME=python-3.10.13-rev2-linux-aarch64 + QT_FOLDER_NAME=qt-5.15.2-rev9-linux-aarch64 -# 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" +else + echo "Unsupported architecture ${TARGET_ARCH}" exit 1 fi -echo "Detected Docker Version $DOCKER_VERSION" + +# Build the Docker Image +DOCKER_IMAGE_NAME=${DOCKER_IMAGE_NAME_BASE}_${DOCKER_INPUT_ARCHITECTURE}_3p +echo DOCKER_IMAGE_NAME=${DOCKER_IMAGE_NAME} + +DOCKER_IMAGE_NAME=pyside2_linux_3p +PYSIDE2_TOOL_PATCH=pyside2-tools.patch echo "Using dependent 3rd Party Library ${PYTHON_FOLDER_NAME}" echo "Using dependent 3rd Party Library ${QT_FOLDER_NAME}" @@ -108,11 +164,25 @@ else fi popd +popd + # Build the Docker Image -echo "Building the docker build script" +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 PYTHON_FOLDER_NAME=\"${PYTHON_FOLDER_NAME}\"\ + --build-arg QT_FOLDER_NAME=\"${QT_FOLDER_NAME}\"\ + --build-arg DOCKER_BUILD_SCRIPT=\"${DOCKER_BUILD_SCRIPT}\"\ + -f Dockerfile -t ${DOCKER_IMAGE_NAME}:latest temp" + +echo "CWD=$(pwd)" +echo $CMD_DOCKER_BUILD +eval $CMD_DOCKER_BUILD -echo docker build --build-arg PYTHON_FOLDER_NAME=${PYTHON_FOLDER_NAME} --build-arg QT_FOLDER_NAME=${QT_FOLDER_NAME} --build-arg DOCKER_BUILD_SCRIPT=${DOCKER_BUILD_SCRIPT} -f ../Dockerfile -t ${DOCKER_IMAGE_NAME}:latest . -docker build --build-arg PYTHON_FOLDER_NAME=${PYTHON_FOLDER_NAME} --build-arg QT_FOLDER_NAME=${QT_FOLDER_NAME} --build-arg DOCKER_BUILD_SCRIPT=${DOCKER_BUILD_SCRIPT} -f ../Dockerfile -t ${DOCKER_IMAGE_NAME}:latest . if [ $? -ne 0 ] then echo "Error occurred creating Docker image ${DOCKER_IMAGE_NAME}:latest." @@ -130,8 +200,9 @@ fi # Run the Docker Image echo "Running build script in the docker image" -echo docker run -it --tty ${DOCKER_IMAGE_NAME}:latest /data/workspace/$DOCKER_BUILD_SCRIPT -docker run --tty ${DOCKER_IMAGE_NAME}:latest /data/workspace/$DOCKER_BUILD_SCRIPT + +echo docker run -it --platform ${TARGET_DOCKER_PLATFORM_ARG} --tty ${DOCKER_IMAGE_NAME}:latest /data/workspace/$DOCKER_BUILD_SCRIPT +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 diff --git a/package-system/pyside2/build_config.json b/package-system/pyside2/build_config.json index 5854d8c2..f097b0e7 100644 --- a/package-system/pyside2/build_config.json +++ b/package-system/pyside2/build_config.json @@ -36,6 +36,8 @@ "cmake_find_source": "Findpyside2.cmake", "custom_build_cmd": [ "./build-linux.sh", + "pyside2_5_15_2_1", + "20.04", "x86_64" ], "custom_install_cmd": [ @@ -50,6 +52,8 @@ "cmake_find_source": "Findpyside2.cmake", "custom_build_cmd": [ "./build-linux.sh", + "pyside2_5_15_2_1", + "20.04", "aarch64" ], "custom_install_cmd": [ From 26818e1f94f3a2c000aa6e33054424579f14f712 Mon Sep 17 00:00:00 2001 From: Steve Pham <82231385+spham-amzn@users.noreply.github.com> Date: Sun, 7 Apr 2024 20:24:59 -0700 Subject: [PATCH 15/15] Remove deprecated files Signed-off-by: Steve Pham <82231385+spham-amzn@users.noreply.github.com> --- package-system/pyside2/build_linux_aarch64.sh | 76 ------------------- .../pyside2/package_linux_aarch64.sh | 48 ------------ 2 files changed, 124 deletions(-) delete mode 100755 package-system/pyside2/build_linux_aarch64.sh delete mode 100755 package-system/pyside2/package_linux_aarch64.sh diff --git a/package-system/pyside2/build_linux_aarch64.sh b/package-system/pyside2/build_linux_aarch64.sh deleted file mode 100755 index 17f4054b..00000000 --- a/package-system/pyside2/build_linux_aarch64.sh +++ /dev/null @@ -1,76 +0,0 @@ -#!/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 -# -# - - -# Get the python executable from the package dependency -LOCAL_PYTHON3_BIN=$TEMP_FOLDER/python-3.10.5-rev2-linux-aarch64/python/bin/python3 - -SCRIPT_PATH=`dirname $0` - - -if [ ! -f "$LOCAL_PYTHON3_BIN" ] -then - echo "Missing 3P dependency of python-3.10.5 $LOCAL_PYTHON3_BIN" - echo "You will need to build the 3P version of python under the '`readlink -f ../python`'' folder" - echo "with the following command:" - echo - echo "python3 build_package_image.py" - echo - exit 1 -fi - -# Set the dependent clang compiler for the build script to use -export LLVM_INSTALL_DIR=/usr/lib/llvm-6.0 -export LLVM_CONFIG=/usr/bin/llvm-config-6.0 - - -# Get the qt package's qmake location -LOCAL_3P_QTBUILD_PATH=$TEMP_FOLDER/qt-5.15.2-rev8-linux-aarch64/qt -LOCAL_3P_QTBUILD_QMAKE_PATH=`readlink -f $LOCAL_3P_QTBUILD_PATH/bin/qmake` -LOCAL_3P_QTBUILD_LIB_PATH=`readlink -f $LOCAL_3P_QTBUILD_PATH/lib` -if [ ! -f "$LOCAL_3P_QTBUILD_QMAKE_PATH" ] -then - echo "Missing 3P dependency of Qt $LOCAL_3P_QTBUILD_PATH" - echo - exit 1 -fi - -# An additional patch needs to be applied since pyside-tools in the pyside2 repo is a ref -pushd $TEMP_FOLDER/src/sources/pyside2-tools -PYSIDE_TOOLS_PATCH_FILE=$TEMP_FOLDER/../pyside2-tools.patch -echo Applying patch $PYSIDE_TOOLS_PATCH_FILE to pyside-tools -git apply --ignore-whitespace $PYSIDE_TOOLS_PATCH_FILE -if [ $? -eq 0 ]; then - echo "Patch applied" -else - echo "Git apply failed" - popd - exit $retVal -fi -popd - - -echo Building source -pushd $TEMP_FOLDER/src - -LD_LIBRARY_PATH=$LOCAL_3P_QTBUILD_LIB_PATH/ -export LD_LIBRARY_PATH - -# Build shiboken2 library first since it is -echo "$LOCAL_PYTHON3_BIN setup.py install --qmake=$LOCAL_3P_QTBUILD_QMAKE_PATH --build-type=shiboken2 --limited-api=yes --skip-modules=Qml,Quick,Positioning,Location,RemoteObjects,Scxml,TextToSpeech,3DCore,3DRender,3DInput,3DLogic,3DAnimation,3DExtras,Multimedia,MultimediaWidgets,AxContainer" -$LOCAL_PYTHON3_BIN setup.py install --qmake=$LOCAL_3P_QTBUILD_QMAKE_PATH --build-type=shiboken2 --limited-api=yes --skip-modules=Qml,Quick,QuickWidgets,Positioning,Location,RemoteObjects,Scxml,TextToSpeech,3DCore,3DRender,3DInput,3DLogic,3DAnimation,3DExtras,Multimedia,MultimediaWidgets,AxContainer - - -echo "$LOCAL_PYTHON3_BIN setup.py install --qmake=$LOCAL_3P_QTBUILD_QMAKE_PATH --build-type=pyside2 --no-examples --skip-docs --standalone --limited-api=yes --skip-modules=Qml,Quick,QtQuickControls2,Positioning,Location,RemoteObjects,Scxml,TextToSpeech,3DCore,3DRender,3DInput,3DLogic,3DAnimation,3DExtras,Multimedia,MultimediaWidgets,AxContainer" --shiboken-config-dir=$TEMP_FOLDER/src/pyside3a_install/py3.10-qt5.15.1-64bit-release/lib/cmake/Shiboken2-5.15.2.1 -$LOCAL_PYTHON3_BIN setup.py install --qmake=$LOCAL_3P_QTBUILD_QMAKE_PATH --build-type=pyside2 --no-examples --skip-docs --standalone --limited-api=yes --skip-modules=Qml,Quick,QuickWidgets,QtQuickControls2,Positioning,Location,RemoteObjects,Scxml,TextToSpeech,3DCore,3DRender,3DInput,3DLogic,3DAnimation,3DExtras,Multimedia,MultimediaWidgets,AxContainer --shiboken-config-dir=$TEMP_FOLDER/src/pyside3a_install/py3.10-qt5.15.1-64bit-release/lib/cmake/Shiboken2-5.15.2.1 - -popd - -exit 0 diff --git a/package-system/pyside2/package_linux_aarch64.sh b/package-system/pyside2/package_linux_aarch64.sh deleted file mode 100755 index f0390d3c..00000000 --- a/package-system/pyside2/package_linux_aarch64.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/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 -# -# - -# TEMP_FOLDER and TARGET_INSTALL_ROOT get set from the pull_and_build_from_git.py script - -PACKAGE_BASE=$TARGET_INSTALL_ROOT -echo PACKAGE_BASE=$PACKAGE_BASE -INSTALL_SOURCE=$TEMP_FOLDER/src/pyside3a_install/`ls $TEMP_FOLDER/src/pyside3a_install` -echo INSTALL_SOURCE=$INSTALL_SOURCE - -# Copy the LICENSE and README files -echo cp $TEMP_FOLDER/src/LICENSE.FDL $PACKAGE_BASE/ -cp $TEMP_FOLDER/src/LICENSE.FDL $PACKAGE_BASE/ -echo copy $TEMP_FOLDER/src/LICENSE.GPLv3 $PACKAGE_BASE/ -cp $TEMP_FOLDER/src/LICENSE.GPLv3 $PACKAGE_BASE/ -echo copy $TEMP_FOLDER/src/LICENSE.GPLv3-EXCEPT $PACKAGE_BASE/ -cp $TEMP_FOLDER/src/LICENSE.GPLv3-EXCEPT $PACKAGE_BASE/ -echo copy $TEMP_FOLDER/src/LICENSE.LGPLv3 $PACKAGE_BASE/ -cp $TEMP_FOLDER/src/LICENSE.LGPLv3 $PACKAGE_BASE/ -echo copy $TEMP_FOLDER/../LICENSES.txt $PACKAGE_BASE/ -cp $TEMP_FOLDER/../LICENSES.txt $PACKAGE_BASE/ -echo copy $TEMP_FOLDER/src/README.* $PACKAGE_BASE/ -cp $TEMP_FOLDER/src/README.* $PACKAGE_BASE/ - -cp -r $INSTALL_SOURCE/bin $PACKAGE_BASE -cp -r $INSTALL_SOURCE/include $PACKAGE_BASE -cp -r $INSTALL_SOURCE/lib $PACKAGE_BASE -cp -r $INSTALL_SOURCE/share $PACKAGE_BASE - -# RPATH fixes -$TEMP_FOLDER/src/patchelf --set-rpath \$ORIGIN $PACKAGE_BASE/lib/libpyside2.abi3.so.5.15.2.1 -$TEMP_FOLDER/src/patchelf --set-rpath \$ORIGIN $PACKAGE_BASE/lib/libshiboken2.abi3.so.5.15.2.1 -$TEMP_FOLDER/src/patchelf --set-rpath \$ORIGIN $PACKAGE_BASE/lib/python3.10/site-packages/shiboken2/shiboken2.abi3.so -$TEMP_FOLDER/src/patchelf --set-rpath \$ORIGIN $PACKAGE_BASE/bin/shiboken2 -$TEMP_FOLDER/src/patchelf --set-rpath \$ORIGIN $PACKAGE_BASE/bin/pyside2-lupdate - -# Add additional files needed for pip install -cp $TEMP_FOLDER/../__init__.py $PACKAGE_BASE/lib/python3.10/site-packages/ -cp $TEMP_FOLDER/../setup.py $PACKAGE_BASE/lib/python3.10/site-packages/ - -exit 0