From e40f71cbdea8c922013d76065ddad0a8d22cac25 Mon Sep 17 00:00:00 2001 From: Josip Sokcevic Date: Tue, 29 Aug 2023 17:35:35 +0000 Subject: [PATCH] Use only DEPS git depedencies if SYNC is used If git submodules and DEPS ever go out of sync, there are two different behaviors in gclient: * gclient gitmodules needs to read DEPS file and generate submodules * all other gclient operations prefer content of git submodules. Since we enforce SYNC to always match their content via presubmit checks, it's reasonable to expect they will only diverge on development environment. User is more likely to update DEPS file by hand than to gitlink. If user updates a gitlink accidentally, gclient sync won't checkout to content of DEPS which then will require user to take additional steps to recover. This change uses DEPS to be source of truth for git dependencies if git_dependencies == SYNC. R=aravindvasudev@google.com, jojwang@google.com Bug: 1476108 Change-Id: I5b22095b5c9ec764ea6bf07310a0e5bba4a71aad Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4820459 Commit-Queue: Josip Sokcevic Reviewed-by: Aravind Vasudevan Reviewed-by: Joanna Wang --- gclient.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gclient.py b/gclient.py index 0e2fa2e3c..bf16d090b 100755 --- a/gclient.py +++ b/gclient.py @@ -861,8 +861,8 @@ class Dependency(gclient_utils.WorkItem, DependencySettings): deps = local_scope.get('deps', {}) # If dependencies are configured within git submodules, add them to deps. - if self.git_dependencies_state in (gclient_eval.SUBMODULES, - gclient_eval.SYNC): + # We don't add for SYNC since we expect submodules to be in sync. + if self.git_dependencies_state == gclient_eval.SUBMODULES: deps.update(self.ParseGitSubmodules()) deps_to_add = self._deps_to_objects(