From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web10.5937.1591827277609052162 for ; Wed, 10 Jun 2020 15:14:37 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.65, mailfrom: erik.c.bjorge@intel.com) IronPort-SDR: 7Ltvx5kkY3eE0GOqI3/B5AaiTcnOzLR4EF97Ukx2vODY9tPzF9TRAIx8X1F+o20MkX0pJb6y1T WKAgckKP1uwA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2020 15:14:37 -0700 IronPort-SDR: e6quNWBL7erZY5qGsb5etEod88EPibQxAfyW60VYIXIkHJWv2CR/k+REf86O1gvT6q1+bigZfT 1vtdQWi6UfXg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,497,1583222400"; d="scan'208";a="289345901" Received: from sfp-ecbjorge.amr.corp.intel.com ([10.165.41.176]) by orsmga002.jf.intel.com with ESMTP; 10 Jun 2020 15:14:37 -0700 From: "Bjorge, Erik C" To: devel@edk2.groups.io Cc: Ashley E Desimone , Nate DeSimone , Puja Pandya , Bret Barkelew , Prince Agyeman Subject: [edk2-staging/EdkRepo] [PATCH v2 3/3] EdkRepo: Fix submodule failures when switching combos. Date: Wed, 10 Jun 2020 15:13:55 -0700 Message-Id: <3b74e29011f804ef0b9f8da81a6535dc7ea71ae0.1591827056.git.erik.c.bjorge@intel.com> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable When switching combinations or checking out pins the submodule information may change or have modifications that will cause errors. Before changing to a new combination all submodules should be removed. Cc: Ashley E Desimone Cc: Nate DeSimone Cc: Puja Pandya Cc: Bret Barkelew Cc: Prince Agyeman Cc: Erik Bjorge Signed-off-by: Erik Bjorge --- edkrepo/commands/checkout_pin_command.py | 5 ++--- edkrepo/common/common_repo_functions.py | 11 ++++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/edkrepo/commands/checkout_pin_command.py b/edkrepo/commands/ch= eckout_pin_command.py index 9d7346a..39c5aeb 100644 --- a/edkrepo/commands/checkout_pin_command.py +++ b/edkrepo/commands/checkout_pin_command.py @@ -22,7 +22,7 @@ from edkrepo.common.workspace_maintenance.manifest_repos_= maintenance import list from edkrepo.common.workspace_maintenance.manifest_repos_maintenance impor= t find_source_manifest_repo=0D from edkrepo.config.config_factory import get_workspace_path, get_workspac= e_manifest=0D from edkrepo_manifest_parser.edk_manifest import ManifestXml=0D -from project_utils.submodule import deinit_submodules, maintain_submodules= =0D +from project_utils.submodule import deinit_full, maintain_submodules=0D =0D =0D class CheckoutPinCommand(EdkrepoCommand):=0D @@ -71,8 +71,7 @@ class CheckoutPinCommand(EdkrepoCommand): print(SPARSE_RESET)=0D reset_sparse_checkout(workspace_path, manifest_sources)=0D submodule_combo =3D pin.general_config.current_combo=0D - deinit_submodules(workspace_path, manifest, manifest.general_confi= g.current_combo,=0D - pin, submodule_combo, args.verbose)=0D + deinit_full(workspace_path, manifest, args.verbose)=0D pin_repo_sources =3D pin.get_repo_sources(pin.general_config.curre= nt_combo)=0D try:=0D checkout_repos(args.verbose, args.override, pin_repo_sources, = workspace_path, manifest)=0D diff --git a/edkrepo/common/common_repo_functions.py b/edkrepo/common/commo= n_repo_functions.py index 8c79f3d..59c198f 100644 --- a/edkrepo/common/common_repo_functions.py +++ b/edkrepo/common/common_repo_functions.py @@ -68,7 +68,7 @@ from edkrepo_manifest_parser.edk_manifest_validation impo= rt validate_manifestrep from edkrepo_manifest_parser.edk_manifest_validation import get_manifest_v= alidation_status=0D from edkrepo_manifest_parser.edk_manifest_validation import print_manifest= _errors=0D from edkrepo_manifest_parser.edk_manifest_validation import validate_manif= estfiles=0D -from project_utils.submodule import deinit_submodules, maintain_submodules= =0D +from project_utils.submodule import deinit_full, maintain_submodules=0D =0D CLEAR_LINE =3D '\x1b[K'=0D DEFAULT_REMOTE_NAME =3D 'origin'=0D @@ -498,10 +498,6 @@ def checkout(combination_or_sha, verbose=3DFalse, over= ride=3DFalse, log=3DNone): log=3Dlog)=0D initial_repo_sources =3D manifest.get_repo_sources(manifest.general_co= nfig.current_combo)=0D =0D - # Deinit any submodules that have been removed.=0D - deinit_submodules(workspace_path, manifest, manifest.general_config.cu= rrent_combo,=0D - manifest, submodule_combo, verbose)=0D -=0D # Disable sparse checkout=0D current_repos =3D initial_repo_sources=0D sparse_enabled =3D sparse_checkout_enabled(workspace_path, initial_rep= o_sources)=0D @@ -524,6 +520,11 @@ def checkout(combination_or_sha, verbose=3DFalse, over= ride=3DFalse, log=3DNone): print(SPARSE_RESET)=0D reset_sparse_checkout(workspace_path, current_repos)=0D =0D + # Deinit all submodules due to the potential for issues when switching= =0D + # branches.=0D + if combo_or_sha !=3D manifest.general_config.current_combo:=0D + deinit_full(workspace_path, manifest, verbose)=0D +=0D print(CHECKING_OUT_COMBO.format(combo_or_sha))=0D =0D try:=0D --=20 2.27.0.windows.1