From c6be56ecedf91cd65eb888cd56c1099181505113 Mon Sep 17 00:00:00 2001 From: Edward Lesmes Date: Wed, 18 Sep 2019 19:48:09 +0000 Subject: [PATCH] Revert "Set core.trustctime=false during git checkout operations." This reverts commit 3f79763629b43de8cb139f857e386be25d0ba058. Reason for revert: Breaks Skia https://skia-review.googlesource.com/c/buildbot/+/242590 Original change's description: > 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/+/1809419 > Reviewed-by: Andrii Shyshkalov > Commit-Queue: Nico Weber TBR=thakis@chromium.org,tandrii@google.com Change-Id: I908ce92748f7b516efed5f2c02138ecfee306c88 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 330461, 642711, 746763, 740301. Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1811537 Reviewed-by: Edward Lesmes Reviewed-by: Nico Weber Auto-Submit: Edward Lesmes Commit-Queue: Nico Weber --- .../bot_update/resources/bot_update.py | 47 +++++++++++-------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/recipes/recipe_modules/bot_update/resources/bot_update.py b/recipes/recipe_modules/bot_update/resources/bot_update.py index 03a2f60b4..44b3abcad 100755 --- a/recipes/recipe_modules/bot_update/resources/bot_update.py +++ b/recipes/recipe_modules/bot_update/resources/bot_update.py @@ -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'), \ - 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) + 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) # Now that gclient_sync has finished, we should revert any .DEPS.git so that # presubmit doesn't complain about it being modified. @@ -1154,14 +1154,21 @@ 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. - # 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) + 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