Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion tutorial_environments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -373,11 +373,22 @@ So, adding specs to an environment at a later point in time will not cause exist
Adding and installing specs incrementally leads to greedy concretization, meaning that the environment may have different package versions compared to an environment created all at once.

When you first install ``python`` in an environment, Spack will pick a recent version.
If you then add ``py-numpy``, it may be in conflict with the ``python`` version already installed, and fail to concretize:


.. literalinclude:: outputs/environments/incremental-1.out
:language: spec

If you then add ``py-numpy``, it may be in conflict with the ``python`` version already installed, and fail to concretize.

.. warning::

There is a known bug in Spack that causes this set of specs to take over an hour to concretize, so there is no need to run it for this tutorial.

.. code-block:: spec

$ spack install --add [email protected] 2>&1 | tail -n1
internal_error("version weights must exist and be unique"). Couldn't concretize without changing the existing environment. If you are ok with changing it, try `spack concretize --force`. You could consider setting `concretizer:unify` to `when_possible` or `false` to allow multiple versions of some packages.

The solution is to re-concretize the environment as a whole, which causes ``python`` to downgrade to a version compatible with ``py-numpy``:

.. literalinclude:: outputs/environments/incremental-2.out
Expand Down