Skip to content

Commit aa7ccc4

Browse files
authored
Remove spack_version logic (#227)
The logic that picks the spack version is no longer needed (at least until we start wrangling post 1.0 updates)
1 parent f8e5d67 commit aa7ccc4

4 files changed

Lines changed: 9 additions & 53 deletions

File tree

stackinator/main.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,7 @@ def make_argparser():
5454
parser.add_argument("-d", "--debug", action="store_true")
5555
parser.add_argument("-m", "--mount", required=False, type=str)
5656
parser.add_argument("-c", "--cache", required=False, type=str)
57-
spack_version_group = parser.add_mutually_exclusive_group()
58-
spack_version_group.add_argument("--develop", action="store_true", required=False)
59-
spack_version_group.add_argument("--spack-version", required=False, type=str)
57+
parser.add_argument("--develop", action="store_true", required=False)
6058

6159
return parser
6260

stackinator/recipe.py

Lines changed: 7 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,9 @@ def __init__(self, args):
143143
self._logger.debug("no pre install hook provided")
144144

145145
# determine the version of spack being used:
146-
# --develop flag implies the next release of spack
147-
# --spack-version option explicitly sets the version
148-
# otherwise the name of the commit provided in the config.yaml file is inspected
149-
self.spack_version = self.find_spack_version(args.develop, args.spack_version)
146+
# currently this just returns 1.0... develop is ignored
147+
# --develop flag will imply the next release of spack after 1.0 is supported properly
148+
self.spack_version = self.find_spack_version(args.develop)
150149

151150
# Returns:
152151
# Path: if the recipe contains a spack package repository
@@ -229,46 +228,10 @@ def config(self, config_path):
229228
schema.config_validator.validate(raw)
230229
self._config = raw
231230

232-
def find_spack_version(self, develop, spack_version):
233-
# determine the "major" version, if it can be inferred.
234-
# one of "0.21", "0.22", "0.23", "0.24" or "unknown".
235-
# "0.24" implies the latest features in develop that will
236-
# are being developed for the next version of spack
237-
238-
# the user has explicitly requested develop:
239-
if develop:
240-
return "0.24"
241-
242-
if spack_version is not None:
243-
return spack_version
244-
245-
# infer from the branch name
246-
# Note: this could be improved by first downloading
247-
# the requested spack version/tag/commit, then checking
248-
# the version returned by `spack --version`
249-
#
250-
# this would require defering this decision until after
251-
# the repo is cloned in build.py... a lot of work.
252-
commit = self.config["spack"]["commit"]
253-
if commit is None or commit == "develop":
254-
return "0.24"
255-
# currently supported
256-
if commit.find("0.24") >= 0:
257-
return "0.24"
258-
# currently supported
259-
if commit.find("0.23") >= 0:
260-
return "0.23"
261-
# currently supported
262-
if commit.find("0.22") >= 0:
263-
return "0.22"
264-
# currently supported
265-
if commit.find("0.21") >= 0:
266-
return "0.21"
267-
# currently supported
268-
if commit.find("0.20") >= 0:
269-
raise ValueError(f"spack minimum version is v0.21 - recipe uses {commit}")
270-
271-
return "unknown"
231+
# In Stackinator 6 we replaced logic required to determine the
232+
# pre 1.0 Spack version.
233+
def find_spack_version(self, develop):
234+
return "1.0"
272235

273236
@property
274237
def environment_view_meta(self):

stackinator/templates/Make.user

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,7 @@ export SPACK_COLOR := always
3737
# config files in ~/.spack. Note that our recommended bwrap setup already puts
3838
# a tmpfs in the home folder, but when bwrap isn't used, this also helps a bit
3939
# with reproducibility.
40-
{% if spack_version>="0.22" %}
41-
# spack after 0.22.1 chokes on /dev/null
4240
export SPACK_USER_CONFIG_PATH := ~
43-
{% else %}
44-
export SPACK_USER_CONFIG_PATH := /dev/null
45-
{% endif %}
4641

4742
# Set up the system config scope that has the system packages we don't want
4843
# build, for example slurm, pmix, etc. Also should have the system compiler.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
env --ignore-environment PATH=/usr/bin:/bin:{{ build_path }}/spack/bin http_proxy=$http_proxy https_proxy=$https_proxy HOME=$HOME BUILD_ROOT={{ build_path }} STORE={{ mount_path }} SPACK_SYSTEM_CONFIG_PATH={{ build_path }}/config SPACK_USER_CACHE_PATH={{ build_path }}/cache SPACK=spack SPACK_COLOR=always SPACK_USER_CONFIG_PATH={% if spack_version>="0.23" %}~{% else %}/dev/null{% endif %} LC_ALL=en_US.UTF-8 TZ=UTC SOURCE_DATE_EPOCH=315576060 {% if use_bwrap %} {{ build_path }}/bwrap-mutable-root.sh --tmpfs ~ --bind {{ build_path }}/tmp /tmp --bind {{ build_path }}/store {{ mount_path }} {% endif %} bash -noprofile -l
1+
env --ignore-environment PATH=/usr/bin:/bin:{{ build_path }}/spack/bin http_proxy=$http_proxy https_proxy=$https_proxy HOME=$HOME BUILD_ROOT={{ build_path }} STORE={{ mount_path }} SPACK_SYSTEM_CONFIG_PATH={{ build_path }}/config SPACK_USER_CACHE_PATH={{ build_path }}/cache SPACK=spack SPACK_COLOR=always SPACK_USER_CONFIG_PATH=~ LC_ALL=en_US.UTF-8 TZ=UTC SOURCE_DATE_EPOCH=315576060 {% if use_bwrap %} {{ build_path }}/bwrap-mutable-root.sh --tmpfs ~ --bind {{ build_path }}/tmp /tmp --bind {{ build_path }}/store {{ mount_path }} {% endif %} bash -noprofile -l

0 commit comments

Comments
 (0)