Skip to content

Commit

Permalink
Update Crashpad from Chromium 84.0.4147.135
Browse files Browse the repository at this point in the history
Reviewed-on: #1305
  • Loading branch information
dahlstrom-g authored Nov 29, 2023
2 parents 0e24f1d + f76ac53 commit 84cb637
Show file tree
Hide file tree
Showing 190 changed files with 7,153 additions and 4,371 deletions.
2 changes: 1 addition & 1 deletion third_party/crashpad/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
/third_party/fuchsia/clang
/third_party/fuchsia/qemu
/third_party/fuchsia/sdk
/third_party/gtest/gtest
/third_party/googletest/googletest
/third_party/libfuzzer
/third_party/linux/.cipd
/third_party/linux/clang
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2014 The Crashpad Authors. All rights reserved.
# Copyright 2020 The Crashpad Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -12,8 +12,5 @@
# See the License for the specific language governing permissions and
# limitations under the License.

GERRIT_HOST: True
CODE_REVIEW_SERVER: https://chromium-review.googlesource.com/
VIEW_VC: https://chromium.googlesource.com/crashpad/crashpad/+/
PROJECT: crashpad
BUG_PREFIX: crashpad:
[style]
based_on_style = google
39 changes: 15 additions & 24 deletions third_party/crashpad/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ config("disable_ubsan") {
visibility = [
"snapshot:snapshot",
"minidump:minidump_test",
"third_party/gtest:gtest",
"third_party/googletest:googletest",
"util:util",
]
}
Expand All @@ -37,16 +37,15 @@ if (crashpad_is_in_chromium || crashpad_is_in_fuchsia) {
test("crashpad_tests") {
deps = [
"client:client_test",
"test:gmock_main",
"minidump:minidump_test",
"test:googlemock_main",
"test:test_test",
]
if (!crashpad_is_ios) {
deps += [
"handler:handler_test",
"minidump:minidump_test",
"snapshot:snapshot_test",
"util:util_test",
]
deps += [ "snapshot:snapshot_test" ]
}
if (!crashpad_is_ios && !crashpad_is_fuchsia) {
deps += [ "handler:handler_test" ]
}
if (crashpad_is_in_fuchsia) {
# TODO(fuchsia:46559): Fix the leaks and remove this.
Expand All @@ -63,9 +62,7 @@ if (crashpad_is_in_chromium || crashpad_is_in_fuchsia) {
"util/net/testdata/binary_http_body.dat",
]

outputs = [
"$root_out_dir/crashpad_test_data/{{source}}",
]
outputs = [ "$root_out_dir/crashpad_test_data/{{source}}" ]
}

deps += [ ":crashpad_test_data" ]
Expand Down Expand Up @@ -176,34 +173,31 @@ if (crashpad_is_in_chromium || crashpad_is_in_fuchsia) {
test("crashpad_client_test") {
deps = [
"client:client_test",
"test:gmock_main",
"test:googlemock_main",
]
}

test("crashpad_handler_test") {
deps = [
"handler:handler_test",
"test:gtest_main",
"test:googletest_main",
]
if (crashpad_is_ios) {
if (crashpad_is_ios || crashpad_is_fuchsia) {
deps -= [ "handler:handler_test" ]
}
}

test("crashpad_minidump_test") {
deps = [
"minidump:minidump_test",
"test:gtest_main",
"test:googletest_main",
]
if (crashpad_is_ios) {
deps -= [ "minidump:minidump_test" ]
}
}

test("crashpad_snapshot_test") {
deps = [
"snapshot:snapshot_test",
"test:gtest_main",
"test:googletest_main",
]
if (crashpad_is_ios) {
deps -= [ "snapshot:snapshot_test" ]
Expand All @@ -212,19 +206,16 @@ if (crashpad_is_in_chromium || crashpad_is_in_fuchsia) {

test("crashpad_test_test") {
deps = [
"test:gmock_main",
"test:googlemock_main",
"test:test_test",
]
}

test("crashpad_util_test") {
deps = [
"test:gmock_main",
"test:googlemock_main",
"util:util_test",
]
if (crashpad_is_ios) {
deps -= [ "util:util_test" ]
}
}
}

Expand Down
14 changes: 7 additions & 7 deletions third_party/crashpad/DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ deps = {
'243fc89ae95b24717d41f3786f6a9abeeef87c92',
'condition': 'checkout_ios',
},
'crashpad/third_party/gtest/gtest':
'crashpad/third_party/googletest/googletest':
Var('chromium_git') + '/external/github.com/google/googletest@' +
'eb78ee170ac9eb21487f4d127720c060351fa8a2',
'e589a337170554c48bc658cc857cf15080c9eacc',
'crashpad/third_party/gyp/gyp':
Var('chromium_git') + '/external/gyp@' +
'8bee09f4a57807136593ddc906b0b213c21f9014',
Expand All @@ -42,7 +42,7 @@ deps = {
'7bde79cc274d06451bf65ae82c012a5d3e476b5a',
'crashpad/third_party/mini_chromium/mini_chromium':
Var('chromium_git') + '/chromium/mini_chromium@' +
'c426ff98e1d9e9d59777fe8b883a5c0ceeca9ca3',
'8ca5ea356cdb97913d62d379d503567a80d90726',
'crashpad/third_party/libfuzzer/src':
Var('chromium_git') + '/chromium/llvm-project/compiler-rt/lib/fuzzer.git@' +
'fda403cf93ecb8792cb1d061564d89a6553ca020',
Expand All @@ -61,7 +61,7 @@ deps = {
'condition': 'checkout_linux and pull_linux_clang',
'dep_type': 'cipd'
},
'crashpad/third_party/linux/clang/mac-amd64': {
'crashpad/third_party/fuchsia/clang/mac-amd64': {
'packages': [
{
'package': 'fuchsia/clang/mac-amd64',
Expand Down Expand Up @@ -104,7 +104,7 @@ deps = {
'crashpad/third_party/fuchsia/sdk/mac-amd64': {
'packages': [
{
'package': 'fuchsia/sdk/core/mac-amd64',
'package': 'fuchsia/sdk/gn/mac-amd64',
'version': 'latest'
},
],
Expand All @@ -114,7 +114,7 @@ deps = {
'crashpad/third_party/fuchsia/sdk/linux-amd64': {
'packages': [
{
'package': 'fuchsia/sdk/core/linux-amd64',
'package': 'fuchsia/sdk/gn/linux-amd64',
'version': 'latest'
},
],
Expand Down Expand Up @@ -193,7 +193,7 @@ hooks = [
'condition': 'run_setup_ios_gn and checkout_ios',
'action': [
'python',
'crashpad/build/ios/setup-ios-gn.py'
'crashpad/build/ios/setup_ios_gn.py'
],
},
]
Expand Down
14 changes: 9 additions & 5 deletions third_party/crashpad/METADATA
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@ description:
third_party {
url {
type: GIT
value: "https://chromium.googlesource.com/crashpad/crashpad"
value: "https://chromium.googlesource.com/chromium/src"
# Chromium in turn references https://chromium.googlesource.com/crashpad/crashpad:
# https://chromium.googlesource.com/chromium/src/+/84.0.4147.144/third_party/crashpad/README.chromium#14
}
version: "af62d7fcf61da5a8a6bb9336f0b5ee22547d36a7"
version: "84.0.4147.144"
# Chromium references Crashpad commit c7d1d2a1dd7cf2442cbb8aa8da7348fa01d54182:
# https://chromium.googlesource.com/chromium/src/+/84.0.4147.144/third_party/crashpad/README.chromium#5
last_upgrade_date {
year: 2020
month: 3
day: 26
year: 2023
month: 8
day: 17
}
license_type: NOTICE
}
9 changes: 5 additions & 4 deletions third_party/crashpad/build/crashpad_dependencies.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,20 @@
# by the crashpad_standalone GYP variable. It may have these values:
# standalone
# A “standalone” Crashpad build, where the dependencies are in the
# Crashpad tree. third_party/mini_chromium and third_party/gtest provide
# the base and gtest libraries.
# Crashpad tree. third_party/mini_chromium and third_party/googletest
# provide the base and Google Test libraries.
# external
# A build with external dependencies. mini_chromium provides the base
# library, but it’s located outside of the Crashpad tree, as is gtest.
# library, but it’s located outside of the Crashpad tree, as is Google
# Test.
#
# In order for Crashpad’s .gyp files to reference the correct versions
# depending on how dependencies are being provided, include this .gypi file
# and reference the crashpad_dependencies variable.
#
# Note that Crashpad’s in-Chromium build uses GN instead of GYP, and
# Chromium’s GN build configures Crashpad to use Chromium’s own base library
# and its copy of the gtest library.
# and its copy of the Google Test library.

'variables': {
# When with external dependencies, build/gyp_crashpad.py sets
Expand Down
2 changes: 1 addition & 1 deletion third_party/crashpad/build/crashpad_fuzzer_test.gni
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ template("crashpad_fuzzer_test") {
if (defined(invoker.seed_corpus)) {
not_needed(invoker, [ "seed_corpus" ])
}
} else if (crashpad_is_in_chromium) {
} else if (crashpad_is_in_chromium && use_fuzzing_engine) {
# Append "crashpad_" to the beginning of the fuzzer's name to make it easier
# in Chromium to recognize where fuzzer came from.
forward_variables_from(invoker, "*")
Expand Down
127 changes: 64 additions & 63 deletions third_party/crashpad/build/gyp_crashpad.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,83 +19,84 @@


def ChooseDependencyPath(local_path, external_path):
"""Chooses between a dependency located at local path and an external path.
"""Chooses between a dependency located at local path and an external path.
The local path, used in standalone builds, is preferred. If it is not present
but the external path is, the external path will be used. If neither path is
present, the local path will be used, so that error messages uniformly refer
to the local path.
The local path, used in standalone builds, is preferred. If it is not
present but the external path is, the external path will be used. If neither
path is present, the local path will be used, so that error messages
uniformly refer to the local path.
Args:
local_path: The preferred local path to use for a standalone build.
external_path: The external path to fall back to.
Args:
local_path: The preferred local path to use for a standalone build.
external_path: The external path to fall back to.
Returns:
A 2-tuple. The first element is None or 'external', depending on whether
local_path or external_path was chosen. The second element is the chosen
path.
"""
if os.path.exists(local_path) or not os.path.exists(external_path):
return (None, local_path)
return ('external', external_path)
Returns:
A 2-tuple. The first element is None or 'external', depending on whether
local_path or external_path was chosen. The second element is the chosen
path.
"""
if os.path.exists(local_path) or not os.path.exists(external_path):
return (None, local_path)
return ('external', external_path)


script_dir = os.path.dirname(__file__)
crashpad_dir = (os.path.dirname(script_dir) if script_dir not in ('', os.curdir)
else os.pardir)
crashpad_dir = (os.path.dirname(script_dir)
if script_dir not in ('', os.curdir) else os.pardir)

sys.path.insert(0,
ChooseDependencyPath(os.path.join(crashpad_dir, 'third_party', 'gyp', 'gyp',
'pylib'),
os.path.join(crashpad_dir, os.pardir, os.pardir, 'gyp',
'pylib'))[1])
sys.path.insert(
0,
ChooseDependencyPath(
os.path.join(crashpad_dir, 'third_party', 'gyp', 'gyp', 'pylib'),
os.path.join(crashpad_dir, os.pardir, os.pardir, 'gyp', 'pylib'))[1])

import gyp


def main(args):
if 'GYP_GENERATORS' not in os.environ:
os.environ['GYP_GENERATORS'] = 'ninja'

crashpad_dir_or_dot = crashpad_dir if crashpad_dir is not '' else os.curdir

(dependencies, mini_chromium_common_gypi) = (ChooseDependencyPath(
os.path.join(crashpad_dir, 'third_party', 'mini_chromium',
'mini_chromium', 'build', 'common.gypi'),
os.path.join(crashpad_dir, os.pardir, os.pardir, 'mini_chromium',
'mini_chromium', 'build', 'common.gypi')))
if dependencies is not None:
args.extend(['-D', 'crashpad_dependencies=%s' % dependencies])
args.extend(['--include', mini_chromium_common_gypi])
args.extend(['--depth', crashpad_dir_or_dot])
args.append(os.path.join(crashpad_dir, 'crashpad.gyp'))

result = gyp.main(args)
if result != 0:
return result

if sys.platform == 'win32':
# Check to make sure that no target_arch was specified. target_arch may be
# set during a cross build, such as a cross build for Android.
has_target_arch = False
for arg_index in range(0, len(args)):
arg = args[arg_index]
if (arg.startswith('-Dtarget_arch=') or
(arg == '-D' and arg_index + 1 < len(args) and
args[arg_index + 1].startswith('target_arch='))):
has_target_arch = True
break

if not has_target_arch:
# Also generate the x86 build.
result = gyp.main(args + ['-D', 'target_arch=ia32', '-G', 'config=Debug'])
if result != 0:
if 'GYP_GENERATORS' not in os.environ:
os.environ['GYP_GENERATORS'] = 'ninja'

crashpad_dir_or_dot = crashpad_dir if crashpad_dir is not '' else os.curdir

(dependencies, mini_chromium_common_gypi) = (ChooseDependencyPath(
os.path.join(crashpad_dir, 'third_party', 'mini_chromium',
'mini_chromium', 'build', 'common.gypi'),
os.path.join(crashpad_dir, os.pardir, os.pardir, 'mini_chromium',
'mini_chromium', 'build', 'common.gypi')))
if dependencies is not None:
args.extend(['-D', 'crashpad_dependencies=%s' % dependencies])
args.extend(['--include', mini_chromium_common_gypi])
args.extend(['--depth', crashpad_dir_or_dot])
args.append(os.path.join(crashpad_dir, 'crashpad.gyp'))

result = gyp.main(args)
if result != 0:
return result
result = gyp.main(
args + ['-D', 'target_arch=ia32', '-G', 'config=Release'])

return result
if sys.platform == 'win32':
# Check to make sure that no target_arch was specified. target_arch may
# be set during a cross build, such as a cross build for Android.
has_target_arch = False
for arg_index in range(0, len(args)):
arg = args[arg_index]
if (arg.startswith('-Dtarget_arch=') or
(arg == '-D' and arg_index + 1 < len(args) and
args[arg_index + 1].startswith('target_arch='))):
has_target_arch = True
break

if not has_target_arch:
# Also generate the x86 build.
result = gyp.main(args +
['-D', 'target_arch=ia32', '-G', 'config=Debug'])
if result != 0:
return result
result = gyp.main(
args + ['-D', 'target_arch=ia32', '-G', 'config=Release'])

return result


if __name__ == '__main__':
sys.exit(main(sys.argv[1:]))
sys.exit(main(sys.argv[1:]))
Loading

0 comments on commit 84cb637

Please sign in to comment.