Skip to content

Commit 855b56b

Browse files
authored
Some minor fixes and cleanups (#212)
Changelog: - remove hard-coded variants (not used, templates ones are) - remove duplicated target from `Makefile.compilers` (70f1ebb) - added `ruff` to `pyproject.toml` - some formatting and typos fixing Also, explicitly add `+bootstrap` to compiler concretization (which matches the default): `gcc+bootstrap~profiled`
1 parent dd57df7 commit 855b56b

File tree

4 files changed

+12
-29
lines changed

4 files changed

+12
-29
lines changed

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,7 @@ line-length = 120
88
[tool.isort]
99
profile = "black"
1010
skip = ["external/"]
11+
12+
[tool.ruff]
13+
line-length = 120
14+
extend-exclude = ["external/", "unittests/recipes"]

stackinator/recipe.py

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ def __init__(self, args):
5959
if not self.mount.is_dir():
6060
raise FileNotFoundError(f"the mount point '{self.mount}' must exist")
6161

62-
# required compiler.yaml file
62+
# required compilers.yaml file
6363
compiler_path = self.path / "compilers.yaml"
6464
self._logger.debug(f"opening {compiler_path}")
6565
if not compiler_path.is_file():
66-
raise FileNotFoundError(f"The recipe path '{compiler_path}' does " f"not contain compilers.yaml")
66+
raise FileNotFoundError(f"The recipe path '{compiler_path}' does not contain compilers.yaml")
6767

6868
with compiler_path.open() as fid:
6969
raw = yaml.load(fid, Loader=yaml.Loader)
@@ -74,7 +74,7 @@ def __init__(self, args):
7474
environments_path = self.path / "environments.yaml"
7575
self._logger.debug(f"opening {environments_path}")
7676
if not environments_path.is_file():
77-
raise FileNotFoundError(f"The recipe path '{environments_path}' does " f" not contain environments.yaml")
77+
raise FileNotFoundError(f"The recipe path '{environments_path}' does not contain environments.yaml")
7878

7979
with environments_path.open() as fid:
8080
raw = yaml.load(fid, Loader=yaml.Loader)
@@ -102,7 +102,7 @@ def __init__(self, args):
102102
mirrors_path = self.path / "mirrors.yaml"
103103
if mirrors_path.is_file():
104104
self._logger.warning(
105-
"mirrors.yaml have been removed from recipes," " use the --cache option on stack-config instead."
105+
"mirrors.yaml have been removed from recipes, use the --cache option on stack-config instead."
106106
)
107107
raise RuntimeError("Unsupported mirrors.yaml file in recipe.")
108108

@@ -200,7 +200,7 @@ def config(self):
200200
def config(self, config_path):
201201
self._logger.debug(f"opening {config_path}")
202202
if not config_path.is_file():
203-
raise FileNotFoundError(f"The recipe path '{config_path}' does not contain compilers.yaml")
203+
raise FileNotFoundError(f"The recipe path '{config_path}' does not contain config.yaml")
204204

205205
with config_path.open() as fid:
206206
raw = yaml.load(fid, Loader=yaml.Loader)
@@ -378,7 +378,7 @@ def generate_environment_specs(self, raw):
378378
environments[name]["view"] = None
379379
for i in range(numviews):
380380
# pick a name for the environment
381-
cname = name if i == 0 else name + f"-{i+1}__"
381+
cname = name if i == 0 else name + f"-{i + 1}__"
382382
if i > 0:
383383
environments[cname] = copy.deepcopy(base)
384384

@@ -402,7 +402,7 @@ def generate_environment_specs(self, raw):
402402
self.environments = environments
403403

404404
# creates the self.compilers field that describes the full specifications
405-
# for all of teh compilers from the raw compilers.yaml input
405+
# for all of the compilers from the raw compilers.yaml input
406406
def generate_compiler_specs(self, raw):
407407
compilers = {}
408408

@@ -419,14 +419,6 @@ def generate_compiler_specs(self, raw):
419419
"texinfo",
420420
"gawk",
421421
],
422-
"variants": {
423-
"gcc": "[build_type=Release ~bootstrap +strip]",
424-
"mpc": "[libs=static]",
425-
"gmp": "[libs=static]",
426-
"mpfr": "[libs=static]",
427-
"zstd": "[libs=static]",
428-
"zlib": "[~shared]",
429-
},
430422
}
431423
bootstrap_spec = raw["bootstrap"]["spec"]
432424
bootstrap["specs"] = [
@@ -449,14 +441,6 @@ def generate_compiler_specs(self, raw):
449441
"texinfo",
450442
"gawk",
451443
],
452-
"variants": {
453-
"gcc": "[build_type=Release +profiled +strip]",
454-
"mpc": "[libs=static]",
455-
"gmp": "[libs=static]",
456-
"mpfr": "[libs=static]",
457-
"zstd": "[libs=static]",
458-
"zlib": "[~shared]",
459-
},
460444
}
461445
gcc["specs"] = raw["gcc"]["specs"]
462446
gcc["requires"] = bootstrap_spec

stackinator/templates/Makefile.compilers

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@ all:{% for compiler in compilers %} {{ compiler }}/generated/build_cache{% endfo
2828

2929
{% endfor %}
3030

31-
# Configure the install location.
32-
{% for compiler in compilers %}{{ compiler }}/config.yaml {% endfor %}: | store
33-
$(SPACK) config --scope=user add config:install_tree:root:$(STORE)
34-
3531
# Configure the install location.
3632
{% for compiler in compilers %}{{ compiler }}/config.yaml {% endfor %}: | store
3733
$(SPACK) config --scope=user add config:install_tree:root:$(STORE)
@@ -42,7 +38,6 @@ all:{% for compiler in compilers %} {{ compiler }}/generated/build_cache{% endfo
4238
{{ compiler }}/packages.yaml:
4339
$(SPACK) external find --scope=user {% for package in config.packages.external %} {{package}}{% endfor %}
4440

45-
4641
{% endif %}
4742
{% endfor %}
4843
# Configure dependencies between compilers

stackinator/templates/compilers.gcc.spack.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ spack:
1313
reuse: false
1414
packages:
1515
gcc:
16-
variants: [build_type=Release +strip]
16+
variants: [build_type=Release +bootstrap +strip]
1717
mpc:
1818
variants: [libs=static]
1919
gmp:

0 commit comments

Comments
 (0)