You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tutorial_developer_workflows.rst
+19-7Lines changed: 19 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -160,13 +160,6 @@ So how does Spack determine the value of the ``dev_path`` variant?
160
160
By default, the source code is downloaded into a subdirectory of the environment using Spack's staging functionality.
161
161
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``.
162
162
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.
170
163
171
164
.. literalinclude:: outputs/dev/develop-conc.out
172
165
:language: console
@@ -218,6 +211,25 @@ If we were co-developing ``macsio``, we could run
218
211
.. literalinclude:: outputs/dev/develop-5.out
219
212
:language: console
220
213
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
+
221
233
Using development workflows also lets us ship our whole development process to another developer on the team.
222
234
They can simply take our spack.yaml, create a new environment, and use this to replicate our build process.
223
235
For example, we'll make another development environment here.
0 commit comments