Skip to content

Commit 5cfbae8

Browse files
authored
minor: improve error management for missing system gcc compiler in system configuration (#260)
In the cluster configuration the file `packages.yaml` is optional https://github.com/eth-cscs/stackinator/blob/5581430ce63f5ecfd5dae8e59b578e145b7767cf/stackinator/recipe.py#L91-L98 but at the same time there is an implicit requirement since if there is no `gcc` specified in `packages.yaml`, we should raise an exception. https://github.com/eth-cscs/stackinator/blob/5581430ce63f5ecfd5dae8e59b578e145b7767cf/stackinator/recipe.py#L100-L106 With this small PR, the `RuntimeError` with a nicer and a bit more informative error message will be raised also in case no `packages.yaml` or it is available but no `gcc` is specified. note: I faced this many times when by mistake I ended up passing the wrong path for the cluster configuration, and the path didn't contain the "usual" yaml files.
1 parent 8ed7912 commit 5cfbae8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

stackinator/recipe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def __init__(self, args):
9999

100100
# extract gcc packages from system packages
101101
# remove gcc from packages afterwards
102-
if system_packages["gcc"]:
102+
if "gcc" in system_packages:
103103
gcc_packages = {"gcc": system_packages["gcc"]}
104104
del system_packages["gcc"]
105105
else:

0 commit comments

Comments
 (0)