Skip to content

Commit ce8851b

Browse files
AlexOvsienkoChromium LUCI CQ
authored andcommitted
DEPS: use DEPS provided python instead of a system one.
Bug: 537680330 Change-Id: I4dd0ba0ce0682f6680331ed20a2599c36a6a6964 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8160801 Reviewed-by: Takuto Ikuta <[email protected]> Commit-Queue: Alex Ovsienko <[email protected]> Cr-Commit-Position: refs/heads/main@{#1679347}
1 parent 382f4bf commit ce8851b

20 files changed

Lines changed: 154 additions & 68 deletions

‎.gn‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ import("//third_party/angle/dotfile_settings.gni")
88
# The location of the build configuration file.
99
buildconfig = "//build/config/BUILDCONFIG.gn"
1010

11-
# The python interpreter to use by default. On Windows, this will look
12-
# for python3.exe and python3.bat.
13-
script_executable = "python3"
11+
# The hermetic Python interpreter to use by default.
12+
script_executable = "//third_party/cpython3/host/bin/python3"
1413

1514
# These arguments override the default values for items in a declare_args
1615
# block. "gn args" in turn can override these.

‎build/config/siso/android.star‎

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ load("@builtin//path.star", "path")
1010
load("@builtin//struct.star", "module")
1111
load("./config.star", "config")
1212
load("./gn_logs.star", "gn_logs")
13+
load("./platform.star", "platform")
1314

1415
# TODO: crbug.com/323091468 - Propagate target android ABI and
1516
# android SDK version from GN, and remove the hardcoded filegroups.
@@ -60,20 +61,22 @@ def __step_config(ctx, step_config):
6061
# See also https://chromium.googlesource.com/chromium/src/build/+/HEAD/android/docs/java_toolchain.md
6162
{
6263
"name": "android/write_build_config",
63-
"command_prefix": "python3 ../../build/android/gyp/write_build_config.py",
64+
"command_prefix": platform.python_bin + " ../../build/android/gyp/write_build_config.py",
6465
"handler": "android_write_build_config",
6566
"remote": remote_run,
6667
"timeout": "2m",
68+
"remote_command": platform.remote_python_bin,
6769
},
6870
{
6971
"name": "android/ijar",
70-
"command_prefix": "python3 ../../build/android/gyp/ijar.py",
72+
"command_prefix": platform.python_bin + " ../../build/android/gyp/ijar.py",
7173
"remote": remote_run,
7274
"timeout": "2m",
75+
"remote_command": platform.remote_python_bin,
7376
},
7477
{
7578
"name": "android/turbine",
76-
"command_prefix": "python3 ../../build/android/gyp/turbine.py",
79+
"command_prefix": platform.python_bin + " ../../build/android/gyp/turbine.py",
7780
"handler": "android_turbine",
7881
# TODO: crbug.com/396220357 - fix gn to remove unnecessary deps
7982
"exclude_input_patterns": [
@@ -97,10 +100,11 @@ def __step_config(ctx, step_config):
97100
"remote": remote_run and not config.get(ctx, "no-remote-javac"),
98101
"platform_ref": "large",
99102
"timeout": "2m",
103+
"remote_command": platform.remote_python_bin,
100104
},
101105
{
102106
"name": "android/compile_resources",
103-
"command_prefix": "python3 ../../build/android/gyp/compile_resources.py",
107+
"command_prefix": platform.python_bin + " ../../build/android/gyp/compile_resources.py",
104108
"handler": "android_compile_resources",
105109
"exclude_input_patterns": [
106110
"*.a",
@@ -114,10 +118,11 @@ def __step_config(ctx, step_config):
114118
],
115119
"remote": remote_run,
116120
"timeout": "5m",
121+
"remote_command": platform.remote_python_bin,
117122
},
118123
{
119124
"name": "android/compile_java",
120-
"command_prefix": "python3 ../../build/android/gyp/compile_java.py",
125+
"command_prefix": platform.python_bin + " ../../build/android/gyp/compile_java.py",
121126
"handler": "android_compile_java",
122127
"exclude_input_patterns": [
123128
"*.a",
@@ -137,10 +142,11 @@ def __step_config(ctx, step_config):
137142
"remote": remote_run and not config.get(ctx, "no-remote-javac"),
138143
"platform_ref": "large",
139144
"timeout": "2m",
145+
"remote_command": platform.remote_python_bin,
140146
},
141147
{
142148
"name": "android/errorprone",
143-
"command_prefix": "python3 ../../build/android/gyp/errorprone.py",
149+
"command_prefix": platform.python_bin + " ../../build/android/gyp/errorprone.py",
144150
"handler": "android_compile_java",
145151
"exclude_input_patterns": [
146152
"*.a",
@@ -157,10 +163,11 @@ def __step_config(ctx, step_config):
157163
# obj/chrome/android/chrome_java__errorprone.stamp step takes too
158164
# long.
159165
"timeout": "6m",
166+
"remote_command": platform.remote_python_bin,
160167
},
161168
{
162169
"name": "android/compile_kt",
163-
"command_prefix": "python3 ../../build/android/gyp/compile_kt.py",
170+
"command_prefix": platform.python_bin + " ../../build/android/gyp/compile_kt.py",
164171
"handler": "android_compile_java",
165172
"exclude_input_patterns": [
166173
"*.a",
@@ -180,10 +187,11 @@ def __step_config(ctx, step_config):
180187
"remote": remote_run,
181188
"platform_ref": "large",
182189
"timeout": "2m",
190+
"remote_command": platform.remote_python_bin,
183191
},
184192
{
185193
"name": "android/dex",
186-
"command_prefix": "python3 ../../build/android/gyp/dex.py",
194+
"command_prefix": platform.python_bin + " ../../build/android/gyp/dex.py",
187195
"handler": "android_dex",
188196
"exclude_input_patterns": [
189197
"*.a",
@@ -202,16 +210,18 @@ def __step_config(ctx, step_config):
202210
"remote": remote_run,
203211
"platform_ref": "large",
204212
"timeout": "2m",
213+
"remote_command": platform.remote_python_bin,
205214
},
206215
{
207216
"name": "android/filter_zip",
208-
"command_prefix": "python3 ../../build/android/gyp/filter_zip.py",
217+
"command_prefix": platform.python_bin + " ../../build/android/gyp/filter_zip.py",
209218
"remote": remote_run,
210219
"timeout": "2m",
220+
"remote_command": platform.remote_python_bin,
211221
},
212222
{
213223
"name": "android/generate_resource_allowlist",
214-
"command_prefix": "python3 ../../tools/resources/generate_resource_allowlist.py",
224+
"command_prefix": platform.python_bin + " ../../tools/resources/generate_resource_allowlist.py",
215225
"indirect_inputs": {
216226
"includes": ["*.o", "*.a"],
217227
},
@@ -221,15 +231,16 @@ def __step_config(ctx, step_config):
221231
},
222232
{
223233
"name": "android/trace_event_bytecode_rewriter",
224-
"command_prefix": "python3 ../../build/android/gyp/trace_event_bytecode_rewriter.py",
234+
"command_prefix": platform.python_bin + " ../../build/android/gyp/trace_event_bytecode_rewriter.py",
225235
"handler": "android_trace_event_bytecode_rewriter",
226236
"remote": remote_run,
227237
"platform_ref": "large",
228238
"timeout": "10m",
239+
"remote_command": platform.remote_python_bin,
229240
},
230241
{
231242
"name": "android/proguard/local",
232-
"command_prefix": "python3 ../../build/android/gyp/proguard.py",
243+
"command_prefix": platform.python_bin + " ../../build/android/gyp/proguard.py",
233244
"action_outs": [
234245
# http://crbug.com/396004680#comment15: It slows down CQ build.
235246
# It's better to run it locally.
@@ -239,7 +250,7 @@ def __step_config(ctx, step_config):
239250
},
240251
{
241252
"name": "android/proguard",
242-
"command_prefix": "python3 ../../build/android/gyp/proguard.py",
253+
"command_prefix": platform.python_bin + " ../../build/android/gyp/proguard.py",
243254
"handler": "android_proguard",
244255
"exclude_input_patterns": [
245256
"*.a",
@@ -254,10 +265,11 @@ def __step_config(ctx, step_config):
254265
"remote": remote_run,
255266
"platform_ref": "large",
256267
"timeout": "10m",
268+
"remote_command": platform.remote_python_bin,
257269
},
258270
{
259271
"name": "android/trace_references",
260-
"command_prefix": "python3 ../../build/android/gyp/tracereferences.py",
272+
"command_prefix": platform.python_bin + " ../../build/android/gyp/tracereferences.py",
261273
"handler": "android_trace_references",
262274
"exclude_input_patterns": [
263275
"*.a",
@@ -272,10 +284,11 @@ def __step_config(ctx, step_config):
272284
"remote": remote_run_static_analysis,
273285
"platform_ref": "large",
274286
"timeout": "10m",
287+
"remote_command": platform.remote_python_bin,
275288
},
276289
{
277290
"name": "android/apkbuilder",
278-
"command_prefix": "python3 ../../build/android/gyp/apkbuilder.py",
291+
"command_prefix": platform.python_bin + " ../../build/android/gyp/apkbuilder.py",
279292
"handler": "android_apkbuilder",
280293
"remote": config.get(ctx, "remote-link") or config.get(ctx, "default-remote") or config.get(ctx, "builder"),
281294
"platform_ref": "large",
@@ -285,10 +298,11 @@ def __step_config(ctx, step_config):
285298
"*.proto",
286299
"*.o",
287300
],
301+
"remote_command": platform.remote_python_bin,
288302
},
289303
{
290304
"name": "android/create_size_info_files",
291-
"command_prefix": "python3 ../../build/android/gyp/create_size_info_files.py",
305+
"command_prefix": platform.python_bin + " ../../build/android/gyp/create_size_info_files.py",
292306
"handler": "android_create_size_info_files",
293307
"remote": remote_run,
294308
"platform_ref": "large",
@@ -300,6 +314,7 @@ def __step_config(ctx, step_config):
300314
"*.inc",
301315
"*.cpp",
302316
],
317+
"remote_command": platform.remote_python_bin,
303318
},
304319
])
305320
return step_config

‎build/config/siso/blink_all.star‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def __step_config(ctx, step_config):
3030
"remote": remote_run,
3131
"timeout": "2m",
3232
"platform_ref": "large",
33-
"remote_command": "python3", # only run on Linux worker even for CI Windows.
33+
"remote_command": platform.remote_python_bin, # only run on Linux worker even for CI Windows.
3434
},
3535
])
3636

@@ -47,12 +47,14 @@ def __step_config(ctx, step_config):
4747
# needs to read the generated .mojom files. But, the inputs are
4848
# not specified in the build graph correctly.
4949
"output_local": True,
50+
"remote_command": platform.remote_python_bin,
5051
},
5152
{
5253
"name": "blink/build_web_idl_database",
5354
"command_prefix": platform.python_bin + " ../../third_party/blink/renderer/bindings/scripts/build_web_idl_database.py",
5455
"remote": remote_run,
5556
"timeout": "2m",
57+
"remote_command": platform.remote_python_bin,
5658
},
5759
])
5860
return step_config

‎build/config/siso/clang_unix.star‎

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ load("./android.star", "android")
1111
load("./clang_all.star", "clang_all")
1212
load("./config.star", "config")
1313
load("./gn_logs.star", "gn_logs")
14+
load("./platform.star", "platform")
1415
load("./win_sdk.star", "win_sdk")
1516

1617
def __clang_link(ctx, cmd):
@@ -294,7 +295,7 @@ def __rules(ctx):
294295
{
295296
"name": "clang-coverage/cxx",
296297
"action": "(.*_)?cxx",
297-
"command_prefix": "\"python3\" ../../build/toolchain/clang_code_coverage_wrapper.py",
298+
"command_prefix": platform.python_bin + " ../../build/toolchain/clang_code_coverage_wrapper.py",
298299
"inputs": [
299300
"third_party/llvm-build/Release+Asserts/bin/clang++",
300301
],
@@ -307,7 +308,7 @@ def __rules(ctx):
307308
{
308309
"name": "clang-coverage/cc",
309310
"action": "(.*_)?cc",
310-
"command_prefix": "\"python3\" ../../build/toolchain/clang_code_coverage_wrapper.py",
311+
"command_prefix": platform.python_bin + " ../../build/toolchain/clang_code_coverage_wrapper.py",
311312
"inputs": [
312313
"third_party/llvm-build/Release+Asserts/bin/clang",
313314
],
@@ -320,7 +321,7 @@ def __rules(ctx):
320321
{
321322
"name": "clang-coverage/objcxx",
322323
"action": "(.*_)?objcxx",
323-
"command_prefix": "\"python3\" ../../build/toolchain/clang_code_coverage_wrapper.py",
324+
"command_prefix": platform.python_bin + " ../../build/toolchain/clang_code_coverage_wrapper.py",
324325
"inputs": [
325326
"third_party/llvm-build/Release+Asserts/bin/clang++",
326327
],
@@ -333,7 +334,7 @@ def __rules(ctx):
333334
{
334335
"name": "clang-coverage/objc",
335336
"action": "(.*_)?objc",
336-
"command_prefix": "\"python3\" ../../build/toolchain/clang_code_coverage_wrapper.py",
337+
"command_prefix": platform.python_bin + " ../../build/toolchain/clang_code_coverage_wrapper.py",
337338
"inputs": [
338339
"third_party/llvm-build/Release+Asserts/bin/clang",
339340
],
@@ -364,6 +365,9 @@ def __rules(ctx):
364365
"name": "clang/solink",
365366
"action": "(.*_)?solink",
366367
"handler": "clang_link",
368+
"inputs": [
369+
"third_party/cpython3/linux-amd64:cpython3",
370+
],
367371
"exclude_input_patterns": [
368372
"*.cc",
369373
"*.h",
@@ -372,6 +376,7 @@ def __rules(ctx):
372376
"*.stamp",
373377
],
374378
"remote": remote_link,
379+
"remote_command": platform.remote_python_bin,
375380
"restat_content": True,
376381
"platform_ref": "large",
377382
"timeout": remote_link_timeout,
@@ -395,6 +400,9 @@ def __rules(ctx):
395400
"name": "clang/link",
396401
"action": "(.*_)?link",
397402
"handler": "clang_link",
403+
"inputs": [
404+
"third_party/cpython3/linux-amd64:cpython3",
405+
],
398406
"exclude_input_patterns": [
399407
"*.cc",
400408
"*.h",
@@ -404,6 +412,7 @@ def __rules(ctx):
404412
"*.stamp",
405413
],
406414
"remote": remote_link,
415+
"remote_command": platform.remote_python_bin,
407416
"platform_ref": "large",
408417
"timeout": remote_link_timeout,
409418
},

‎build/config/siso/clang_windows.star‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ load("./clang_all.star", "clang_all")
99
load("./clang_exception.star", "clang_exception")
1010
load("./config.star", "config")
1111
load("./gn_logs.star", "gn_logs")
12+
load("./platform.star", "platform")
1213
load("./reclient.star", "reclient")
1314
load("./rewrapper_cfg.star", "rewrapper_cfg")
1415
load("./win_sdk.star", "win_sdk")
@@ -137,7 +138,7 @@ def __step_config(ctx, step_config):
137138
{
138139
"name": "clang-coverage/cxx",
139140
"action": "(.*_)?cxx",
140-
"command_prefix": "python3.exe ../../build/toolchain/clang_code_coverage_wrapper.py",
141+
"command_prefix": platform.python_bin + " ../../build/toolchain/clang_code_coverage_wrapper.py",
141142
"inputs": rewrapper_config_inputs + [
142143
"third_party/llvm-build/Release+Asserts/bin/clang++",
143144
],
@@ -151,7 +152,7 @@ def __step_config(ctx, step_config):
151152
{
152153
"name": "clang-coverage/cxx_module",
153154
"action": "(.*_)?cxx_module",
154-
"command_prefix": "python3.exe ../../build/toolchain/clang_code_coverage_wrapper.py",
155+
"command_prefix": platform.python_bin + " ../../build/toolchain/clang_code_coverage_wrapper.py",
155156
"inputs": rewrapper_config_inputs + [
156157
"third_party/llvm-build/Release+Asserts/bin/clang++",
157158
],
@@ -167,7 +168,7 @@ def __step_config(ctx, step_config):
167168
{
168169
"name": "clang-coverage/cc",
169170
"action": "(.*_)?cc",
170-
"command_prefix": "python3.exe ../../build/toolchain/clang_code_coverage_wrapper.py",
171+
"command_prefix": platform.python_bin + " ../../build/toolchain/clang_code_coverage_wrapper.py",
171172
"inputs": rewrapper_config_inputs + [
172173
"third_party/llvm-build/Release+Asserts/bin/clang",
173174
],

‎build/config/siso/devtools_frontend.star‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,25 +41,28 @@ def __step_config(ctx, step_config):
4141
step_config["rules"].extend([
4242
{
4343
"name": "devtools-frontend/typescript/ts_library",
44-
"command_prefix": "python3 ../../third_party/devtools-frontend/src/scripts/build/typescript/ts_library.py",
44+
"command_prefix": platform.python_bin + " ../../third_party/devtools-frontend/src/scripts/build/typescript/ts_library.py",
4545
"remote": config.get(ctx, "default-remote"),
4646
"output_local": True,
4747
"timeout": "2m",
4848
"platform_ref": "large",
49+
"remote_command": platform.remote_python_bin,
4950
},
5051
{
5152
"name": "devtools-frontend/esbuild",
5253
"command_prefix": platform.python_bin + " ../../third_party/node/node.py ../../third_party/devtools-frontend/src/scripts/build/esbuild.js",
5354
"remote": config.get(ctx, "default-remote"),
5455
"timeout": "2m",
5556
"platform_ref": "large",
57+
"remote_command": platform.remote_python_bin,
5658
},
5759
{
5860
"name": "devtools-frontend/build/generate_css_js_files",
59-
"command_prefix": "python3 ../../third_party/node/node.py ../../third_party/devtools-frontend/src/scripts/build/generate_css_js_files.js",
61+
"command_prefix": platform.python_bin + " ../../third_party/node/node.py ../../third_party/devtools-frontend/src/scripts/build/generate_css_js_files.js",
6062
"remote": config.get(ctx, "default-remote"),
6163
"output_local": True,
6264
"timeout": "2m",
65+
"remote_command": platform.remote_python_bin,
6366
},
6467
])
6568
return step_config

0 commit comments

Comments
 (0)