Skip to content

Conversation

@albestro
Copy link
Contributor

In the cluster configuration the file packages.yaml is optional

# load system/packages.yaml -> system_packages (if it exists)
system_packages = {}
system_packages_path = self.system_config_path / "packages.yaml"
if system_packages_path.is_file():
# load system yaml
with system_packages_path.open() as fid:
raw = yaml.load(fid, Loader=yaml.Loader)
system_packages = raw["packages"]

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.

# extract gcc packages from system packages
# remove gcc from packages afterwards
if system_packages["gcc"]:
gcc_packages = {"gcc": system_packages["gcc"]}
del system_packages["gcc"]
else:
raise RuntimeError("The system packages.yaml file does not provide gcc")

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.

@albestro albestro requested review from bcumming and msimberg August 25, 2025 10:41
Copy link
Member

@bcumming bcumming left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@bcumming bcumming merged commit 5cfbae8 into main Aug 25, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants