move depfile logic into its own module, separate traversal logic from model#36911
move depfile logic into its own module, separate traversal logic from model#36911haampie merged 7 commits intospack:developfrom
Conversation
|
Very nice, I can follow with a smaller one to remove some ugliness from |
|
@scheibelp you could now add a test along the lines of import spack.environment.depfile as df
from spack.spec import Spec
x, y, z = Spec("x"), Spec("y"), Spec("z")
model = df.MakefileModel(
env_path="somewhere",
roots=[x],
adjacency_list=[
df.DepfileNode(x, [y], df.UseBuildCache.AUTO),
df.DepfileNode(y, [z], df.UseBuildCache.AUTO)
],
make_prefix="test",
pkg_identifier_variable="SPACK_PACKAGE_IDS",
jobserver=False,
)
data = model.to_dict()
assert ... data["..."] ... |
|
This is a version of the initial implementation I suggested in #36642 (comment), and has the same issue I described there: The unsafe nature of general spec formatting is not encoded into this solution and so it is easy to introduce special characters as part of You haven't directly responded to the follow-up suggestion I made in that comment - could you do that? Overall I like these changes, but don't find them specifically relevant to the problem that #36642 attempts to address. |
alalazo
left a comment
There was a problem hiding this comment.
Basically LGTM, a few minor comments. With this I think I can clean up:
spack/lib/spack/spack/bootstrap/environment.py
Lines 124 to 132 in 4d11001
…ersal logic from model (spack#36911)" (spack#36985)" This reverts commit 381c0af.
…gic from model (spack#36911)" (spack#36985) This reverts commit a676f70.
The depfile logic was more of a quick and dirty script in cmd/env.py, this PR
extracts the traversal and model stuff into its own module, so it gets easier
to write tests for it.