From 33db2f46abd1419e4f5ef0522ed4e002219eb245 Mon Sep 17 00:00:00 2001 From: Chris Green Date: Thu, 12 Dec 2024 17:10:58 -0600 Subject: [PATCH] Optionally ask `make_spack` for no extra recipe repos --- bin/build-spack-env.sh | 9 +++++++++ bin/make_spack | 31 ++++++++++++++++++------------- 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/bin/build-spack-env.sh b/bin/build-spack-env.sh index a50eb1b..7f91566 100755 --- a/bin/build-spack-env.sh +++ b/bin/build-spack-env.sh @@ -78,6 +78,7 @@ BRIEF OPTIONS --debug-tmp --fermi-spack-tools-root[= ] --fermi-spack-tools-version[= ] + --no-auto-recipe-repos --(no-)?emergency-buildcache --(no-)?fail-fast --(no-)?query-packages @@ -195,6 +196,11 @@ SPACK CONFIGURATION OPTIONS Other Spack Configuration + --no-auto-recipe-repos + + Do not define a default set of recipe repositories to obtain and + configure (handled by `make_spack`). + --(no-)?emergency-buildcache Control whether to dump successfully installed binaries to an @@ -1217,6 +1223,7 @@ concretizing_cache_specs=() extra_binaries_write_cache=() extra_sources_write_cache=() fail_fast=1 +no_auto_recipe_repos= recipe_repos=() si_root=https://github.com/FNALssi/fermi-spack-tools.git si_ver=main @@ -1249,6 +1256,7 @@ while (( $# )); do --emergency-buildcache) want_emergency_buildcache=1;; --fail-fast) fail_fast=1;; --help|-h|-\?) usage 2; exit 1;; + --no-auto-recipe-repos) no_auto_recipe_repos=1;; --no-cache-write-binaries) _set_cache_write_binaries "none";; --no-cache-write-sources) unset cache_write_sources;; --no-emergency-buildcache) unset want_emergency_buildcache;; @@ -1423,6 +1431,7 @@ make_spack_cmd=( ${spack_root:+--spack_repo "$spack_root"} --spack_release $spack_ver --minimal + ${no_auto_recipe_repos:+"--no-recipe-repos"} ${upgrade_etc:+"--upgrade-etc"} ${upgrade_extensions:+"--upgrade-extensions"} ${upgrade_recipes:+"--upgrade-recipes"} diff --git a/bin/make_spack b/bin/make_spack index 723b79d..7de27bc 100755 --- a/bin/make_spack +++ b/bin/make_spack @@ -14,19 +14,22 @@ find_ourselves() { clone_repos() { while read ddir branch repo do - if [ -e "$ddir/.git" ]; then - if [ "$repo" = "$spack_repo" ] ; then - repo_type=spack - elif [[ "${ddir#$dir/}" == etc/* ]]; then - repo_type=etc - elif [[ "${ddir#$dir/var/spack/}" == extensions/* ]]; then - repo_type=extensions - elif [[ "${ddir#$dir/var/spack/}" == repos/* ]] || - [ -f "$ddir/repo.yaml" ]; then - repo_type=recipes - else - unset repo_type + if [ "$repo" = "$spack_repo" ] ; then + repo_type=spack + elif [[ "${ddir#$dir/}" == etc/* ]]; then + repo_type=etc + elif [[ "${ddir#$dir/var/spack/}" == extensions/* ]]; then + repo_type=extensions + elif [[ "${ddir#$dir/var/spack/}" == repos/* ]] || + [ -f "$ddir/repo.yaml" ]; then + if $no_recipes; then + continue fi + repo_type=recipes + else + unset repo_type + fi + if [ -e "$ddir/.git" ]; then if [ -n "$repo_type" ]; then eval "upgrade_repo=\$upgrade_$repo_type" else @@ -165,9 +168,10 @@ parse_args() { repovers="" verbose=false depth=1 + no_recipes=false origargs="$*" - if x=$(getopt --longoptions help,depth,with_padding,upgrade,upgrade-etc,upgrade-extensions,upgrade-recipes,upgrade-spack,spack_release:,minimal,no_buildcache,repover,spack_repo:,query-packages,verbose --options mptuv -- "$@") + if x=$(getopt --longoptions help,depth,with_padding,upgrade,upgrade-etc,upgrade-extensions,upgrade-recipes,upgrade-spack,spack_release:,minimal,no-recipe-repos,no_buildcache,repover,spack_repo:,query-packages,verbose --options mptuv -- "$@") then eval set : $x shift @@ -188,6 +192,7 @@ parse_args() { x--query-packages) query_packages=true; shift ;; x--help) usage; exit;; x--no_buildcache) use_buildcache=false; shift;; + x--no-recipe-repos) no_recipes=true; shift;; x--repover) repovers="$repovers $2"; shift; shift;; x-v|x--verbose) verbose=true; shift;; x-u) echo "Deprecated option -u ignored"; shift;;