From daab10b6a99fac85d11a17ea33bb3a118706d43d Mon Sep 17 00:00:00 2001 From: Mike Chang Date: Fri, 13 Dec 2024 10:23:23 -0800 Subject: [PATCH 1/3] Add disk expansion for linux Signed-off-by: Mike Chang --- .github/workflows/build-package.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/build-package.yaml b/.github/workflows/build-package.yaml index 2a224340..f82c288a 100644 --- a/.github/workflows/build-package.yaml +++ b/.github/workflows/build-package.yaml @@ -135,6 +135,16 @@ jobs: run: | git config --global core.longpaths true echo "uid_gid=$(id -u):$(id -g)" >> $GITHUB_OUTPUT + + - name: Expand disk size for Linux + uses: easimon/maximize-build-space@v10 + if: runner.os == 'Linux' + with: + root-reserve-mb: 6000 + swap-size-mb: 200 + remove-dotnet: true + remove-haskell: true + remove-codeql: true - name: Checkout 3P source repo uses: actions/checkout@v4 From 44219e704400771bd60cf3ae9c4fc776abbcbf3a Mon Sep 17 00:00:00 2001 From: galibzon <66021303+galibzon@users.noreply.github.com> Date: Tue, 4 Feb 2025 07:35:14 -0600 Subject: [PATCH 2/3] Upgraded openxr dependency to 1.1.41. (#270) This update makes it straightforward to build O3DE applications for Meta Quest devices, because the developer is not required anymore to download and decompress the `Oculus OpenXR Mobile SDK`. To understand this change, let's review a little bit of history: When making O3DE apps for Meta Quest devices, the developer was instructed to manually download and decompress the `Oculus OpenXR Mobile SDK` into a particular directory of the `OpenXRVk` Gem. Those instructions worked well until SDK v62. Starting SDK v63+ (It's currently at v72) Meta stopped distributing pre-compiled OpenXR Loader libraries, and now applications are simply required to get the OpenXR Loader directly from github: https://github.com/KhronosGroup/OpenXR-SDK In particular, this PR picks version 1.1.41 because that's the version used by `v72` of `Oculus OpenXR Mobile SDK`. In other words, with this change, OpenXR is now supported in its purest form, because there are no custom steps for a particular vendor. Also, it was found that when creating the Android package, the Android-tool.cmake tool doesn't copy the headers in the "install" directories. So I added an improvement to the `pull_and_build_from_git.py` script, where the `"extra_files_to_copy"` property now supports copying directories, with a third, optional, parameter, which is a list of file patterns to ignore when deepcopying the directories. Example: ```json { "extra_files_to_copy": [ ["temp/src/include", "OpenXR/include", ["*.txt", "*.license"]] ], } ``` Additionally, when copying files, it now supports automatic creation of non-existing sub-folders. --------- Signed-off-by: galibzon <66021303+galibzon@users.noreply.github.com> --- Scripts/extras/pull_and_build_from_git.py | 42 ++++++++++++++++++++--- package-system/OpenXR/build_config.json | 9 +++-- package_build_list_host_windows.json | 8 ++--- 3 files changed, 47 insertions(+), 12 deletions(-) diff --git a/Scripts/extras/pull_and_build_from_git.py b/Scripts/extras/pull_and_build_from_git.py index c3a18630..ec5df7bb 100644 --- a/Scripts/extras/pull_and_build_from_git.py +++ b/Scripts/extras/pull_and_build_from_git.py @@ -80,7 +80,11 @@ platforms and configurations. The final args will be (cmake_build_args || cmake_build_args_CONFIG) + cmake_build_args_common `cmake --build (build folder) --config config` will automatically be supplied. -* extra_files_to_copy : (optional) a list of pairs of files to copy [source, destination]. +* extra_files_to_copy : (optional) a list of pairs or triplets. + if the item is a pair, then it can be (source file, destination file) or + (source directory, destination directory). + Directories are always deep copied. + If a triplet is specified, then the third element is another list of file patterns to ignore when copying a directory. * cmake_install_filter : Optional list of filename patterns to filter what is actually copied to the target package based on the 3rd party library's install definition. (For example, a library may install headers and static @@ -936,17 +940,45 @@ def check_build_keys(self, keys_to_check): return False + def copy_file_or_directory(self, src: pathlib.Path, dst: pathlib.Path, ignore_patterns: list[str]): + """ + if @src is a directory, makes a deep copy of it into @dst. In this case @ignore_patterns is used. + if @src is a file, copies it as @dst, and will create all intermediate directories in @dst as needed. + """ + print(f"Source file: {src}, Destination file: {dst}") + if src.is_dir(): + # Recursive deep copy. Will create all subdirectories as needed. + def custom_copy(src, dst): + #If the destination file exists, we'll leave it as is, because + #it was generated already by the the build commands. + if os.path.exists(dst): + print(f"Destination file '{dst}' already exists. Skipping.") + else: + shutil.copy2(src, dst) + shutil.copytree(src, dst, ignore=shutil.ignore_patterns(*ignore_patterns), copy_function=custom_copy, dirs_exist_ok=True) + else: + # If the destination directory doesn't exist, shutil.copy2 raises an exception. + # Take care of this first. + dst.parent.mkdir(parents=True, exist_ok=True) + shutil.copy2(src,dst) + def copy_extra_files(self): """ Copies any extra files specified in the build config into the destination folder for packaging. """ extra_files_to_copy = self.package_info.extra_files_to_copy if extra_files_to_copy: - for (source, dest) in extra_files_to_copy: - print(f"Source file: {self.base_folder / source}, Destination file: {self.package_install_root / dest}") - shutil.copy2( + for params in extra_files_to_copy: + source = params[0] + dest = params[1] + if len(params) < 3: + ignore_patterns = ["",] + else: + ignore_patterns = params[2] + self.copy_file_or_directory( self.base_folder / source, - self.package_install_root / dest + self.package_install_root / dest, + ignore_patterns ) def build_for_platform(self): diff --git a/package-system/OpenXR/build_config.json b/package-system/OpenXR/build_config.json index 05572cad..8c2a232b 100644 --- a/package-system/OpenXR/build_config.json +++ b/package-system/OpenXR/build_config.json @@ -1,8 +1,8 @@ { "git_url":"https://github.com/KhronosGroup/OpenXR-SDK.git", - "git_tag":"release-1.0.22", + "git_tag":"release-1.1.41", "package_name":"OpenXR", - "package_version":"1.0.22-rev2", + "package_version":"1.1.41-rev1", "package_url":"https://www.khronos.org/openxr/", "package_license":"Apache-2.0", "package_license_file":"LICENSE", @@ -25,6 +25,9 @@ "Release", "Debug" ], + "extra_files_to_copy": [ + ["temp/src/include", "OpenXR/include", ["*.txt", "*.license"]] + ], "Platforms":{ "Windows":{ "Windows":{ @@ -32,7 +35,7 @@ ], "cmake_generate_args": [ "-G", - "\"Visual Studio 16 2019\"" + "\"Visual Studio 17 2022\"" ], "custom_test_cmd" : [ ] diff --git a/package_build_list_host_windows.json b/package_build_list_host_windows.json index 8c27a66d..e8afa9e4 100644 --- a/package_build_list_host_windows.json +++ b/package_build_list_host_windows.json @@ -39,8 +39,8 @@ "OpenMesh-8.1-rev3-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/OpenMesh --platform-name Windows --package-root ../../package-system --clean", "OpenSSL-1.1.1o-rev2-android": "package-system/OpenSSL/build_package_image.py --platform-name android", "OpenSSL-1.1.1o-rev1-windows": "package-system/OpenSSL/build_package_image.py", - "OpenXR-1.0.22-rev1-android": "Scripts/extras/pull_and_build_from_git.py ../../package-system/OpenXR --platform-name Android --package-root ../../package-system --clean", - "OpenXR-1.0.22-rev1-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/OpenXR --platform-name Windows --package-root ../../package-system --clean", + "OpenXR-1.1.41-rev1-android": "Scripts/extras/pull_and_build_from_git.py ../../package-system/OpenXR --platform-name Android --package-root ../../package-system/OpenXR/temp --clean", + "OpenXR-1.1.41-rev1-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/OpenXR --platform-name Windows --package-root ../../package-system/OpenXR/temp --clean", "PhysX-4.1.2.29882248-rev8-android": "package-system/PhysX/build_package_image.py --package-name PhysX-4.1.2.29882248 --package-rev rev8 --platform android", "PhysX-4.1.2.29882248-rev8-windows": "package-system/PhysX/build_package_image.py --package-name PhysX-4.1.2.29882248 --package-rev rev8 --platform windows", "PhysX-5.1.1-rev4-android": "package-system/PhysX5/build_package_image.py --package-name PhysX-5.1.1 --package-rev rev4 --platform android", @@ -108,8 +108,8 @@ "OpenMesh-8.1-rev3-windows": "package-system/OpenMesh-windows", "OpenSSL-1.1.1o-rev2-android": "package-system/OpenSSL/temp/OpenSSL-android", "OpenSSL-1.1.1o-rev1-windows": "package-system/OpenSSL/temp/OpenSSL-windows", - "OpenXR-1.0.22-rev1-android": "package-system/OpenXR-android", - "OpenXR-1.0.22-rev1-windows": "package-system/OpenXR-windows", + "OpenXR-1.1.41-rev1-android": "package-system/OpenXR/temp/OpenXR-android", + "OpenXR-1.1.41-rev1-windows": "package-system/OpenXR/temp/OpenXR-windows", "PhysX-4.1.2.29882248-rev8-android": "package-system/PhysX-android", "PhysX-4.1.2.29882248-rev8-windows": "package-system/PhysX-windows", "PhysX-5.1.1-rev4-android": "package-system/PhysX5/temp/PhysX5-android", From 8fbef3356ccc631058b76c214d741ca580c1380a Mon Sep 17 00:00:00 2001 From: Mike Chang Date: Sun, 2 Mar 2025 18:07:18 -0800 Subject: [PATCH 3/3] Update to 20GB for root disk Signed-off-by: Mike Chang --- .github/workflows/build-package.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-package.yaml b/.github/workflows/build-package.yaml index f82c288a..9645a063 100644 --- a/.github/workflows/build-package.yaml +++ b/.github/workflows/build-package.yaml @@ -140,7 +140,7 @@ jobs: uses: easimon/maximize-build-space@v10 if: runner.os == 'Linux' with: - root-reserve-mb: 6000 + root-reserve-mb: 20000 swap-size-mb: 200 remove-dotnet: true remove-haskell: true