Procházet zdrojové kódy

Update crashpad library to latest to allow linux build (#281)

Related to https://github.com/o3de/o3de/issues/6000. 

# What ?

The [crashpad
library](https://chromium.googlesource.com/crashpad/crashpad) is used to
generate dump files for your process when said process is about to
crash. The current version of the library only builds on Windows. With
this update to the latest version [available via
vcpgk](https://vcpkg.link/ports/crashpad) it can build on android, linux
and ios and mac as well.

# Changes

This PR keep the windows build, but also introduce the linux build
target. Other platform are to be introduced in future PR.

## What does the patchfile contains ?

I kept the library modification originally introduced by o3de, for
crashpad, it contains hooks to :

- Attach new content before sending the report to a server
(`AddAttachments` and `UpdateHttpTransport`)
- Destroy the report if we want to (`CheckConfirmation`)

I also introduced a new hook on client to be able to react to a crash
from the crashing process. As we are not currently sending over the dump
file, I will use it to create a log file with the callstack that user
can submit to github.

There are also modifications on the [vcpkg
portfile](https://github.com/microsoft/vcpkg/blob/5c41ff21f6feda702a7d5a1afc765f88d25783c5/ports/crashpad/portfile.cmake)
to modify the built target list. Instead of building the crash handler
executable as an external application, we build its dependencies as a
set of static libraries and do the building of the handler executable on
o3de side.

## Other changes

As, in order to apply the patchfile, its line-endings have to be LF
instead of CRLF, I've made that explicit via a gitattribute file to
prevent issues (I took me a bit to understand that the patchfile wasn't
applied because of line endings).

# How to test

> In order to debug the build, you might wanna change the `tempdir`
variable in `package-system/Crashpad/build_package_image.py` to an
actual existing repository

## On windows

With this repository and the
[3p-package-scripts](https://github.com/o3de/3p-package-scripts)
repository. From the `o3de_package_scripts` folder run :

```bash
python .\build_package.py  --search_path ..\..\3p-package-source Crashpad-0.8.0-rev2-windows
```

Copy the generated file
`3p-package-source\packages\Crashpad-0.8.0-rev2-windows.tar.xz` to your
third party location. By default
`USER\.o3de\3rdParty\downloaded_packages`

Then with a source build of the engine. Modify :

- `o3de\cmake\3rdParty\Platform\Windows\BuiltInPackages_windows.cmake` :
Update crashpad name and hash with what was provided by the library
build
- `o3de\cmake\Platform\Windows\PAL_windows.cmake` : Update
`PAL_TRAIT_BUILD_EXTERNAL_CRASH_HANDLER_SUPPORTED` to true

Rebuild, launch the editor, and in the console window, type "crash" and
press enter. The error handler dialog should open.

## On linux

The setup is similar to the windows one, however I had to do **`sudo apt
install python3-venv libcurl4-openssl-dev` for the build to work**. I
don't know if this can be worked around via vcpkg.

Then to actually test the package on the linux engine, multiple cmake
files are missing and needs to be added on the CrashHandler library on
o3de side. Once everything was setup, **I did encounter link issues with
crashpad that I wasn't able to resolve yet** (the crashpad minidump
library not finding symbols in the crashpad snapshot library).

I still decided to include the linux build inclusion to reduce the
future efforts needed to make crashpad work on o3de linux

---------

Signed-off-by: guillaume-haerinck <[email protected]>
Guillaume Haerinck před 1 měsícem
rodič
revize
a2482207bc

+ 1 - 0
.gitattributes

@@ -0,0 +1 @@
+package-system/Crashpad/add_o3de_handler_extensions.patch eol=lf

+ 1 - 1
NOTICES.txt

@@ -3460,7 +3460,7 @@ https://github.com/svaarala/duktape/blob/master/LICENSE.txt
 
 ------------------------------------
 
-Package path: ..\..\..\3rdParty\packages\Crashpad-0.8.0-rev1-windows\Crashpad\share\crashpad\copyright
+Package path: ..\..\..\3rdParty\packages\Crashpad-0.8.0-rev2-windows\Crashpad\share\crashpad\copyright
 
 License:
 

+ 1 - 1
README.md

@@ -15,7 +15,7 @@ Some notable examples
  * OpenSSL - this one uses vcpkg to build the package image.
  * Lua - this one uses a script called pull_and_build_from_git.py (in Scripts/extras) to build the package image.
 
- See the documentation (README.md in 3p-package-scripts repo for a full description of how to author packages.)
+ See the documentation (README.md in [3p-package-scripts repo](https://github.com/o3de/3p-package-scripts) for a full description of how to author packages.)
  
 ## Setup Packages Using Prebuilt Libraries
 3rdParty packages depend on prebuilt libraries. This allows 3rdParty authors to ship their libraries (.dll, .lib, .so, .a, etc) so customers do not need source code. This section covers how to author packages that depend on prebuilt libraries who also have dependencies of their own.

+ 1 - 1
SPDX-Licenses.csv

@@ -10,7 +10,7 @@ azslc-1.7.34-rev1-windows,https://github.com/o3de/o3de-azslc,CUSTOM,azslc/LICENS
 Blast-v1.1.7_rc2-9-geb169fe-rev2-windows,https://github.com/NVIDIAGameWorks/Blast,custom,Blast/license.txt
 cityhash-1.1-multiplatform,http://code.google.com/p/cityhash/,MIT,cityhash/COPYING
 civetweb-1.8-rev1-windows,https://github.com/civetweb/civetweb,custom,civetweb/LICENSE.md
-Crashpad-0.8.0-rev1-windows,https://chromium.googlesource.com/crashpad/crashpad/+/master/README.md,Apache-2.0,Crashpad/share/crashpad/copyright
+Crashpad-0.8.0-rev2-windows,https://chromium.googlesource.com/crashpad/crashpad/+/master/README.md,Apache-2.0,Crashpad/share/crashpad/copyright
 d3dx12-headers-rev1-windows,https://github.com/microsoft/DirectX-Headers,MIT License,d3dx12/license.txt
 DirectXShaderCompilerDxc-1.6.2104-o3de-rev3-windows,https://github.com/aws-lumberyard/DirectXShaderCompiler,NCSA,DirectXShaderCompilerDxc/LICENSE.TXT
 expat-2.4.2-rev1-windows,https://libexpat.github.io/,MIT,expat/COPYING

+ 1 - 1
SPDX-Licenses.json

@@ -66,7 +66,7 @@
         "LicenseFile": "civetweb/LICENSE.md"
     },
     {
-        "PackageName": "Crashpad-0.8.0-rev1-windows",
+        "PackageName": "Crashpad-0.8.0-rev2-windows",
         "URL": "https://chromium.googlesource.com/crashpad/crashpad/+/master/README.md",
         "License": "Apache-2.0",
         "LicenseFile": "Crashpad/share/crashpad/copyright"

+ 13 - 2
Scripts/builders/vcpkgbuilder.py

@@ -183,11 +183,22 @@ class VcpkgBuilder(object):
             cwd=self.vcpkgDir,
         )
 
-    def build(self):
+    def build(self, allow_unsupported=False):
         self.remove()
 
+        command = [
+            str(self.vcpkgDir / 'vcpkg'),
+            'install',
+            f'{self.portName}:{self.triplet}',
+            '--no-binarycaching',
+            f'--overlay-triplets={self.customTripletsDir}'
+        ]
+
+        if allow_unsupported:
+            command.append('--allow-unsupported')
+
         subprocess.check_call(
-            [str(self.vcpkgDir / 'vcpkg'), 'install', f'{self.portName}:{self.triplet}', '--no-binarycaching', f'--overlay-triplets={self.customTripletsDir}'],
+            command,
             cwd=self.vcpkgDir, 
             env=self._customEnviron
         )

+ 2 - 2
package-system/AWSNativeSDK/README.md

@@ -88,7 +88,7 @@ As current version is `1.9.50-rev2`, bump it to `1.9.50-rev3` for example
 +        "AWSNativeSDK-1.9.50-rev3-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AWSNativeSDK --platform-name Windows --package-root ../../package-system --clean",
          "AWSNativeSDK-1.9.50-rev1-android": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AWSNativeSDK --platform-name Android --package-root ../../package-system --clean",
          "Blast-v1.1.7_rc2-9-geb169fe-rev2-windows": "package-system/Blast/build_package_image.py --platform-name windows",
-         "Crashpad-0.8.0-rev1-windows": "package-system/Crashpad/build_package_image.py",
+         "Crashpad-0.8.0-rev2-windows": "package-system/Crashpad/build_package_image.py",
 @@ -51,7 +51,7 @@
    "build_from_folder": {
      "astc-encoder-3.2-rev2-windows" : "package-system/astc-encoder-windows",
@@ -97,7 +97,7 @@ As current version is `1.9.50-rev2`, bump it to `1.9.50-rev3` for example
 +    "AWSNativeSDK-1.9.50-rev3-windows": "package-system/AWSNativeSDK-windows",
      "AWSNativeSDK-1.9.50-rev1-android": "package-system/AWSNativeSDK-android",
      "Blast-v1.1.7_rc2-9-geb169fe-rev1-windows": "package-system/Blast-windows",
-     "Crashpad-0.8.0-rev1-windows" : "package-system/Crashpad-windows",
+     "Crashpad-0.8.0-rev2-windows" : "package-system/Crashpad-windows",
 ```
 
 ### 5. Follow 3p-package-scripts runbook to build and distribute package

+ 90 - 0
package-system/Crashpad/FindCrashpad_linux.cmake.template

@@ -0,0 +1,90 @@
+# 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(CMakeParseArguments)
+
+set(CRASHPAD_PACKAGE_NAME Crashpad)
+set(CRASHPAD_LIBS_DIR $${CMAKE_CURRENT_LIST_DIR}/Crashpad/$$<$$<CONFIG:debug>:debug/>lib)
+set(CRASHPAD_INCLUDE_DIR $${CMAKE_CURRENT_LIST_DIR}/Crashpad/include/crashpad)
+
+# Helper function to define crashpad libraries
+function(ly_declare_crashpad_library)
+
+    set(options HANDLER)
+    set(oneValueArgs NAME)
+    set(multiValueArgs ADDITIONAL_INCLUDE_DIRS LIBS BUILD_DEPENDENCIES)
+
+    cmake_parse_arguments(ly_declare_crashpad_library "$${options}" "$${oneValueArgs}" "$${multiValueArgs}" $${ARGN})
+
+    if (ly_declare_crashpad_library_HANDLER)
+        set(TARGET_WITH_NAMESPACE "3rdParty::$${CRASHPAD_PACKAGE_NAME}::Handler")
+    else()
+        set(TARGET_WITH_NAMESPACE "3rdParty::$${CRASHPAD_PACKAGE_NAME}")
+    endif()
+
+    if (TARGET $${TARGET_WITH_NAMESPACE})
+        return()
+    endif()
+
+    add_library($${TARGET_WITH_NAMESPACE} INTERFACE IMPORTED GLOBAL)
+
+    if (ly_declare_crashpad_library_ADDITIONAL_INCLUDE_DIRS)
+        ly_target_include_system_directories(TARGET $${TARGET_WITH_NAMESPACE}
+            INTERFACE
+                "$${CRASHPAD_INCLUDE_DIR}"
+                "$${CRASHPAD_INCLUDE_DIR}/mini_chromium"
+                $${ly_declare_crashpad_library_ADDITIONAL_INCLUDE_DIRS}
+        )
+    else()
+        ly_target_include_system_directories(TARGET $${TARGET_WITH_NAMESPACE}
+            INTERFACE
+                "$${CRASHPAD_INCLUDE_DIR}"
+                "$${CRASHPAD_INCLUDE_DIR}/mini_chromium"
+        )
+    endif()
+
+    if (ly_declare_crashpad_library_BUILD_DEPENDENCIES)
+        target_link_libraries($${TARGET_WITH_NAMESPACE}
+            INTERFACE
+                $${ly_declare_crashpad_library_LIBS}
+                $${ly_declare_crashpad_library_BUILD_DEPENDENCIES}
+        )
+    else()
+        target_link_libraries($${TARGET_WITH_NAMESPACE}
+            INTERFACE
+                $${ly_declare_crashpad_library_LIBS}
+        )
+    endif()
+
+endfunction()
+
+#### Crashpad ####
+ly_declare_crashpad_library(
+    LIBS
+        "$${CRASHPAD_LIBS_DIR}/$${CMAKE_STATIC_LIBRARY_PREFIX}vcpkg_crashpad_base$${CMAKE_STATIC_LIBRARY_SUFFIX}"
+        "$${CRASHPAD_LIBS_DIR}/$${CMAKE_STATIC_LIBRARY_PREFIX}vcpkg_crashpad_client$${CMAKE_STATIC_LIBRARY_SUFFIX}"
+        "$${CRASHPAD_LIBS_DIR}/$${CMAKE_STATIC_LIBRARY_PREFIX}vcpkg_crashpad_client_common$${CMAKE_STATIC_LIBRARY_SUFFIX}"
+        "$${CRASHPAD_LIBS_DIR}/$${CMAKE_STATIC_LIBRARY_PREFIX}vcpkg_crashpad_util$${CMAKE_STATIC_LIBRARY_SUFFIX}"
+)
+
+#### Crashpad Handler ####
+ly_declare_crashpad_library(
+    HANDLER
+    LIBS
+        "$${CRASHPAD_LIBS_DIR}/$${CMAKE_STATIC_LIBRARY_PREFIX}compat$${CMAKE_STATIC_LIBRARY_SUFFIX}"
+        "$${CRASHPAD_LIBS_DIR}/$${CMAKE_STATIC_LIBRARY_PREFIX}context$${CMAKE_STATIC_LIBRARY_SUFFIX}"
+        "$${CRASHPAD_LIBS_DIR}/$${CMAKE_STATIC_LIBRARY_PREFIX}format$${CMAKE_STATIC_LIBRARY_SUFFIX}"
+        "$${CRASHPAD_LIBS_DIR}/$${CMAKE_STATIC_LIBRARY_PREFIX}minidump$${CMAKE_STATIC_LIBRARY_SUFFIX}"
+        "$${CRASHPAD_LIBS_DIR}/$${CMAKE_STATIC_LIBRARY_PREFIX}handler$${CMAKE_STATIC_LIBRARY_SUFFIX}"
+        "$${CRASHPAD_LIBS_DIR}/$${CMAKE_STATIC_LIBRARY_PREFIX}vcpkg_crashpad_handler_common$${CMAKE_STATIC_LIBRARY_SUFFIX}"
+        "$${CRASHPAD_LIBS_DIR}/$${CMAKE_STATIC_LIBRARY_PREFIX}snapshot$${CMAKE_STATIC_LIBRARY_SUFFIX}"
+        "$${CRASHPAD_LIBS_DIR}/$${CMAKE_STATIC_LIBRARY_PREFIX}tool_support$${CMAKE_STATIC_LIBRARY_SUFFIX}"
+        "$${CRASHPAD_LIBS_DIR}/$${CMAKE_STATIC_LIBRARY_PREFIX}net$${CMAKE_STATIC_LIBRARY_SUFFIX}"
+    BUILD_DEPENDENCIES
+        "3rdParty::$${CRASHPAD_PACKAGE_NAME}"
+)  

+ 6 - 3
package-system/Crashpad/FindCrashpad_windows.cmake.template

@@ -66,9 +66,10 @@ endfunction()
 #### Crashpad ####
 ly_declare_crashpad_library(
     LIBS
-        "$${CRASHPAD_LIBS_DIR}/$${CMAKE_STATIC_LIBRARY_PREFIX}base$${CMAKE_STATIC_LIBRARY_SUFFIX}"
-        "$${CRASHPAD_LIBS_DIR}/$${CMAKE_STATIC_LIBRARY_PREFIX}client$${CMAKE_STATIC_LIBRARY_SUFFIX}"
-        "$${CRASHPAD_LIBS_DIR}/$${CMAKE_STATIC_LIBRARY_PREFIX}util$${CMAKE_STATIC_LIBRARY_SUFFIX}"
+        "$${CRASHPAD_LIBS_DIR}/$${CMAKE_STATIC_LIBRARY_PREFIX}vcpkg_crashpad_base$${CMAKE_STATIC_LIBRARY_SUFFIX}"
+        "$${CRASHPAD_LIBS_DIR}/$${CMAKE_STATIC_LIBRARY_PREFIX}vcpkg_crashpad_client$${CMAKE_STATIC_LIBRARY_SUFFIX}"
+        "$${CRASHPAD_LIBS_DIR}/$${CMAKE_STATIC_LIBRARY_PREFIX}vcpkg_crashpad_client_common$${CMAKE_STATIC_LIBRARY_SUFFIX}"
+        "$${CRASHPAD_LIBS_DIR}/$${CMAKE_STATIC_LIBRARY_PREFIX}vcpkg_crashpad_util$${CMAKE_STATIC_LIBRARY_SUFFIX}"
 )
 
 #### Crashpad Handler ####
@@ -83,9 +84,11 @@ ly_declare_crashpad_library(
         "$${CRASHPAD_LIBS_DIR}/$${CMAKE_STATIC_LIBRARY_PREFIX}minidump$${CMAKE_STATIC_LIBRARY_SUFFIX}"
         "$${CRASHPAD_LIBS_DIR}/$${CMAKE_STATIC_LIBRARY_PREFIX}getopt$${CMAKE_STATIC_LIBRARY_SUFFIX}"
         "$${CRASHPAD_LIBS_DIR}/$${CMAKE_STATIC_LIBRARY_PREFIX}handler$${CMAKE_STATIC_LIBRARY_SUFFIX}"
+        "$${CRASHPAD_LIBS_DIR}/$${CMAKE_STATIC_LIBRARY_PREFIX}vcpkg_crashpad_handler_common$${CMAKE_STATIC_LIBRARY_SUFFIX}"
         "$${CRASHPAD_LIBS_DIR}/$${CMAKE_STATIC_LIBRARY_PREFIX}snapshot$${CMAKE_STATIC_LIBRARY_SUFFIX}"
         "$${CRASHPAD_LIBS_DIR}/$${CMAKE_STATIC_LIBRARY_PREFIX}tool_support$${CMAKE_STATIC_LIBRARY_SUFFIX}"
         "$${CRASHPAD_LIBS_DIR}/$${CMAKE_STATIC_LIBRARY_PREFIX}zlib$${CMAKE_STATIC_LIBRARY_SUFFIX}"
+        "$${CRASHPAD_LIBS_DIR}/$${CMAKE_STATIC_LIBRARY_PREFIX}net$${CMAKE_STATIC_LIBRARY_SUFFIX}"
     BUILD_DEPENDENCIES
         "3rdParty::$${CRASHPAD_PACKAGE_NAME}"
         # Built-in Windows libraries

+ 212 - 124
package-system/Crashpad/add_o3de_handler_extensions.patch

@@ -1,40 +1,122 @@
-diff --git a/ports/crashpad/CONTROL b/ports/crashpad/CONTROL
-index dab2671..2275f0a 100644
---- a/ports/crashpad/CONTROL
-+++ b/ports/crashpad/CONTROL
-@@ -1,7 +1,6 @@
- Source: crashpad
--Version: 2020-03-18
-+Version: 2021-04-09
- Homepage: https://chromium.googlesource.com/crashpad/crashpad/+/master/README.md
- Description: Crashpad is a crash-reporting system.
-   Crashpad is a library for capturing, storing and transmitting postmortem crash reports from a client to an upstream collection server. Crashpad aims to make it possible for clients to capture process state at the time of crash with the best possible fidelity and coverage, with the minimum of fuss.
--Build-Depends: zlib
- Supports: x64 & (osx|windows)
 diff --git a/ports/crashpad/o3de_handler_extensions.patch b/ports/crashpad/o3de_handler_extensions.patch
 new file mode 100644
-index 0000000..49ea935
+index 0000000..6f566f8
 --- /dev/null
 +++ b/ports/crashpad/o3de_handler_extensions.patch
-@@ -0,0 +1,84 @@
+@@ -0,0 +1,180 @@
++diff --git a/client/crashpad_client.h b/client/crashpad_client.h
++index 3c966686..75d01a84 100644
++--- a/client/crashpad_client.h
+++++ b/client/crashpad_client.h
++@@ -12,6 +12,10 @@
++ // See the License for the specific language governing permissions and
++ // limitations under the License.
++ 
+++// Modifications Copyright (c) Contributors to the Open 3D Engine Project. 
+++// SPDX-License-Identifier: Apache-2.0 OR MIT
+++// (See O3DE tagged section(s) below) 
+++
++ #ifndef CRASHPAD_CLIENT_CRASHPAD_CLIENT_H_
++ #define CRASHPAD_CLIENT_CRASHPAD_CLIENT_H_
++ 
++@@ -771,6 +775,29 @@ class CrashpadClient {
++   static bool DumpAndCrashTargetProcess(HANDLE process,
++                                         HANDLE blame_thread,
++                                         DWORD exception_code);
+++
+++  // O3DE - Handle giving the user the option to react to a crash
+++  //! \brief The type for custom handlers installed by clients.
+++  using FirstChanceHandler = bool (*)(EXCEPTION_POINTERS*);
+++  
+++  //! \brief Installs a custom crash signal handler which runs before the
+++  //!     currently installed Crashpad handler.
+++  //!
+++  //! Handling signals appropriately can be tricky and use of this method
+++  //! should be avoided, if possible.
+++  //!
+++  //! A handler must have already been installed before calling this method.
+++  //!
+++  //! The custom handler runs in a signal handler context and must be safe for
+++  //! that purpose.
+++  //!
+++  //! If the custom handler returns `true`, the signal is considered handled and
+++  //! the signal handler returns. Otherwise, the currently installed Crashpad
+++  //! signal handler is run.
+++  //!
+++  //! \param[in] handler The custom crash signal handler to install.
+++  static void SetFirstChanceExceptionHandler(FirstChanceHandler handler);
+++
++ #endif
++ 
++ #if BUILDFLAG(IS_APPLE) || DOXYGEN
++diff --git a/client/crashpad_client_win.cc b/client/crashpad_client_win.cc
++index c10df2b0..71435039 100644
++--- a/client/crashpad_client_win.cc
+++++ b/client/crashpad_client_win.cc
++@@ -12,6 +12,10 @@
++ // See the License for the specific language governing permissions and
++ // limitations under the License.
++ 
+++// Modifications Copyright (c) Contributors to the Open 3D Engine Project. 
+++// SPDX-License-Identifier: Apache-2.0 OR MIT
+++// (See O3DE tagged section(s) below) 
+++
++ #include "client/crashpad_client.h"
++ 
++ #include <windows.h>
++@@ -84,6 +88,9 @@ WerRegistration g_wer_registration = {WerRegistration::kWerRegistrationVersion,
++                                       {0},
++                                       {0}};
++ 
+++// O3DE - Handle storing the crash reaction handler
+++CrashpadClient::FirstChanceHandler g_first_chance_handler = nullptr;
+++
++ enum class StartupState : int {
++   kNotReady = 0,  // This must be value 0 because it is the initial value of a
++                   // global AtomicWord.
++@@ -134,6 +141,13 @@ LONG WINAPI UnhandledExceptionHandler(EXCEPTION_POINTERS* exception_pointers) {
++     return status;
++ #endif
++ 
+++  // O3DE - User react to a crash
+++  if (g_first_chance_handler && g_first_chance_handler(exception_pointers))
+++  {
+++    SafeTerminateProcess(GetCurrentProcess(), kTerminationCodeCrashNoDump);
+++    return EXCEPTION_CONTINUE_SEARCH;
+++  }
+++
++   if (BlockUntilHandlerStartedOrFailed() == StartupState::kFailed) {
++     // If we know for certain that the handler has failed to start, then abort
++     // here, rather than trying to signal to a handler that will never arrive,
++@@ -1126,4 +1140,9 @@ bool CrashpadClient::DumpAndCrashTargetProcess(HANDLE process,
++   return result;
++ }
++ 
+++void CrashpadClient::SetFirstChanceExceptionHandler(CrashpadClient::FirstChanceHandler handler)
+++{
+++  g_first_chance_handler = handler;
+++}
+++
++ }  // namespace crashpad
 +diff --git a/handler/crash_report_upload_thread.cc b/handler/crash_report_upload_thread.cc
-+index b7e445fd..27556a79 100644
++index 5bd2889e..e3cc0341 100644
 +--- a/handler/crash_report_upload_thread.cc
 ++++ b/handler/crash_report_upload_thread.cc
-+@@ -12,6 +12,9 @@
++@@ -12,6 +12,10 @@
 + // See the License for the specific language governing permissions and
 + // limitations under the License.
-+
-++ // Modifications Copyright (c) Contributors to the Open 3D Engine Project. 
-++ // SPDX-License-Identifier: Apache-2.0 OR MIT
-++ // (See O3DE tagged section(s) below) 
++ 
+++// Modifications Copyright (c) Contributors to the Open 3D Engine Project. 
+++// SPDX-License-Identifier: Apache-2.0 OR MIT
+++// (See O3DE tagged section(s) below) 
+++
 + #include "handler/crash_report_upload_thread.h"
-+
++ 
 + #include <errno.h>
-+@@ -44,6 +47,15 @@
-+ #include "handler/mac/file_limit_annotation.h"
-+ #endif  // OS_APPLE
-+
++@@ -48,6 +52,15 @@
++ #include "util/ios/scoped_background_task.h"
++ #endif  // BUILDFLAG(IS_IOS)
++ 
 ++// O3DE - Handle giving the user the option of whether or not to send the report.
 ++namespace O3de {
 ++    bool CheckConfirmation(const crashpad::CrashReportDatabase::Report& report);
@@ -45,12 +127,12 @@ index 0000000..49ea935
 ++}  // namespace O3de
 ++
 + namespace crashpad {
-+
-+ CrashReportUploadThread::CrashReportUploadThread(CrashReportDatabase* database,
-+@@ -153,6 +165,14 @@ void CrashReportUploadThread::ProcessPendingReport(
-+     return;
-+   }
-+
++ 
++ namespace {
++@@ -194,6 +207,14 @@ void CrashReportUploadThread::ProcessPendingReport(
++ 
++   Settings* const settings = database_->GetSettings();
++ 
 ++  // O3DE - Handle giving the user the option of whether or not to send the report.
 ++  if (!O3de::CheckConfirmation(report)) {
 ++    database_->SkipReportUpload(report.uuid,
@@ -59,23 +141,23 @@ index 0000000..49ea935
 ++    return;
 ++  }
 ++
-+   // This currently implements very simplistic rate-limiting, compatible with
-+   // the Breakpad client, where the strategy is to permit one upload attempt per
-+   // hour, and retire reports that would exceed this limit or for which the
-+@@ -293,6 +313,9 @@ CrashReportUploadThread::UploadResult CrashReportUploadThread::UploadReport(
++   bool uploads_enabled;
++   if (!report.upload_explicitly_requested &&
++       (!settings->GetUploadsEnabled(&uploads_enabled) || !uploads_enabled)) {
++@@ -327,6 +348,9 @@ CrashReportUploadThread::UploadResult CrashReportUploadThread::UploadReport(
 +                                            reader,
 +                                            "application/octet-stream");
-+
++ 
 ++  // O3DE
 ++  O3de::AddAttachments(http_multipart_builder);
 ++
 +   std::unique_ptr<HTTPTransport> http_transport(HTTPTransport::Create());
 +   if (!http_transport) {
 +     return UploadResult::kPermanentFailure;
-+@@ -332,6 +355,9 @@ CrashReportUploadThread::UploadResult CrashReportUploadThread::UploadReport(
++@@ -366,6 +390,9 @@ CrashReportUploadThread::UploadResult CrashReportUploadThread::UploadReport(
 +   }
 +   http_transport->SetURL(url);
-+
++ 
 ++  // O3DE
 ++  O3de::UpdateHttpTransport(http_transport, url);
 ++
@@ -83,18 +165,19 @@ index 0000000..49ea935
 +     return UploadResult::kRetry;
 +   }
 +diff --git a/tools/BUILD.gn b/tools/BUILD.gn
-+index 7da109bc..3bd0e895 100644
++index 157ee929..14ca33d2 100644
 +--- a/tools/BUILD.gn
 ++++ b/tools/BUILD.gn
-+@@ -12,9 +12,13 @@
++@@ -12,9 +12,14 @@
 + # See the License for the specific language governing permissions and
 + # limitations under the License.
-+
-++ // Modifications Copyright (c) Contributors to the Open 3D Engine Project. 
-++ // SPDX-License-Identifier: Apache-2.0 OR MIT
-++ // (See O3DE tagged section(s) below) 
++ 
+++# Modifications Copyright (c) Contributors to the Open 3D Engine Project. 
+++# SPDX-License-Identifier: Apache-2.0 OR MIT
+++# (See O3DE tagged section(s) below) 
+++
 + import("../build/crashpad_buildconfig.gni")
-+
++ 
 +-source_set("tool_support") {
 ++# O3DE - Change the tool_support target type from source set to static library
 ++crashpad_static_library("tool_support") {
@@ -102,35 +185,31 @@ index 0000000..49ea935
 +     "tool_support.cc",
 +     "tool_support.h",
 diff --git a/ports/crashpad/portfile.cmake b/ports/crashpad/portfile.cmake
-index 30026d5..e286b32 100644
+index 6985a8b..f45bc36 100644
 --- a/ports/crashpad/portfile.cmake
 +++ b/ports/crashpad/portfile.cmake
-@@ -7,7 +7,8 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
- vcpkg_from_git(
-     OUT_SOURCE_PATH SOURCE_PATH
-     URL https://chromium.googlesource.com/crashpad/crashpad
--    REF 9a31d3f8e9815774026a753a1ff6155347cd549f
-+    REF f1943fcb571c211418657dc614e1cf6f74a2334e
-+    PATCHES "o3de_handler_extensions.patch"
+@@ -7,6 +7,7 @@ vcpkg_from_git(
+     PATCHES
+         fix-linux.patch
+         fix-lib-name-conflict.patch
++        o3de_handler_extensions.patch
  )
  
- function(checkout_in_path PATH URL REF)
-@@ -28,38 +29,13 @@ endfunction()
- checkout_in_path(
-     "${SOURCE_PATH}/third_party/mini_chromium/mini_chromium"
-     "https://chromium.googlesource.com/chromium/mini_chromium"
--    "c426ff98e1d9e9d59777fe8b883a5c0ceeca9ca3"
-+    "329ca82f73a592d832e79334bed842fba85b9fdd"
- )
+ vcpkg_find_acquire_program(PYTHON3)
+@@ -40,41 +41,24 @@ if(NOT EXISTS "${SOURCE_PATH}/third_party/lss/lss/BUILD.gn" AND (VCPKG_TARGET_IS
+     file(RENAME "${lss}" "${SOURCE_PATH}/third_party/lss/lss")
+ endif()
  
 -function(replace_gn_dependency INPUT_FILE OUTPUT_FILE LIBRARY_NAMES)
--    unset(_LIBRARY_DEB CACHE)
--    find_library(_LIBRARY_DEB NAMES ${LIBRARY_NAMES}
--        PATHS "${CURRENT_INSTALLED_DIR}/debug/lib"
--        NO_DEFAULT_PATH)
+-    if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
+-        unset(_LIBRARY_DEB CACHE)
+-        find_library(_LIBRARY_DEB NAMES ${LIBRARY_NAMES}
+-          PATHS "${CURRENT_INSTALLED_DIR}/debug/lib"
+-          NO_DEFAULT_PATH)
 -
--    if(_LIBRARY_DEB MATCHES "-NOTFOUND")
--        message(FATAL_ERROR "Could not find debug library with names: ${LIBRARY_NAMES}")
+-        if(_LIBRARY_DEB MATCHES "-NOTFOUND")
+-            message(FATAL_ERROR "Could not find debug library with names: ${LIBRARY_NAMES}")
+-        endif()
 -    endif()
 -
 -    unset(_LIBRARY_REL CACHE)
@@ -140,14 +219,28 @@ index 30026d5..e286b32 100644
 -
 -    if(_LIBRARY_REL MATCHES "-NOTFOUND")
 -        message(FATAL_ERROR "Could not find library with names: ${LIBRARY_NAMES}")
++function(checkout_in_path PATH URL REF)
++    if(EXISTS "${PATH}")
++        return()
+     endif()
+ 
+-    if(VCPKG_BUILD_TYPE STREQUAL "release")
+-        set(_LIBRARY_DEB ${_LIBRARY_REL})
 -    endif()
 -
 -    set(_INCLUDE_DIR "${CURRENT_INSTALLED_DIR}/include")
 -
 -    file(REMOVE "${OUTPUT_FILE}")
 -    configure_file("${INPUT_FILE}" "${OUTPUT_FILE}" @ONLY)
--endfunction()
--
++    vcpkg_from_git(
++        OUT_SOURCE_PATH DEP_SOURCE_PATH
++        URL "${URL}"
++        REF "${REF}"
++    )
++    file(RENAME "${DEP_SOURCE_PATH}" "${PATH}")
++    file(REMOVE_RECURSE "${DEP_SOURCE_PATH}")
+ endfunction()
+ 
 -replace_gn_dependency(
 -    "${CMAKE_CURRENT_LIST_DIR}/zlib.gn"
 -    "${SOURCE_PATH}/third_party/zlib/BUILD.gn"
@@ -155,20 +248,27 @@ index 30026d5..e286b32 100644
 +checkout_in_path(
 +    "${SOURCE_PATH}/third_party/zlib/zlib"
 +    "https://chromium.googlesource.com/chromium/src/third_party/zlib"
-+    "13dc246a58e4b72104d35f9b1809af95221ebda7"
++    "1e85c01b15363d11fab81c46fe2b5c2179113f70"
  )
  
- set(OPTIONS_DBG "is_debug=true")
-@@ -102,7 +78,7 @@ vcpkg_configure_gn(
+ set(OPTIONS "target_cpu=\"${VCPKG_TARGET_ARCHITECTURE}\"")
+@@ -127,9 +111,14 @@ vcpkg_gn_configure(
+     OPTIONS_RELEASE "${OPTIONS_REL}"
+ )
  
- vcpkg_install_gn(
++set(TARGET_MODULES client client:common util third_party/mini_chromium/mini_chromium/base handler handler:common util:net tools:tool_support compat minidump:format minidump snapshot:context snapshot)
++if(VCPKG_TARGET_IS_WINDOWS)
++    list(APPEND TARGET_MODULES third_party/getopt third_party/zlib)
++endif()
++
+ vcpkg_gn_install(
      SOURCE_PATH "${SOURCE_PATH}"
--    TARGETS client util third_party/mini_chromium/mini_chromium/base handler:crashpad_handler
-+    TARGETS client compat handler minidump:format minidump snapshot:context snapshot third_party/getopt third_party/mini_chromium/mini_chromium/base third_party/zlib tools:tool_support util
+-    TARGETS client client:common util third_party/mini_chromium/mini_chromium/base handler:crashpad_handler
++    TARGETS ${TARGET_MODULES}
  )
  
  message(STATUS "Installing headers...")
-@@ -111,19 +87,40 @@ function(install_headers DIR)
+@@ -138,9 +127,17 @@ function(install_headers DIR)
      file(COPY "${DIR}" DESTINATION "${PACKAGES_INCLUDE_DIR}" FILES_MATCHING PATTERN "*.h")
  endfunction()
  install_headers("${SOURCE_PATH}/client")
@@ -176,59 +276,47 @@ index 30026d5..e286b32 100644
 +install_headers("${SOURCE_PATH}/handler")
 +install_headers("${SOURCE_PATH}/minidump")
 +install_headers("${SOURCE_PATH}/snapshot")
-+install_headers("${SOURCE_PATH}/third_party/getopt")
 +install_headers("${SOURCE_PATH}/third_party/mini_chromium/mini_chromium")
-+install_headers("${SOURCE_PATH}/third_party/zlib/zlib")
 +install_headers("${SOURCE_PATH}/tools")
  install_headers("${SOURCE_PATH}/util")
 -install_headers("${SOURCE_PATH}/third_party/mini_chromium/mini_chromium/base")
 -install_headers("${SOURCE_PATH}/third_party/mini_chromium/mini_chromium/build")
++if(VCPKG_TARGET_IS_WINDOWS)
++    install_headers("${SOURCE_PATH}/third_party/getopt")
++    install_headers("${SOURCE_PATH}/third_party/zlib/zlib")
++endif()
+ 
+ file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/gen/build/chromeos_buildflags.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/${PORT}/build")
+ file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/gen/build/chromeos_buildflags.h.flags" DESTINATION "${CURRENT_PACKAGES_DIR}/include/${PORT}/build")
+@@ -152,18 +149,6 @@ if(VCPKG_TARGET_IS_OSX)
+     file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/obj/util/libmig_output.a" DESTINATION "${CURRENT_PACKAGES_DIR}/lib")
+ endif()
  
+-vcpkg_copy_tools(
+-    TOOL_NAMES crashpad_handler
+-    SEARCH_DIR "${CURRENT_PACKAGES_DIR}/tools")
+-
+-if(NOT VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_MINGW)
+-    file(CHMOD "${CURRENT_PACKAGES_DIR}/tools/crashpad_handler" FILE_PERMISSIONS
+-      OWNER_READ OWNER_WRITE OWNER_EXECUTE
+-      GROUP_READ GROUP_EXECUTE
+-      WORLD_READ WORLD_EXECUTE
+-    )
+-endif()
+-
  # remove empty directories
  file(REMOVE_RECURSE
      "${PACKAGES_INCLUDE_DIR}/util/net/testdata"
--    "${PACKAGES_INCLUDE_DIR}/build/ios")
--
--configure_file("${CMAKE_CURRENT_LIST_DIR}/crashpadConfig.cmake.in"
--        "${CURRENT_PACKAGES_DIR}/share/${PORT}/crashpadConfig.cmake" @ONLY)
-+    "${PACKAGES_INCLUDE_DIR}/build/ios"
-+    "${PACKAGES_INCLUDE_DIR}/build/config"
-+    "${PACKAGES_INCLUDE_DIR}/compat/ios"
-+    "${PACKAGES_INCLUDE_DIR}/mini_chromium/build/config"
-+    "${PACKAGES_INCLUDE_DIR}/mini_chromium/build/ios"
-+    "${PACKAGES_INCLUDE_DIR}/snapshot/elf/elf_image_reader_fuzzer_corpus"
-+    "${PACKAGES_INCLUDE_DIR}/tools/mac"
-+    "${PACKAGES_INCLUDE_DIR}/zlib/google/test"
-+    )
- 
- vcpkg_copy_pdbs()
- file(INSTALL "${SOURCE_PATH}/LICENSE"
-     DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}"
-     RENAME copyright)
-+
-+message(STATUS "Installing third party licenses...")
-+file(INSTALL "${SOURCE_PATH}/third_party/getopt/LICENSE"
-+    DESTINATION "${PACKAGES_INCLUDE_DIR}/getopt")
-+file(INSTALL "${SOURCE_PATH}/third_party/mini_chromium/mini_chromium/LICENSE"
-+    DESTINATION "${PACKAGES_INCLUDE_DIR}/mini_chromium")
-+file(INSTALL "${SOURCE_PATH}/third_party/mini_chromium/mini_chromium/base/third_party/icu/LICENSE"
-+    DESTINATION "${PACKAGES_INCLUDE_DIR}/mini_chromium/base/third_party/icu")
-+file(INSTALL "${SOURCE_PATH}/third_party/zlib/zlib/LICENSE"
-+    DESTINATION "${PACKAGES_INCLUDE_DIR}/zlib")
-\ No newline at end of file
-diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake
-index 36bbc6e..3a1eff6 100644
---- a/scripts/cmake/vcpkg_find_acquire_program.cmake
-+++ b/scripts/cmake/vcpkg_find_acquire_program.cmake
-@@ -129,9 +129,9 @@ function(vcpkg_find_acquire_program VAR)
-       set(GN_PLATFORM "mac-amd64")
-       set(HASH "03ee64cb15bae7fceb412900d470601090bce147cfd45eb9b46683ac1a5dca848465a5d74c55a47df7f0e334d708151249a6d37bb021de74dd48b97ed4a07937")
-     else()
--      set(GN_VERSION "qUkAhy9J0P7c5racy-9wB6AHNK_btS18im8S06_ehhwC")
-+      set(GN_VERSION "wQfA3hac83q4RphIC4nawg-fZT4kzjVyTq04gR-3hGAC")
-       set(GN_PLATFORM "windows-amd64")
--      set(HASH "263e02bd79eee0cb7b664831b7898565c5656a046328d8f187ef7ae2a4d766991d477b190c9b425fcc960ab76f381cd3e396afb85cba7408ca9e74eb32c175db")
-+      set(HASH "b6331e74785d5c45b7137a391668c73bec0440613891424d5cc461936993363f01a9030a4ec97d7919ced00adc3890b35a3d51803f46de388a1f7acecc24ce20")
-     endif()
-     set(SUBDIR "${GN_VERSION}")
-     set(URL "${CIPD_DOWNLOAD_GN}/${GN_PLATFORM}/+/${GN_VERSION}")
+diff --git a/ports/crashpad/vcpkg.json b/ports/crashpad/vcpkg.json
+index c2e9cd5..a0d7bcf 100644
+--- a/ports/crashpad/vcpkg.json
++++ b/ports/crashpad/vcpkg.json
+@@ -27,7 +27,6 @@
+     {
+       "name": "vcpkg-tool-gn",
+       "host": true
+-    },
+-    "zlib"
++    }
+   ]
+ }

+ 67 - 58
package-system/Crashpad/build_package_image.py

@@ -18,36 +18,6 @@ sys.path.append(str(Path(__file__).parent.parent.parent / 'Scripts'))
 from builders.vcpkgbuilder import VcpkgBuilder
 import builders.monkeypatch_tempdir_cleanup
 
-
-def regex_to_remove(platform_name: str):
-    """
-    Get the regular expression for files and sub-folders to remove.
-
-    :param platform_name: Name of the platform.
-    :return: Regular expression for files and sub-folders to remove.
-    """
-    regex_map = {
-        'windows':
-            '^(?:.*_|.*\\\\)?(?:ios|mac|android|linux|fuchsia|non|x86|test|testing|vcpkg|BUILD_INFO|CONTROL)(?:_.*)?(?:\\.h)?$'
-    }
-    return regex_map.get(platform_name, '.*')
-
-def remove_files_by_regex(package_dir: Path, regex: str):
-    """
-    Remove files and sub-folders from the package by an regular expression.
-
-    :param package_dir: Path to the package directory.
-    :param regex: Regular expression for the files and sub-folders to remove.
-    """
-    pattern = re.compile(regex)
-    for item in package_dir.glob('**/*'):
-        if re.search(pattern, item.name) and item.exists():
-            if item.is_file():
-                item.unlink()
-            else:
-                shutil.rmtree(item)
-
-
 def main():
     parser = argparse.ArgumentParser(description='Builds this package')
     parser.add_argument(
@@ -56,6 +26,17 @@ def main():
         default=VcpkgBuilder.defaultPackagePlatformName(),
     )
     args = parser.parse_args()
+    vcpkg_platform_map = {
+            'windows': 'windows',
+            'android': 'android',
+            'mac': 'mac',
+            'ios': 'ios',
+            'linux': 'linux',
+            'linux-aarch64': 'linux' }
+
+    vcpkg_platform = vcpkg_platform_map[args.platform_name]
+    if args.platform_name == 'linux-aarch64':
+        os.environ['VCPKG_FORCE_SYSTEM_BINARIES'] = '1'
 
     package_system_dir = Path(__file__).resolve().parents[1]
     crashpad_package_source_dir = package_system_dir / 'Crashpad'
@@ -67,13 +48,41 @@ def main():
         cmake_find_file = crashpad_package_source_dir / 'FindCrashpad.cmake.template'
     cmake_find_file_template = cmake_find_file.open().read()
 
+    extraLibsPerPlatform = {
+        'linux': {
+            'EXTRA_SHARED_LIBS': '',
+            'EXTRA_STATIC_LIBS': '',
+            'KEEP_LIBS': [],
+        },
+        'windows': {
+            'EXTRA_SHARED_LIBS': '',
+            'EXTRA_STATIC_LIBS': '',
+            'KEEP_LIBS': [],
+        },
+        'mac': {
+            'EXTRA_SHARED_LIBS': '',
+            'EXTRA_STATIC_LIBS': '',
+            'KEEP_LIBS': [],
+        },
+        'ios': {
+            'EXTRA_SHARED_LIBS': '',
+            'EXTRA_STATIC_LIBS': '',
+            'KEEP_LIBS': [],
+        },
+        'android': {
+            'EXTRA_SHARED_LIBS': '',
+            'EXTRA_STATIC_LIBS': '',
+            'KEEP_LIBS': [],
+        },
+    }
+
     with TemporaryDirectory() as tempdir:
         tempdir = Path(tempdir)
         builder = VcpkgBuilder('Crashpad', 'crashpad', tempdir, args.platform_name, static=False)
-        builder.cloneVcpkg('3639676313a3e8b6fe1e94b9e7917b71d32511e3')
+        builder.cloneVcpkg('5c41ff21f6feda702a7d5a1afc765f88d25783c5') # v2024-04-11#7. Crashpad repo at 7e0af1d4d45b526f01677e74a56f4a951b70517d
         builder.bootstrap()
         builder.patch(crashpad_patch)
-        builder.build()
+        builder.build(allow_unsupported=True) # Required for the python package on linux which is in native triplet
 
         builder.copyBuildOutputTo(
             output_dir,
@@ -89,21 +98,12 @@ def main():
             {
                 'dir': output_dir,
                 'settings': {
-                    'PackageName': f'Crashpad-0.8.0-rev1-{args.platform_name}',
+                    'PackageName': f'Crashpad-0.8.0-rev2-{args.platform_name}',
                     'URL': 'https://chromium.googlesource.com/crashpad/crashpad/+/master/README.md',
                     'License': 'Apache-2.0',
                     'LicenseFile': f'{builder.packageName}/share/{builder.portName}/copyright'
                 }
             },
-            {
-                'dir': port_dir / 'getopt',
-                'settings': {
-                    'PackageName': 'getopt',
-                    'URL': 'https://sourceware.org/legacy-ml/newlib/2005/msg00758.html',
-                    'License': 'custom',
-                    'LicenseFile': 'LICENSE'
-                }
-            },
             {
                 'dir': port_dir / 'mini_chromium' / 'base' / 'third_party' / 'icu',
                 'settings': {
@@ -121,18 +121,31 @@ def main():
                     'License': 'BSD-3-Clause',
                     'LicenseFile': 'LICENSE'
                 }
-            },
-            {
-                'dir': port_dir / 'zlib',
-                'settings': {
-                    'PackageName': 'zlib',
-                    'URL': 'https://zlib.net/',
-                    'License': 'Zlib',
-                    'LicenseFile': 'LICENSE'
-                }
             }
         ]
 
+        if args.platform_name == 'windows':
+            package_info_list += [
+                {
+                    'dir': port_dir / 'getopt',
+                    'settings': {
+                        'PackageName': 'getopt',
+                        'URL': 'https://sourceware.org/legacy-ml/newlib/2005/msg00758.html',
+                        'License': 'custom',
+                        'LicenseFile': 'LICENSE'
+                    }
+                },
+                {
+                    'dir': port_dir / 'zlib',
+                    'settings': {
+                        'PackageName': 'zlib',
+                        'URL': 'https://zlib.net/',
+                        'License': 'Zlib',
+                        'LicenseFile': 'LICENSE'
+                    }
+                }
+            ]
+
         for package_info in package_info_list:
             builder.writePackageInfoFile(
                 package_info.get('dir', ''),
@@ -141,14 +154,10 @@ def main():
 
         builder.writeCMakeFindFile(
             output_dir,
-            template=cmake_find_file_template
-        )
-
-        remove_files_by_regex(
-            output_dir,
-            regex_to_remove(args.platform_name)
+            template=cmake_find_file_template,
+            templateEnv=extraLibsPerPlatform[vcpkg_platform],
+            overwrite_find_file=None
         )
 
-
 if __name__ == '__main__':
     main()

+ 2 - 2
package_build_list_host_windows.json

@@ -12,7 +12,7 @@
         "AWSNativeSDK-1.11.361-rev1-android": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AWSNativeSDK --platform-name Android --package-root ../../package-system --clean",
         "AWSNativeSDK-1.11.361-rev1-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AWSNativeSDK --platform-name Windows --package-root ../../package-system --clean",
         "Blast-v1.1.7_rc2-9-geb169fe-rev2-windows": "package-system/Blast/build_package_image.py --platform-name windows",
-        "Crashpad-0.8.0-rev1-windows": "package-system/Crashpad/build_package_image.py",
+        "Crashpad-0.8.0-rev2-windows": "package-system/Crashpad/build_package_image.py --platform-name windows",
         "DirectXShaderCompilerDxc-1.7.2308-o3de-rev2-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/DirectXShaderCompiler --platform-name Windows --package-root ../../package-system --clean",
         "expat-2.4.2-rev2-android": "Scripts/extras/pull_and_build_from_git.py ../../package-system/expat --platform-name Android --package-root ../../package-system/expat/temp --clean",
         "expat-2.4.2-rev2-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/expat --platform-name Windows --package-root ../../package-system/expat/temp --clean",
@@ -76,7 +76,7 @@
     "Blast-v1.1.7_rc2-9-geb169fe-rev1-windows": "package-system/Blast-windows",
     "cityhash-1.1-multiplatform": "package-system/cityhash-multiplatform",
     "civetweb-1.8-rev1-windows": "package-system/civetweb-windows",
-    "Crashpad-0.8.0-rev1-windows": "package-system/Crashpad-windows",
+    "Crashpad-0.8.0-rev2-windows": "package-system/Crashpad-windows",
     "DirectXShaderCompilerDxc-1.7.2308-o3de-rev2-windows": "package-system/DirectXShaderCompilerDxc-windows",
     "d3dx12-headers-rev1-windows": "package-system/d3dx12-windows",
     "expat-2.4.2-rev2-android": "package-system/expat/temp/expat-android",