Skip to content

Commit 92c9174

Browse files
committed
doc: desc. updating tags on loaded mods in design doc
1 parent bacf75e commit 92c9174

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

doc/source/design/module-tags.rst

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,3 +305,45 @@ Querying
305305
- Tags cannot be queried to select modules
306306

307307
- Symbolic versions or variants can be used to select modules
308+
309+
Updating tags on already loaded modules
310+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
311+
312+
- An attempt to load an already loaded module with a ``--tag`` option set will
313+
update the list of extra tags set for this loaded module
314+
315+
- Works for every sub-command and modulefile commands accepting the
316+
``--tag`` option
317+
- Does not imply the reload of the loaded module
318+
- Add tags to the tag list already set, no removal
319+
- As tags defined with ``module-tag`` cannot be unset
320+
321+
- A ``tag`` sub-command may seem useful to update tag list of already loaded
322+
modules
323+
324+
- But it is simpler to use the loading/enabling sub-command to set these
325+
extra tags, especially to distinguish between tagging modules or
326+
modulepaths
327+
- So no need for a dedicated sub-command, use loading or enabled
328+
sub-commands instead
329+
330+
- If extra tags specified are already set as non-extra tags on already loaded
331+
module, the tags are not updated (extra tag list is not updated)
332+
333+
- With ``prereq``-like commands:
334+
335+
- only the first loaded requirement in specified list gets its tag list
336+
updated
337+
- loading requirement does not get its tag list updated (no real use case
338+
foreseen for cyclic dependencies)
339+
340+
- When restoring collection, extra tags of modules are unset to only keep the
341+
extra tags defined in collection.
342+
343+
- Extra tags are cleared either when module is unloaded or specifically
344+
if module is already loaded at the correct position
345+
346+
- When unloading a module, the ``auto-loaded``, ``keep-loaded`` and all
347+
extra tags are unset from in-memory knowledge, not to reapply automatically
348+
these tags if the module is loaded again: only the extra and state tags
349+
from this new load will be set.

0 commit comments

Comments
 (0)