Skip to content

Commit 3ff7939

Browse files
committed
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 <richard.lau@ibm.com>
1 parent 67e66b8 commit 3ff7939

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

tools/v8/node_common.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
# for py2/py3 compatibility
77
from __future__ import print_function
88

9+
import fileinput
910
import os
1011
import pipes
1112
import shutil
@@ -40,6 +41,16 @@ def _Get(v8_path):
4041
depot_tools = _Get(v8_path)
4142
assert depot_tools is not None
4243
print("Using depot tools in %s" % depot_tools)
44+
# Patch python3 wrapper to not depend on Google's hermetic Python.
45+
for line in fileinput.input(files=(os.path.join(depot_tools, "python-bin", "python3")),inplace=True):
46+
sys.stdout.write(line)
47+
if "DEPOT_TOOLS=$(dirname \"$0\")/.." in line:
48+
sys.stdout.write("""
49+
if [[ $VPYTHON_BYPASS == \"manually managed python not supported by chrome operations\" ]]
50+
then
51+
exec python3 \"$@\"
52+
fi
53+
""")
4354
return depot_tools
4455

4556
def UninitGit(v8_path):

0 commit comments

Comments
 (0)