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
+20-9Lines changed: 20 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -150,8 +150,10 @@ Develop specs are listed in their own ``develop`` section inside the ``spack.yam
150
150
The mechanics of how this section is used to enforce develpoment are as follows:
151
151
152
152
1. Specs in the environment that ``satisfy`` the develop specs are selected for development.
153
-
2. Any specs selected in step 1 receive a ``dev_path=`` variant. This variant tells Spack where to find the source code for the spec.
154
-
3. Calls to ``spack install`` will now use the source code at ``dev_path`` when building that package. Spack doesn't clean this build up after a successful build so subsequent calls to ``spack install`` trigger incremental builds.
153
+
2. Any specs selected in step 1 receive a ``dev_path=`` variant.
154
+
This variant tells Spack where to find the source code for the spec.
155
+
3. Calls to ``spack install`` will now use the source code at ``dev_path`` when building that package.
156
+
Spack doesn't clean this build up after a successful build so subsequent calls to ``spack install`` trigger incremental builds.
155
157
156
158
If the environment is already concretized ``spack develop`` performs step 1 and 2 insitu and updates the ``spack.lock`` file unless the ``--no-modify-concrete-specs`` option is passed.
157
159
If ``--no-modify-concrete-specs`` is passed, the environment is not yet concretized, or needs to be futher changed to satisfy the develop specs (i.e. change version of the package) then selection of develop specs and assignment of ``dev_path`` are handled by the concretizer.
@@ -217,35 +219,44 @@ We will use this as an opportunity to introduce another ``spack develop`` featur
217
219
:language: console
218
220
219
221
``spack develop --recursive`` can only be used with a concrete environment.
220
-
When called Spack traces the graph from the supplied develop spec to every root in the graph that transitivley depends on the develop package.
221
-
Using ``--recursive`` can be very powerful wehn developing applications deep in a graph.
222
+
When called Spack traces the graph from the supplied develop spec to every root in the graph that transitively depends on the develop package.
223
+
Using ``--recursive`` can be very powerful when developing applications deep in a graph.
222
224
In this case our development point is very close to the root spec so we could have called ``spack develop macsio`` and gotten the same result.
223
225
224
226
Pre-configuring development environments
225
227
----------------------------------------
226
228
227
-
So far all of our calls to ``spack develop`` have been on a concretized environment, and we have allowed spack to automatically update the build specs for us.
229
+
So far all of our calls to ``spack develop`` have been on a concretized environment, and we have allowed Spack to automatically update the build specs for us.
228
230
If we don't want Spack to update the concrete environment's specs we can pass the ``---no-modify-concrete-spec``.
229
-
This will require you to force concretize an environment to have the develop specs take affect.
231
+
Using ``---no-modify-concrete-spec`` will require you to force concretize an environment to have the develop specs take affect.
232
+
233
+
Examples of where we might want to use this feature are:
234
+
- The package we wish to develop is repeated in our environment and we need to be more selective.
235
+
- We want to mark a develop spec that doesn't exist yet in the environment.
236
+
237
+
We will show an example of the latter, and how to update the local source if you decide to change the version.
238
+
Let's say we plan to extend our environment to develop the ``nekbone`` package.
230
239
231
240
.. literalinclude:: outputs/dev/develop-6.out
232
241
:language: console
233
242
234
-
This example is to show a few gotchas with the ``spack develop`` command
243
+
Admittedly, this example is a bit contrived and is primarily to show a few gotchas with the ``spack develop`` command
235
244
236
245
* 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.
237
246
``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.
238
247
This is because develop specs are not concretization constraints but rather criteria for adding the ``dev_path=`` variant to existing spec.
239
248
* Spack needs to know the version of the dev package so it can supply the correct flags for the package's build system.
240
249
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.
250
+
* The source code located at the spec's ``dev_path`` is the users responsibility to manage.
251
+
Spack does provide an initial clone of the source code, but it makes no guarantees or additional verification of the source beyond that.
252
+
Users can manage the code locally via a version control system like ``git``, or can trigger a re-stage by calling ``spack develop --force``.
241
253
242
-
If we really wanted to change to developing ``macsio@develop`` we need to change the root spec in the environment and then reconcretize.
243
254
244
255
Sharing development environments
245
256
--------------------------------
246
257
247
258
Using development workflows also lets us ship our whole development process to another developer on the team.
248
-
They can simply take our spack.yaml, create a new environment, and use this to replicate our build process.
259
+
They can simply take our ``spack.yaml``, create a new environment, and use this to replicate our build process.
249
260
For example, we'll make another development environment here.
0 commit comments