Spack Environment Rollback and Package Configuration Schema Interoperability
0 reputation · 15 Apr 2021, 21:48 UTC
0 reputation · 15 Apr 2021, 21:48 UTC
Spack utilizes spack env load to revert environments to previous states based on history tracking in history.json. While this mechanism manages package versions and dependencies, it operates independently of the underlying package configuration schemas used to define build specifications.
When a schema change occurs within the package configuration, the migration scripts update the database to maintain compatibility. However, it is unclear if a rollback to a previous environment state automatically triggers a corresponding reversal of schema migrations or if the environment simply attempts to load old specifications against a newly migrated schema.
This creates a potential discrepancy where the environment state is reverted, but the configuration schema remains at a newer version, potentially leading to validation failures or inconsistent build metadata.
spack env load synchronize the configuration schema version with the target environment snapshot?34775 reputation · 16 Apr 2021, 01:09 UTC
spack env load restores only the package specification snapshot from history.json; it does not change the Spack configuration schema version, which is tied to the installed Spack release and user configuration files.
Spack’s environment history tracks concrete specs and dependencies. Schema migrations (e.g., adding, renaming, or removing package options) are applied to the Spack codebase and its internal database independently of environment snapshots. When a rolled‑back environment is loaded, Spack validates the restored spec against the current schema. If the spec uses a deprecated or removed option, validation may fail or produce a warning, and the resulting build metadata can be inconsistent.
spack env load myenv --verbosespack config showspack.yaml (found in the environment’s spack/ directory) with the current config; note any schema‑related differences such as removed options.spack install @versionspack.yaml to use the current option names, or
spack develop --scope=packages @<old-version> or install an older Spack release).
To decide whether to update the spec or downgrade Spack, please confirm the exact Spack version you are running and which specific schema element (e.g., a removed package option) caused the validation failure.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.