Skip to content

Commit 73a152c

Browse files
committed
Rework flow for more features
Signed-off-by: psakiev <psakiev@sandia.gov>
1 parent 0e83817 commit 73a152c

1 file changed

Lines changed: 19 additions & 7 deletions

File tree

tutorial_developer_workflows.rst

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -160,13 +160,6 @@ So how does Spack determine the value of the ``dev_path`` variant?
160160
By default, the source code is downloaded into a subdirectory of the environment using Spack's staging functionality.
161161
You can change the location of this source directory by modifying the ``path:`` attribute of the develop configuration in the environment or by passing the ``--path`` options when calling ``spack develop``.
162162

163-
There are a few gotchas with the ``spack develop`` command
164-
165-
* Spack needs to know the version of the dev package so it can supply the correct flags for the package's build system.
166-
If a version is not supplied or detectable in the environment, then Spack falls back to the maximum version defined in the package where `infinity versions <https://spack.readthedocs.io/en/latest/packaging_guide_creation.html#version-comparison>`_ like ``develop`` and ``main`` have a higher value than the numeric versions.
167-
* You should ensure a spec for the package you are developing appears in the DAG of at least one of the roots of the environment with the same version that you are developing.
168-
``spack add <package>`` with the matching version you want to develop is a way to ensure the develop spec is satisfied in the ``spack.yaml`` environments file.
169-
This is because develop specs are not concretization constraints but rather criteria for adding the ``dev_path=`` variant to existing spec.
170163

171164
.. literalinclude:: outputs/dev/develop-conc.out
172165
:language: console
@@ -218,6 +211,25 @@ If we were co-developing ``macsio``, we could run
218211
.. literalinclude:: outputs/dev/develop-5.out
219212
:language: console
220213

214+
Note that we intentionally gave a different version and in the examples above ``macsio`` never received the ``dev_path`` variant.
215+
This example is to show a few gotchas with the ``spack develop`` command
216+
217+
* You should ensure a spec for the package you are developing appears in the DAG of at least one of the roots of the environment with the same version that you are developing.
218+
``spack add <package>`` with the matching version you want to develop is a way to ensure the develop spec is satisfied in the ``spack.yaml`` environments file.
219+
This is because develop specs are not concretization constraints but rather criteria for adding the ``dev_path=`` variant to existing spec.
220+
* Spack needs to know the version of the dev package so it can supply the correct flags for the package's build system.
221+
If a version is not supplied or detectable in the environment, then Spack falls back to the maximum version defined in the package where `infinity versions <https://spack.readthedocs.io/en/latest/packaging_guide_creation.html#version-comparison>`_ like ``develop`` and ``main`` have a higher value than the numeric versions.
222+
223+
If we really wanted to change to developing ``macsio@develop`` we need to change the root spec in the environment and then reconcretize.
224+
225+
In our case the ``1.1`` version is sufficient and we will use this as an opportunity to introduce another ``spack develop`` feature: the ``--recursive`` option.
226+
``spack develop --recursive`` can only be used with a concrete environment.
227+
When called Spack traces the graph from the supplied develop spec to every root in the graph that transitivley depends on the develop package.
228+
This is a nice way to ensure that all specs are skipping restages, and performing incremental builds if their build-system allows for it.
229+
230+
.. literalinclude:: outputs/dev/develop-6.out
231+
:language: console
232+
221233
Using development workflows also lets us ship our whole development process to another developer on the team.
222234
They can simply take our spack.yaml, create a new environment, and use this to replicate our build process.
223235
For example, we'll make another development environment here.

0 commit comments

Comments
 (0)