FNALssi / spack-mpd

0 stars 4 forks source link

Possibility to use unnamed concretized environments #9

Open tmadlener opened 3 days ago

tmadlener commented 3 days ago

I am just experimenting a bit with using different base environments and a common thing that we do is to have "unnamed environments", i.e. simply have a folder with a spack.yaml and in that folder to spack env activate .. Concretizing this yields a spack.lock and it's possible to use the absolute path to the folder in spack:include_concrete in another environment spack.yaml definition.

spack-mpd seems to struggle a bit with this because it requires the environment to be a name here:

https://github.com/FNALssi/spack-mpd/blob/0c15e205566dc0c49578d4622c082882dbf82cd7/mpd/concretize.py#L192

(spack.environment.read does the validation in this case)

I am not entirely sure which would be the right API here to support absolute paths (or if it even exists). It should technically be possible to do this, because I can concretize the environment that spack-mpd produces after I manually put in the absolute path to the concrete base environment into the spack.yaml file that spack-mpd generates.

knoepfel commented 3 days ago

Thanks for spotting this, @tmadlener. Yes, this should be a reasonably straightforward addition.