Skip to content

Warn users if an environment is only partially installed upon activation #13675

@alalazo

Description

@alalazo

As a user I would like to be warned if an environment is only partially installed when I activate it so that it will be clear that it needs update and might not behave as I expect in its current state.

Rationale

Spack activates environments either following an explicit user request or implicitly if the spack.yaml manifest is in the current working directory. In both cases when an environment is activated there are modifications that might take place to make the environment readily available. These modifications may rely on the inspection of spec prefixes thus, if the environment is not completely installed, there might be discrepancies between the expected behavior of the environment and the actual one. This should be reported to the user by a warning.

Description

If an environment is not completely installed we should emit a warning message like:

$ spack env activate ...
==> Warning: the environment is only partially installed and as such it might be inconsistent with the requests in spack.yaml. Run `spack install` to complete its installation and then reactivate it.

to inform the user of the current situation and suggest what to do to fix it.

Additional information

When solving this we should also add regression tests for #13529 and #13509

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions