Reuse concretization by default (#30396)

* Enable reuse by default in Spack
* Update documentation to match new default
* Configure pipelines not to reuse software
This commit is contained in:
Massimiliano Culpo 2022-05-13 18:11:10 +02:00 committed by GitHub
parent faa277778e
commit d900ac2003
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 43 additions and 27 deletions

View File

@ -14,7 +14,7 @@ concretizer:
# concretizing specs. If `true`, we'll try to use as many installs/binaries # concretizing specs. If `true`, we'll try to use as many installs/binaries
# as possible, rather than building. If `false`, we'll always give you a fresh # as possible, rather than building. If `false`, we'll always give you a fresh
# concretization. # concretization.
reuse: false reuse: true
# Options that tune which targets are considered for concretization. The # Options that tune which targets are considered for concretization. The
# concretization process is very sensitive to the number targets, and the time # concretization process is very sensitive to the number targets, and the time
# needed to reach a solution increases noticeably with the number of targets # needed to reach a solution increases noticeably with the number of targets
@ -27,4 +27,4 @@ concretizer:
# If "false" allow targets that are incompatible with the current host (for # If "false" allow targets that are incompatible with the current host (for
# instance concretize with target "icelake" while running on "haswell"). # instance concretize with target "icelake" while running on "haswell").
# If "true" only allow targets that are compatible with the host. # If "true" only allow targets that are compatible with the host.
host_compatible: false host_compatible: true

View File

@ -192,32 +192,32 @@ you can use them to customize an installation in :ref:`sec-specs`.
Reusing installed dependencies Reusing installed dependencies
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. warning:: By default, when you run ``spack install``, Spack tries hard to reuse existing installations
as dependencies, either from a local store or from remote buildcaches if configured.
This minimizes unwanted rebuilds of common dependencies, in particular if
you update Spack frequently.
The ``--reuse`` option described here will become the default installation In case you want the latest versions and configurations to be installed instead,
method in the next Spack version, and you will be able to get the current you can add the ``--fresh`` option:
behavior by using ``spack install --fresh``.
By default, when you run ``spack install``, Spack tries to build a new
version of the package you asked for, along with updated versions of
its dependencies. This gets you the latest versions and configurations,
but it can result in unwanted rebuilds if you update Spack frequently.
If you want Spack to try hard to reuse existing installations as dependencies,
you can add the ``--reuse`` option:
.. code-block:: console .. code-block:: console
$ spack install --reuse mpich $ spack install --fresh mpich
This will not do anything if ``mpich`` is already installed. If ``mpich`` Reusing installations in this mode is "accidental", and happening only if
is not installed, but dependencies like ``hwloc`` and ``libfabric`` are, there's a match between existing installations and what Spack would have installed
the ``mpich`` will be build with the installed versions, if possible. anyhow.
You can use the :ref:`spack spec -I <cmd-spack-spec>` command to see what
You can use the ``spack spec -I mpich`` command to see what
will be reused and what will be built before you install. will be reused and what will be built before you install.
You can configure Spack to use the ``--reuse`` behavior by default in You can configure Spack to use the ``--fresh`` behavior by default in
``concretizer.yaml``. ``concretizer.yaml``:
.. code-block:: yaml
concretizer:
reuse: false
.. _cmd-spack-uninstall: .. _cmd-spack-uninstall:

View File

@ -242,12 +242,7 @@ to enable reuse for a single installation, and you can use:
spack install --fresh <spec> spack install --fresh <spec>
to do a fresh install if ``reuse`` is enabled by default. to do a fresh install if ``reuse`` is enabled by default.
``reuse: true`` is the default.
.. note::
``reuse: false`` is the current default, but ``reuse: true`` will be the default
in the next Spack release. You will still be able to use ``spack install --fresh``
to get the old behavior.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Selection of the target microarchitectures Selection of the target microarchitectures

View File

@ -2,6 +2,9 @@ spack:
view: false view: false
concretization: separately concretization: separately
concretizer:
reuse: false
config: config:
install_tree: install_tree:
root: /home/software/spack root: /home/software/spack

View File

@ -2,6 +2,9 @@ spack:
view: false view: false
concretization: separately concretization: separately
concretizer:
reuse: false
config: config:
install_tree: install_tree:
root: /home/software/spack root: /home/software/spack

View File

@ -2,6 +2,9 @@ spack:
view: false view: false
concretization: separately concretization: separately
concretizer:
reuse: false
config: config:
concretizer: clingo concretizer: clingo
install_tree: install_tree:

View File

@ -2,6 +2,9 @@ spack:
view: false view: false
concretization: separately concretization: separately
concretizer:
reuse: false
config: config:
concretizer: clingo concretizer: clingo
install_tree: install_tree:

View File

@ -2,6 +2,9 @@ spack:
view: false view: false
concretization: separately concretization: separately
concretizer:
reuse: false
config: config:
concretizer: clingo concretizer: clingo
install_tree: install_tree:

View File

@ -2,6 +2,9 @@ spack:
concretization: separately concretization: separately
view: false view: false
concretizer:
reuse: false
config: config:
concretizer: clingo concretizer: clingo
install_tree: install_tree:

View File

@ -2,6 +2,9 @@ spack:
view: false view: false
concretization: separately concretization: separately
concretizer:
reuse: false
config: config:
install_tree: install_tree:
root: /home/software/spack root: /home/software/spack