fix: ensure spack env exists before activation#25
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.
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} |
There was a problem hiding this comment.
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} |
|
Closing in favor of #131. |
Related to #23