spack develop: fast automatic reconcretization#51140
Conversation
|
This is pretty close to what I wanted for |
e73702a to
1a94366
Compare
|
I guess what needs discussion/alignment here is this: with this PR there are two workflows:
Both have use cases. My only use case is the imperative workflow for troubleshooting build failures. In fact I've never really used the declarative way, cause I worked around it by just putting It seems that @psakievich has different ideas about what this selector spec on the command line means? I want to be able to be very precise and specify the current dag hash of a spec that fails to build, and I don't wanna deal with package names and versions and hope for one and only one match. I'm aware that as soon as you run |
|
I'm fine with making I think the issue of a selector is one we should think through (specifically the part about selecting by hash but not recording the hash is worth working through) but I also think it is orthogonal to this PR. As currently written, this PR has no effect on which packages have With that said, I think that leaves the following points to address still:
@haampie @psakievich do either of y'all disagree that these other issues can be orthogonalized? |
Agreed
Yeah, I think it affects this PR in what a good name for the flag is. Also raises the question whether this option should modify I do think it makes sense to drop the |
|
I agree that they are orthogonal and I also agree with @haampie that we really only need one flag for turning off the default behavior. |
I think for this PR that is the paradigm that spack develop operates and it is fine for that. Perhaps we could/should add a flag or another command for changes that don't also add to the develop specs must section? I think for surgical operations that makes a ton of sense. For environments where you create it with the intention to do lots of development, recording those intentions in the yaml is nice. As part of the commit variant changes @alalazo and I modified the concretizer so This may remove the need to have spack develop do so many one off things that can be handled in the solve now. Related but also for a separate PR, I want this feature for the |
|
@psakievich I think it would be possible to refactor this as a generic Environment mutator that calls a generic Spec mutator, with a callback for the particular change to execute on the spec. I decided that as long as this is the only feature that works this way it's not worth doing, but let's talk about extending it to commit variants once this is in. |
f553b99 to
d6fa5b2
Compare
|
@psakievich This should not be affected -- in this PR each node calls |
haampie
left a comment
There was a problem hiding this comment.
I just did a quick pass over the current state of the PR.
(I still think there should be one flag and not two.)
|
I'd like to use a hash, which hits bugs: Another issue is that if it fails to find a match in the environment, it will still clone its sources and update I think this mode should update |
|
@haampie you cannot use an anonymous spec with the I disagree about whether it should update spack.yaml. If this is going to be the default mode, we need it to work whether the environment has been concretized already or not. The modification to |
This difference is where I could see
|
|
These two statements:
together don't make sense. Obviously there is no point in having a hash recorded in the
I have no interest in sharing, I'm using this "develop" feature only to troubleshoot build failures, which is a very legitimate use case. As I said earlier, I think it makes a lot of sense to have two modes of operation, one declarative like the status quo (spack.yaml changes, share with others etc), and one imperative with the new flag (spack.lock changes only). |
|
I don't think we should be making changes to the spack.lock of an environment that aren't reflected in the spack.yaml. I think that fundamentally breaks the model. What is the failure case that you're worried about that modifying the |
Signed-off-by: Gregory Becker <[email protected]>
Signed-off-by: Gregory Becker <[email protected]>
Signed-off-by: Gregory Becker <[email protected]>
Signed-off-by: Gregory Becker <[email protected]>
Signed-off-by: Gregory Becker <[email protected]>
…nts to overwrite Signed-off-by: Gregory Becker <[email protected]>
Signed-off-by: Gregory Becker <[email protected]>
97c332f to
13e9994
Compare
Signed-off-by: Gregory Becker <[email protected]>
Signed-off-by: Gregory Becker <[email protected]>
Signed-off-by: Gregory Becker <[email protected]>
2714986 to
aa5ebca
Compare
Signed-off-by: Gregory Becker <[email protected]>
psakievich
left a comment
There was a problem hiding this comment.
Flags for undevelop need to be updated. For tests I think it would be valuable to add a test that verifies downstream deps of the develop spec have correctly updated hashes. I won't hold up approval, but I would consider it advantageous to have in the test suite. The cascading effects for the environment are an important part of this feature set.
Signed-off-by: Gregory Becker <[email protected]>
Signed-off-by: Gregory Becker <[email protected]>
|
Implementation looks good to me. I would suggest to update/reorder the docs to promote the workflow we currently recommend. In terms of naming, I thought |
Signed-off-by: Gregory Becker <[email protected]>
spack developcurrently requires a reconcretization of the environment because the specs change due to thedev_pathvariant being added for developed specs.This is a very special form of concretization, since the purpose is not to reevaluate all of the decisions of the concretizer, but just to force in or force the removal of a single attribute.
This PR adds options (and makes them the default) to have
spack developandspack undevelopautomatically apply these changes for all concrete specs. This implementation is much more performant than a full solve (in my test case it resolves functionally instantaneously instead of ~15 seconds).TODO: