Skip to content

Commit

Permalink
Revert "Reland #6 of "Force Python 3 to be used in build.""
Browse files Browse the repository at this point in the history
This reverts commit d9caee7.

Reason for revert: I believe this causes failure on Builder win-chrome.

First failure:
https://ci.chromium.org/ui/p/chrome/builders/ci/win-chrome/19774/blamelist

Original change's description:
> Reland #6 of "Force Python 3 to be used in build."
>
> This reverts commit b2446a0
>
> Reason for revert: Trying again w/ build fixes.
>
> The two issues we saw yesterday with reland attempt #5
> were fixed in
>   https://crrev.com/c/2768998 (remoting linux installer)
>   https://crrev.com/c/2768998 (GLES test scripts)
>
> But the change wasn't in the tree for very long, so there may
> well be more. Let's try again to see.
>
> Bug: 1112471
> Cq-Include-Trybots: luci.chromium.try:linux-angle-rel
> Cq-Include-Trybots: luci.chrome.try:linux-chrome
> Change-Id: Ie5483d1f6838deeaf0f9b7cddc0bb57a82960c29
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2769361
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Commit-Queue: Dirk Pranke <dpranke@google.com>
> Cr-Commit-Position: refs/heads/master@{#864372}

Bug: 1112471
Change-Id: I1458c5a5ee5dbb8e1e6cfe367998ff378b29ba53
Cq-Include-Trybots: luci.chromium.try:linux-angle-rel
Cq-Include-Trybots: luci.chrome.try:linux-chrome
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2774784
Auto-Submit: Owen Min <zmin@chromium.org>
Owners-Override: Owen Min <zmin@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Dirk Pranke <dpranke@google.com>
Cr-Commit-Position: refs/heads/master@{#864764}
  • Loading branch information
Owen Min authored and Chromium LUCI CQ committed Mar 19, 2021
1 parent 0558153 commit 8712afb
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
4 changes: 0 additions & 4 deletions .gn
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ import("//third_party/angle/dotfile_settings.gni")
# The location of the build configuration file.
buildconfig = "//build/config/BUILDCONFIG.gn"

# The python interpreter to use by default. On Windows, this will look
# for python3.exe and python3.bat.
script_executable = "python3"

# These arguments override the default values for items in a declare_args
# block. "gn args" in turn can override these.
#
Expand Down
27 changes: 27 additions & 0 deletions tools/mb/mb.py
Original file line number Diff line number Diff line change
Expand Up @@ -1087,6 +1087,33 @@ def RunGNGen(self, vals, compute_inputs_for_analyze=False, check=True):
self.WriteFile(gn_runtime_deps_path, '\n'.join(labels) + '\n')
cmd.append('--runtime-deps-list-file=%s' % gn_runtime_deps_path)

# Detect if we are running in a vpython interpreter, and if so force GN to
# use the real python interpreter. crbug.com/1049421
# This ensures that ninja will only use the real python interpreter and not
# vpython, so that any python scripts in the build will only use python
# modules vendored into //third_party.
# This can be deleted when python 3 becomes the only supported interpreter,
# because in python 3 vpython will no longer have its current 'viral'
# qualities and will require explicit usage to opt in to.
prefix = getattr(sys, "real_prefix", sys.prefix)
python_exe = 'python.exe' if self.platform.startswith('win') else 'python'
# The value of prefix varies. Sometimes it extends to include the bin/
# directory of the python install such that prefix/python is the
# interpreter, and other times prefix/bin/python is the interpreter.
# Therefore we need to check both. Also, it is safer to check prefix/bin
# first because there have been previous installs where prefix/bin/python
# was the real binary and prefix/python was actually vpython-native.
possible_python_locations = [
os.path.join(prefix, 'bin', python_exe),
os.path.join(prefix, python_exe),
]
for p in possible_python_locations:
if os.path.isfile(p):
cmd.append('--script-executable=%s' % p)
break
else:
self.Print('python interpreter not under %s' % prefix)

ret, output, _ = self.Run(cmd)
if ret != 0:
if self.args.json_output:
Expand Down

0 comments on commit 8712afb

Please sign in to comment.