Re:Everything that uses configuration files should report wh...
by tgamblin on Sunday June 25, 2023 @12:28PM
(#36469926)
FWIW, we do something like this in Spack[1] with `spack blame`. There are different YAML configs, they can be merged based on precedence, but we tell you where all the merged values are coming from. Here's a simplified example -- you can see that some settings are coming from the user's "default" environment, some from Spack's defaults, and some from specific defaults from Darwin:
The filenames are shown in color in the UI; you can see what it really looks like here: https://imgur.com/uqeiBb5
For the curious, there is more on scopes and merging [2]. This isn't exactly easy to do -- we use ruamel.yaml [3], but had to add our own finer-grained source attribution to get this level of detail. There are also tricky things to deal with to maintain provenance on plain old Python dict/str/list/etc. objects [4,5].
For the curious, there is more on scopes and merging [2]. This isn't exactly easy to do -- we use ruamel.yaml [3], but had to add our own finer-grained source attribution to get this level of detail. There are also tricky things to deal with to maintain provenance on plain old Python dict/str/list/etc. objects [4,5].
[1] https://github/spack/spack
[2] https://spack.readthedocs.io/en/latest/configuration.html
[3] https://yaml.readthedocs.io/en/latest/
[4] https://github.com/spack/spack/blob/95ca9de/lib/spack/spack/...
[5] https://github.com/spack/spack/blob/95ca9de/lib/spack/spack/...