-
Notifications
You must be signed in to change notification settings - Fork 5
fix: ensure spack env exists before activation #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
We need to update tokens, it seems. I took liberty to submit to https://eicweb.phy.anl.gov/containers/eic_container/-/merge_requests/1270 for now. |
|
This is not necessary. Directories are valid environments. Creating a named environment will place it in a different directory than intended. |
|
See https://spack.readthedocs.io/en/latest/environments.html#independent-environments in contrast with https://spack.readthedocs.io/en/latest/environments.html#creating-a-managed-environment Adding a managed environment with the name $ENV will create it, but it will still be the anonymous environment that is filled and installed in the container. |
|
Looks like updating the Spack packages repo isn’t possible unless you’re working inside a named environment (see #29). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request attempts to fix an issue by adding spack env create ${ENV} before activating the spack environment. However, this change introduces a bug rather than fixing one. The added line creates a new named environment in spack's default location, but the subsequent line activates a directory-based environment at a different path. These are two distinct environments, and the change creates confusion between named and directory-based spack environment activation patterns.
Key Changes
- Adds
spack env create ${ENV}before the existingspack env activate --without-view --dir ${SPACK_ENV}command in the builder_concretization_default stage
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Concretization (default environment) | ||
| RUN <<EOF | ||
| set -e | ||
| spack env create ${ENV} |
Copilot
AI
Dec 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line creates a new named environment "xl" in spack's default location, but the next line activates a directory-based environment at ${SPACK_ENV} (/opt/spack-environment/xl). These are two different environments. The directory already contains a spack.yaml file (copied at line 44), so it can be activated directly without creating a new environment. Other similar usages in this file (lines 178, 283, 322) activate the directory environment without calling 'spack env create' first. This line should be removed.
| spack env create ${ENV} |
Related to #23