From 3ff79395ee58ca92016c1be8026a35e07201ef6e Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Tue, 15 Sep 2026 16:44:23 +0000 Subject: [PATCH] tools: patch `python3` wrapper from depot_tools Patch the `python3` from depot_tools used to build/test V8 to work with Python from the system on x64 instead of the hermetic Python from Google. Signed-off-by: Richard Lau --- tools/v8/node_common.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tools/v8/node_common.py b/tools/v8/node_common.py index f873065c1dfe..ae40d91f0f99 100755 --- a/tools/v8/node_common.py +++ b/tools/v8/node_common.py @@ -6,6 +6,7 @@ # for py2/py3 compatibility from __future__ import print_function +import fileinput import os import pipes import shutil @@ -40,6 +41,16 @@ def _Get(v8_path): depot_tools = _Get(v8_path) assert depot_tools is not None print("Using depot tools in %s" % depot_tools) + # Patch python3 wrapper to not depend on Google's hermetic Python. + for line in fileinput.input(files=(os.path.join(depot_tools, "python-bin", "python3")),inplace=True): + sys.stdout.write(line) + if "DEPOT_TOOLS=$(dirname \"$0\")/.." in line: + sys.stdout.write(""" +if [[ $VPYTHON_BYPASS == \"manually managed python not supported by chrome operations\" ]] +then + exec python3 \"$@\" +fi +""") return depot_tools def UninitGit(v8_path):