Files
helium/utils/depot_tools.patch

142 lines
5.5 KiB
C++
Raw Permalink Normal View History

2023-02-22 13:27:11 -06:00
# Changes to gclient that:
2025-03-25 18:37:15 -05:00
# use system python on windows
2023-02-22 13:27:11 -06:00
# move dotfiles into the staging directory
# skip cipd binary downloads
# skip gcs downloads unless its an allowed sysroot
2023-02-22 13:27:11 -06:00
# replace 'src' in checkout paths with the output directory
# add flag to specify an allowed sysroot
2023-02-22 13:27:11 -06:00
# ensure shallow fetches
2025-09-24 15:57:30 -05:00
# allow using newer httplib2 with pysocks
2024-04-30 19:31:13 -05:00
# utilize a newer version of gsutil to support later versions of python
2025-03-25 18:37:15 -05:00
--- a/gclient.bat
+++ b/gclient.bat
@@ -20,4 +20,4 @@ IF %ERRORLEVEL% NEQ 0 (
set PATH=%PATH%;%~dp0
:: Defer control.
-call vpython3 "%~dp0gclient.py" %*
+call python3 "%~dp0gclient.py" %*
2023-02-22 13:27:11 -06:00
--- a/gclient.py
+++ b/gclient.py
2024-06-05 11:57:45 -05:00
@@ -126,8 +126,8 @@ DEPOT_TOOLS_DIR = os.path.dirname(os.pat
2023-02-22 13:27:11 -06:00
# one, e.g. if a spec explicitly says `cache_dir = None`.)
UNSET_CACHE_DIR = object()
-PREVIOUS_CUSTOM_VARS_FILE = '.gclient_previous_custom_vars'
-PREVIOUS_SYNC_COMMITS_FILE = '.gclient_previous_sync_commits'
+PREVIOUS_CUSTOM_VARS_FILE = r'UC_STAGING'+os.sep+'.gclient_previous_custom_vars'
+PREVIOUS_SYNC_COMMITS_FILE = r'UC_STAGING'+os.sep+'.gclient_previous_sync_commits'
2023-02-22 13:27:11 -06:00
PREVIOUS_SYNC_COMMITS = 'GCLIENT_PREVIOUS_SYNC_COMMITS'
2024-06-05 11:57:45 -05:00
@@ -424,6 +424,7 @@ class Dependency(gclient_utils.WorkItem,
2023-09-01 16:44:31 -05:00
protocol='https',
git_dependencies_state=gclient_eval.DEPS,
print_outbuf=False):
+ if name and name[0:3] == "src": name = r"UC_OUT"+name[3:]
2023-09-01 16:44:31 -05:00
gclient_utils.WorkItem.__init__(self, name)
DependencySettings.__init__(self, parent, url, managed, custom_deps,
custom_vars, custom_hooks, deps_file,
2024-07-18 06:31:15 -05:00
@@ -769,6 +770,7 @@ class Dependency(gclient_utils.WorkItem,
2023-02-22 13:27:11 -06:00
2023-09-01 16:44:31 -05:00
condition = dep_value.get('condition')
dep_type = dep_value.get('dep_type')
+ if dep_type == 'cipd': continue
2023-02-22 13:27:11 -06:00
2024-07-18 06:31:15 -05:00
if not self._get_option('process_all_deps', False):
should_process = should_process and _should_process(condition)
2024-08-15 14:47:11 -05:00
@@ -820,6 +822,12 @@ class Dependency(gclient_utils.WorkItem,
should_process_object = should_process and _should_process(
merged_condition)
2024-08-15 14:47:11 -05:00
+ if name != "src/third_party/node/node_modules" and \
+ (not name.startswith("src/build/linux/") or \
+ not f"{self._get_option('sysroot', 'None')}-sysroot" in name):
+ continue
+ should_process_object = True
+ merged_condition = 'True'
gcs_deps.append(
GcsDependency(parent=self,
name=name,
2025-09-24 15:57:30 -05:00
@@ -930,6 +938,8 @@ class Dependency(gclient_utils.WorkItem,
2023-02-22 13:27:11 -06:00
2023-09-01 16:44:31 -05:00
self._gn_args_from = local_scope.get('gclient_gn_args_from')
self._gn_args_file = local_scope.get('gclient_gn_args_file')
+ if self._gn_args_file and self._gn_args_file[0:3] == "src":
+ self._gn_args_file = r"UC_OUT"+self._gn_args_file[3:]
2023-09-01 16:44:31 -05:00
self._gn_args = local_scope.get('gclient_gn_args', [])
# It doesn't make sense to set all of these, since setting gn_args_from
# to another DEPS will make gclient ignore any other local gn_args*
2025-09-24 15:57:30 -05:00
@@ -3987,6 +3997,7 @@ def CMDsync(parser, args):
default=[],
2025-05-21 18:16:56 -05:00
help='Specify to skip processing of a certain type of '
'dep.')
+ parser.add_option('--sysroot')
(options, args) = parser.parse_args(args)
client = GClient.LoadCurrentConfig(options)
2023-02-22 13:27:11 -06:00
--- a/gclient_scm.py
+++ b/gclient_scm.py
2025-05-21 18:16:56 -05:00
@@ -979,8 +979,7 @@ class GitWrapper(SCMWrapper):
2023-09-01 16:44:31 -05:00
self._SetFetchConfig(options)
2023-02-22 13:27:11 -06:00
2023-09-01 16:44:31 -05:00
# Fetch upstream if we don't already have |revision|.
- if not scm.GIT.IsValidRevision(
- self.checkout_path, revision, sha_only=True):
+ if False:
self._Fetch(options, prune=options.force)
2023-02-22 13:27:11 -06:00
2023-09-01 16:44:31 -05:00
if not scm.GIT.IsValidRevision(
2025-05-21 18:16:56 -05:00
@@ -996,7 +995,7 @@ class GitWrapper(SCMWrapper):
2023-02-22 13:27:11 -06:00
2023-09-01 16:44:31 -05:00
# This is a big hammer, debatable if it should even be here...
if options.force or options.reset:
- target = 'HEAD'
+ target = 'FETCH_HEAD'
if options.upstream and upstream_branch:
target = upstream_branch
self._Scrub(target, options)
2025-05-21 18:16:56 -05:00
@@ -1011,7 +1010,6 @@ class GitWrapper(SCMWrapper):
2023-09-01 16:44:31 -05:00
# to the checkout step.
if not (options.force or options.reset):
self._CheckClean(revision)
- self._CheckDetachedHead(revision, options)
2024-06-05 11:57:45 -05:00
if not current_revision:
current_revision = self._Capture(
2025-05-21 18:16:56 -05:00
@@ -1702,8 +1700,7 @@ class GitWrapper(SCMWrapper):
2023-09-01 16:44:31 -05:00
fetch_cmd.append('--no-tags')
elif quiet:
fetch_cmd.append('--quiet')
- if depth:
- fetch_cmd.append('--depth=' + str(depth))
+ fetch_cmd.append('--depth=1')
self._Run(fetch_cmd, options, show_header=options.verbose, retry=True)
2023-02-22 13:27:11 -06:00
2023-09-01 16:44:31 -05:00
def _SetFetchConfig(self, options):
2025-09-24 15:57:30 -05:00
--- a/gerrit_util.py
+++ b/gerrit_util.py
@@ -35,7 +35,10 @@ from typing import NamedTuple, List, Opt
from typing import Tuple, TypedDict, cast
import httplib2
-import httplib2.socks
+try:
+ import httplib2.socks
+except ModuleNotFoundError:
+ import socks
import auth
import gclient_utils
2024-04-30 19:31:13 -05:00
--- a/gsutil.py
+++ b/gsutil.py
2025-09-24 15:57:30 -05:00
@@ -26,7 +26,7 @@ DEFAULT_BIN_DIR = os.path.join(THIS_DIR,
2024-04-30 19:31:13 -05:00
IS_WINDOWS = os.name == 'nt'
-VERSION = '4.68'
+VERSION = 'GSUVER'
2024-04-30 19:31:13 -05:00
# Google OAuth Context required by gsutil.
LUCI_AUTH_SCOPES = [