Update Crashpad scripts to python3

Also update mini_chromium to f87a38442a9e for python3 changes.

Change-Id: I4ca7aa4cc9dcc97698fc0bc13cfb339421668074
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3542572
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
This commit is contained in:
Justin Cohen 2022-03-23 20:43:12 -04:00 committed by Crashpad LUCI CQ
parent 25e67e285c
commit f88a116c0e
9 changed files with 15 additions and 24 deletions

1
.gn
View File

@ -13,3 +13,4 @@
# limitations under the License. # limitations under the License.
buildconfig = "//build/BUILDCONFIG.gn" buildconfig = "//build/BUILDCONFIG.gn"
script_executable = "python3"

4
DEPS
View File

@ -39,7 +39,7 @@ deps = {
'e1e7b0ad8ee99a875b272c8e33e308472e897660', 'e1e7b0ad8ee99a875b272c8e33e308472e897660',
'crashpad/third_party/mini_chromium/mini_chromium': 'crashpad/third_party/mini_chromium/mini_chromium':
Var('chromium_git') + '/chromium/mini_chromium@' + Var('chromium_git') + '/chromium/mini_chromium@' +
'6e2f204b4ae135c40a6c4b3c3a01f48a86c5e886', 'f87a38442a9e7ba88d1c4f479e9167927eae84ed',
'crashpad/third_party/libfuzzer/src': 'crashpad/third_party/libfuzzer/src':
Var('chromium_git') + '/chromium/llvm-project/compiler-rt/lib/fuzzer.git@' + Var('chromium_git') + '/chromium/llvm-project/compiler-rt/lib/fuzzer.git@' +
'fda403cf93ecb8792cb1d061564d89a6553ca020', 'fda403cf93ecb8792cb1d061564d89a6553ca020',
@ -169,7 +169,7 @@ hooks = [
'pattern': '.', 'pattern': '.',
'condition': 'run_setup_ios_gn and checkout_ios', 'condition': 'run_setup_ios_gn and checkout_ios',
'action': [ 'action': [
'python', 'python3',
'crashpad/build/ios/setup_ios_gn.py' 'crashpad/build/ios/setup_ios_gn.py'
], ],
}, },

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
# Copyright 2020 The Crashpad Authors. All rights reserved. # Copyright 2020 The Crashpad Authors. All rights reserved.
# #

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
# Copyright 2020 The Crashpad Authors. All rights reserved. # Copyright 2020 The Crashpad Authors. All rights reserved.
# #
@ -23,29 +23,20 @@ import shutil
import subprocess import subprocess
import sys import sys
import tempfile import tempfile
import configparser
try: import io
import configparser
except ImportError:
import ConfigParser as configparser
try:
import StringIO as io
except ImportError:
import io
SUPPORTED_TARGETS = ('iphoneos', 'iphonesimulator') SUPPORTED_TARGETS = ('iphoneos', 'iphonesimulator')
SUPPORTED_CONFIGS = ('Debug', 'Release', 'Profile', 'Official', 'Coverage') SUPPORTED_CONFIGS = ('Debug', 'Release', 'Profile', 'Official', 'Coverage')
class ConfigParserWithStringInterpolation(configparser.SafeConfigParser): class ConfigParserWithStringInterpolation(configparser.ConfigParser):
'''A .ini file parser that supports strings and environment variables.''' '''A .ini file parser that supports strings and environment variables.'''
ENV_VAR_PATTERN = re.compile(r'\$([A-Za-z0-9_]+)') ENV_VAR_PATTERN = re.compile(r'\$([A-Za-z0-9_]+)')
def values(self, section): def values(self, section):
return map(lambda kv: self._UnquoteString(self._ExpandEnvVar(kv[1])), return [self._UnquoteString(self._ExpandEnvVar(kv[1])) for kv in configparser.ConfigParser.items(self, section)]
configparser.ConfigParser.items(self, section))
def getstring(self, section, option): def getstring(self, section, option):
return self._UnquoteString(self._ExpandEnvVar(self.get(section, return self._UnquoteString(self._ExpandEnvVar(self.get(section,
@ -110,7 +101,7 @@ class GnGenerator(object):
args.append(('target_cpu', target_cpu)) args.append(('target_cpu', target_cpu))
args.append( args.append(
('additional_target_cpus', ('additional_target_cpus',
[cpu for cpu in cpu_values.itervalues() if cpu != target_cpu])) [cpu for cpu in cpu_values.values() if cpu != target_cpu]))
else: else:
args.append(('target_cpu', cpu_values[build_arch])) args.append(('target_cpu', cpu_values[build_arch]))

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
# Copyright 2017 The Crashpad Authors. All rights reserved. # Copyright 2017 The Crashpad Authors. All rights reserved.
# #

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
# Copyright 2015 The Crashpad Authors. All rights reserved. # Copyright 2015 The Crashpad Authors. All rights reserved.
# #

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
# Copyright 2019 The Crashpad Authors. All rights reserved. # Copyright 2019 The Crashpad Authors. All rights reserved.
# #

View File

@ -1,5 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
# coding: utf-8
# Copyright 2019 The Crashpad Authors. All rights reserved. # Copyright 2019 The Crashpad Authors. All rights reserved.
# #

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
# Copyright 2019 The Crashpad Authors. All rights reserved. # Copyright 2019 The Crashpad Authors. All rights reserved.
# #