Skip to content

Commit 5df6439

Browse files
committed
Added functions to allow tpl-manager to build TPLs from build cache
1 parent 81cc35a commit 5df6439

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

scripts/devtools/tpl-manager.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ def parse_args(self):
6868
parser.add_argument("--id", type=str, default=None,
6969
help="ID string to postfix an initconfig file.")
7070
parser.add_argument("--dev-pkg", action="store_true",
71-
help="Tells tpl-manager to use the dev_pkg environment.")
71+
help="Tells tpl-manager to use the dev_pkg environment. "+\
72+
"Assumes TPLs are for buildcache creation if no --spec is provided. "+\
73+
"Assumes building from a buildcache if --spec is provided.")
7274

7375
self.args = parser.parse_args()
7476

@@ -286,7 +288,11 @@ def install_and_config(self):
286288
if (not self.args.dry_run):
287289
install_cmd = SpackCommand("install")
288290
print(f"Running spack -u initconfig {spec}")
289-
install_cmd("-u", "initconfig", spec)
291+
install_args = ["-u", "initconfig"]
292+
if (self.args.dev_pkg):
293+
# Spec is provided so assumes we are building from a buildcache
294+
install_args.extend(["--cache-only", "--no-check-signature"])
295+
install_cmd(*install_args, spec)
290296
print(f"Created {host_config_file}")
291297

292298
if (self.args.ci_run):

scripts/lc/generate-buildcache.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ cp -a $SPHERAL_PIP_CACHE_DIR/. $RESOURCE_DIR/pip_cache
6565
# tpl-manager --dev-pkg does the following:
6666
# Creates a local Spack repo
6767
# Activates and concretizes the dev_pkg Spheral Spack environment
68-
# Installs the Spheral dependencies
68+
# Installs the Spheral dependencies for all specs
6969
./$SCRIPT_DIR/devtools/tpl-manager.py --dev-pkg
7070

7171
# Source Spack for the current terminal

scripts/lc/install-from-dev-pkg.sh

-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ spack mirror add --unsigned spheral-mirror $PWD/resources/mirror
3939
spack mirror add --unsigned spheral-cache $PWD/resources
4040
spack buildcache update-index $PWD/resources/mirror
4141

42-
$BUILD_ALLOC spack install --fresh --deprecated --no-check-signature --only dependencies $DEV_PKG_SPEC
43-
4442
$BUILD_ALLOC ./$SCRIPT_DIR/devtools/tpl-manager.py --no-upstream --spack-dir $INSTALL_DIR/spheral-spack-tpls --spec $DEV_PKG_SPEC --skip-init --dev-pkg
4543

4644
HOST_CONFIG_FILE=$(ls -t | grep -E "*\.cmake" | head -1)

0 commit comments

Comments
 (0)