Commit 3f797636 authored by Nico Weber's avatar Nico Weber Committed by Commit Bot

Set core.trustctime=false during git checkout operations.

This should be faster and more general than running
`git index --refresh` over all git repositories we can find.

See "Proposal: Setting core.trustctime=false on Chromium's bots"
on infra-dev (linked to from bug 330461 comment 45).

Bug: 330461,642711,746763,740301.
Change-Id: I7c35cffa107d46d9cf98f0e3e813ef2ab98df5fc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1809419Reviewed-by: 's avatarAndrii Shyshkalov <tandrii@google.com>
Commit-Queue: Nico Weber <thakis@chromium.org>
parent 6f9a0238
......@@ -846,20 +846,20 @@ def ensure_checkout(solutions, revisions, first_sln, target_os, target_os_only,
for solution_name in list(solution_dirs):
gc_revisions[solution_name] = 'unmanaged'
with git_config_if_not_set('user.name', 'chrome-bot'):
with git_config_if_not_set('user.email', 'chrome-bot@chromium.org'):
# Let gclient do the DEPS syncing.
# The branch-head refspec is a special case because its possible Chrome
# src, which contains the branch-head refspecs, is DEPSed in.
gclient_output = gclient_sync(
BRANCH_HEADS_REFSPEC in refs,
TAGS_REFSPEC in refs,
gc_revisions,
break_repo_locks,
disable_syntax_validation,
patch_refs,
gerrit_reset,
gerrit_rebase_patch_ref)
with git_config_if_not_set('user.name', 'chrome-bot'), \
git_config_if_not_set('user.email', 'chrome-bot@chromium.org'):
# Let gclient do the DEPS syncing.
# The branch-head refspec is a special case because it's possible Chrome
# src, which contains the branch-head refspecs, is DEPSed in.
gclient_output = gclient_sync(
BRANCH_HEADS_REFSPEC in refs,
TAGS_REFSPEC in refs,
gc_revisions,
break_repo_locks,
disable_syntax_validation,
patch_refs,
gerrit_reset,
gerrit_rebase_patch_ref)
# Now that gclient_sync has finished, we should revert any .DEPS.git so that
# presubmit doesn't complain about it being modified.
......@@ -1154,21 +1154,14 @@ def main():
solutions_printer(git_slns)
# Creating hardlinks during a build can interact with git reset in
# unfortunate ways if git's index isn't refreshed beforehand. (See
# crbug.com/330461#c13 for an explanation.)
try:
call_gclient('recurse', '-v', 'git', 'update-index', '--refresh')
except SubprocessFailed:
# Failure here (and nowhere else) may have adverse effects on the
# compile time of the build but shouldn't affect its ability to
# successfully complete.
print 'WARNING: Failed to update git indices.'
try:
# Dun dun dun, the main part of bot_update.
revisions, step_text = prepare(options, git_slns, active)
checkout(options, git_slns, specs, revisions, step_text)
# gn creates hardlinks during the build. By default, this makes
# `git reset` overwrite the sources of the hardlinks, which causes
# unnecessary rebuilds. (See crbug.com/330461#c13 for an explanation.)
with git_config_if_not_set('core.trustctime', 'false'):
revisions, step_text = prepare(options, git_slns, active)
checkout(options, git_slns, specs, revisions, step_text)
except PatchFailed as e:
# Return a specific non-zero exit code for patch failure (because it is
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment