From cba71d3e55343a3c17ed0c3f08b8064bccaa3f26 Mon Sep 17 00:00:00 2001 From: Ben Wibking Date: Fri, 13 Dec 2024 15:52:14 -0500 Subject: [PATCH 1/4] update submodules when doing git fetch --- repo.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/repo.py b/repo.py index 0b26657..0f6316f 100644 --- a/repo.py +++ b/repo.py @@ -98,6 +98,13 @@ def git_update(self): shutil.copy(f"git.{self.name}.out", self.suite.full_web_dir) + # update submodules to those specified by the current commit + # (--init is required because there may be new submodules since the last checkout) + _, _, rc = test_util.run(f"git submodule update --init") + + if rc != 0: + self.suite.log.fail("ERROR: git submodule update was unsuccessful") + def save_head(self): """Save the current head of the repo""" From 691854b54386ec0195f590d547db558579126890 Mon Sep 17 00:00:00 2001 From: Ben Wibking Date: Mon, 16 Dec 2024 12:17:02 -0500 Subject: [PATCH 2/4] add option to update git submodules --- params.py | 4 ++++ repo.py | 11 ++++++----- suite.py | 4 +++- test_util.py | 3 +++ 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/params.py b/params.py index 73e65d4..ca34192 100644 --- a/params.py +++ b/params.py @@ -163,6 +163,10 @@ def load_params(args): if args.source_pr is not None: mysuite.repos["source"].pr_wanted = args.source_pr + # update Git submodules? + if args.updateGitSubmodules is not None: + mysuite.updateGitSubmodules = args.updateGitSubmodules + # now flesh out the compile strings -- they may refer to either themselves # or the source dir for r in mysuite.repos.keys(): diff --git a/repo.py b/repo.py index 0f6316f..a360814 100644 --- a/repo.py +++ b/repo.py @@ -98,12 +98,13 @@ def git_update(self): shutil.copy(f"git.{self.name}.out", self.suite.full_web_dir) - # update submodules to those specified by the current commit - # (--init is required because there may be new submodules since the last checkout) - _, _, rc = test_util.run(f"git submodule update --init") + if self.suite.updateGitSubmodules == 1: + # update submodules to those specified by the current commit + # (--init is required because there may be new submodules since the last checkout) + _, _, rc = test_util.run(f"git submodule update --init") - if rc != 0: - self.suite.log.fail("ERROR: git submodule update was unsuccessful") + if rc != 0: + self.suite.log.fail("ERROR: git submodule update was unsuccessful") def save_head(self): """Save the current head of the repo""" diff --git a/suite.py b/suite.py index 5a5bd81..bebe5cf 100644 --- a/suite.py +++ b/suite.py @@ -419,7 +419,7 @@ def __init__(self, args): self.useCmake = 0 self.isSuperbuild = 0 self.use_ctools = 1 - + self.reportCoverage = args.with_coverage # set automatically @@ -435,6 +435,8 @@ def __init__(self, args): self.amrex_install_dir = "" # Cmake installation dir self.amrex_cmake_opts = "" + self.updateGitSubmodules = 0 + self.MPIcommand = "" self.MPIhost = "" diff --git a/test_util.py b/test_util.py index d0ba0ab..0da1da8 100644 --- a/test_util.py +++ b/test_util.py @@ -28,6 +28,9 @@ isSuperbuild = < 0: pre-build AMReX and source (default) 1: CMake downloads AMReX and needs separate configure & build > + updateGitSubmodules = < 0: don't update submodules when changing git branches (default) + 1: run `git submodule update --init` after changing git branches > + sourceTree = < C_Src or AMReX > suiteName = < descriptive name (i.e. Castro) > From e09d992401d461e736083acaac9cee144ccc60be Mon Sep 17 00:00:00 2001 From: Ben Wibking Date: Mon, 16 Dec 2024 12:24:21 -0500 Subject: [PATCH 3/4] add log message --- repo.py | 1 + 1 file changed, 1 insertion(+) diff --git a/repo.py b/repo.py index a360814..d5eb18d 100644 --- a/repo.py +++ b/repo.py @@ -101,6 +101,7 @@ def git_update(self): if self.suite.updateGitSubmodules == 1: # update submodules to those specified by the current commit # (--init is required because there may be new submodules since the last checkout) + self.suite.log.log(f"git submodule update in {self.dir}") _, _, rc = test_util.run(f"git submodule update --init") if rc != 0: From b735d418e9b69ccd6f4b80461d2b8265bedcc3e3 Mon Sep 17 00:00:00 2001 From: Ben Wibking Date: Mon, 16 Dec 2024 12:31:59 -0500 Subject: [PATCH 4/4] fix bug --- params.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/params.py b/params.py index ca34192..73e65d4 100644 --- a/params.py +++ b/params.py @@ -163,10 +163,6 @@ def load_params(args): if args.source_pr is not None: mysuite.repos["source"].pr_wanted = args.source_pr - # update Git submodules? - if args.updateGitSubmodules is not None: - mysuite.updateGitSubmodules = args.updateGitSubmodules - # now flesh out the compile strings -- they may refer to either themselves # or the source dir for r in mysuite.repos.keys():