remove use_siso_default.py
use_siso_default.py is no longer needed. autoninja doesn't use it: https://crrev.com/c/6301272 Bug: 397994249 Change-Id: Iff1154492efe5c40e4a03bf5c220dd15e3c7e598 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6298322 Reviewed-by: Dirk Pranke <dpranke@google.com> Reviewed-by: Andrew Grieve <agrieve@chromium.org> Commit-Queue: Fumitoshi Ukai <ukai@google.com> Cr-Commit-Position: refs/heads/main@{#1425547}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
d25c718dde
commit
e535a88132
@ -34,7 +34,6 @@ build_dotfile_settings = {
|
||||
"//build/toolchain/concurrent_links.gni",
|
||||
"//build/toolchain/nacl/BUILD.gn",
|
||||
"//build/toolchain/rbe.gni",
|
||||
"//build/toolchain/siso.gni",
|
||||
"//build/toolchain/toolchain.gni",
|
||||
"//build/toolchain/win/BUILD.gn",
|
||||
"//build/toolchain/win/win_toolchain_data.gni",
|
||||
|
@ -1,16 +1,8 @@
|
||||
# Defines the configuration of siso (next-gen build system)
|
||||
|
||||
use_siso_default = false
|
||||
if (current_toolchain == default_toolchain) {
|
||||
use_siso_default =
|
||||
exec_script(rebase_path("//build/toolchain/use_siso_default.py"),
|
||||
[],
|
||||
"value",
|
||||
[])
|
||||
}
|
||||
|
||||
declare_args() {
|
||||
# Placeholder to allow having use_siso in args.gn file.
|
||||
# Explicit `use_siso` in args.gn can override default.
|
||||
use_siso = use_siso_default
|
||||
# This is used only for autoninja (to dispatch siso or ninja).
|
||||
use_siso = true
|
||||
}
|
||||
|
@ -11,21 +11,14 @@ or used in depot_tools' autoninja or siso wrapper.
|
||||
import os
|
||||
import sys
|
||||
|
||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__)))
|
||||
import use_siso_default
|
||||
|
||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.path.pardir))
|
||||
import gn_helpers
|
||||
|
||||
def use_reclient_value(output_dir):
|
||||
"""Returns use_reclient value."""
|
||||
use_remoteexec = None
|
||||
use_reclient = None
|
||||
use_siso = use_siso_default.use_siso_default(output_dir)
|
||||
args = gn_helpers.ReadArgsGN(output_dir)
|
||||
use_remoteexec = args.get('use_remoteexec', False)
|
||||
use_reclient = args.get('use_reclient')
|
||||
use_siso = args.get('use_siso', use_siso)
|
||||
# If args.gn has use_reclient, use it.
|
||||
if use_reclient is not None:
|
||||
return use_reclient
|
||||
|
@ -1,76 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright 2024 The Chromium Authors
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
"""Script to decide use_siso default value.
|
||||
|
||||
`use_siso_default` is called by siso.gni via exec_script, and
|
||||
`use_siso_default_and_suggest_siso` is called by autoninja in depot_tools.
|
||||
"""
|
||||
# TODO(crbug.com/379584977): move this to depot_tools once `use_siso`
|
||||
# is not used for build graph.
|
||||
|
||||
import os
|
||||
import shutil
|
||||
import sys
|
||||
|
||||
_SISO_SUGGESTION = """Please run 'gn clean {output_dir}' when convenient to upgrade this output directory to Siso (Chromium’s Ninja replacement). If you run into any issues, please file a bug via go/siso-bug and switch back temporarily by setting the GN arg 'use_siso = false'"""
|
||||
|
||||
|
||||
def _is_google_corp_machine():
|
||||
"""This assumes that corp machine has gcert binary in known location."""
|
||||
return shutil.which("gcert") is not None
|
||||
|
||||
|
||||
def _siso_supported(output_dir):
|
||||
"""Returns whether siso is supported for the current scenario."""
|
||||
# If no .sisoenv, use Ninja.
|
||||
if not os.path.exists(
|
||||
os.path.join(os.path.dirname(__file__), "../config/siso/.sisoenv")):
|
||||
return False
|
||||
|
||||
# If it's not chromium project, use Ninja.
|
||||
gclient_args_gni = os.path.join(os.path.dirname(__file__),
|
||||
"../config/gclient_args.gni")
|
||||
if not os.path.exists(gclient_args_gni):
|
||||
return False
|
||||
|
||||
with open(gclient_args_gni) as f:
|
||||
if "build_with_chromium = true" not in f.read():
|
||||
return False
|
||||
|
||||
# Use Siso by default for Googlers working on corp machine.
|
||||
if _is_google_corp_machine():
|
||||
return True
|
||||
|
||||
# Otherwise, use Ninja, until we are ready to roll it out
|
||||
# on non-corp machines, too.
|
||||
# TODO(378078715): enable True by default.
|
||||
return False
|
||||
|
||||
|
||||
def use_siso_default(output_dir, suggest_siso=False):
|
||||
"""Returns use_siso default value."""
|
||||
if not _siso_supported(output_dir):
|
||||
return False
|
||||
|
||||
# This output directory is already using Siso.
|
||||
if os.path.exists(os.path.join(output_dir, ".siso_deps")):
|
||||
return True
|
||||
|
||||
# This output directory is still using Ninja.
|
||||
if os.path.exists(os.path.join(output_dir, ".ninja_deps")):
|
||||
if suggest_siso:
|
||||
print(_SISO_SUGGESTION.format(output_dir=output_dir), file=sys.stderr)
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
def use_siso_default_and_suggest_siso(output_dir):
|
||||
"""Returns use_siso default value and suggests to use siso."""
|
||||
return use_siso_default(output_dir, suggest_siso = True)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
# exec_script runs in output directory.
|
||||
print(str(use_siso_default(".")).lower())
|
Reference in New Issue
Block a user