WIP, ENH: remove ~/.spack requirement#13139
WIP, ENH: remove ~/.spack requirement#13139tylerjereddy wants to merge 2 commits intospack:developfrom
Conversation
cc3e8e8 to
3aa9180
Compare
becker33
left a comment
There was a problem hiding this comment.
I'm pretty strongly opposed to a usage model that suggests users should change $spack/etc/spack/defaults/*. Those files should be read-only. Would the same thing be possible with the system scope $spack/etc/spack/config.yaml
|
I've pushed some revisions, including a draft regression test, but I still need to work on this/test more. I think something is still not quite right with the scoping for example, when used outside the unit test context. |
It looks like any scope should be possible, except the user scope itself of course. That said, switching to the system scope didn't quite work in my hands locally when I played with it. Well, I'll have to work on that. |
|
Ah, I figured that out, I do have to I'll work on more cleanups before I push again though. |
62d20c3 to
216a1cc
Compare
|
Alright, I think I've addressed reviewer comments so far. Tests are passing locally & I added another test in there too, for cache handling with custom Added some docs. |
| that does not point to ``~/.spack/stage``. | ||
|
|
||
| Setting ``user_path`` at configuration scopes with higher precedence | ||
| than ``site`` is not currently supported. |
There was a problem hiding this comment.
If core devs think this would be useful, I could look into it, but I'll hold off on that time investment for now. Getting the regression tests reasonably appropriate has been the most time consuming thing.
* it is no longer absolutely required that ~/.spack be used as the user-level config scope path---it can now be customized to any arbitrary system path * ~/.spack remains the default for backward compatibility, but a custom value may be provided in etc/spack/defaults/config.yaml * to accomplish this, it was necessary to generate a second Configuration instance containing only the default scope, so that this scope could be parsed for the user_path setting when populating the true Configuration scope
* added a unit test, test_get_config_user_path_priority(), to verify the configuration scope priority hierarchy for setting user_path & to ensure that new configuration files are placed in the highest-priority user_path without polluting the lower-priority user_path entries * add some clarifying comments to config.py with regard to configuration scoping of user_path; it was also necessary to individually push each scope that will be allowed to provide user_path in the early fetch phase * add a second unit test to ensure that misc_cache gets re-rooted to custom user_path, when provided; a minor library code adjustment was needed to allow a change in user_path to dictate the change in misc_cache * add documentation for `user_path` * remove a spurious os.path.join() in config:user_path cache path resolution * adjust the comment language describing removal of user_config_path such that it directs setting user_path at the system scope or a higher priority scope
216a1cc to
b14c214
Compare
|
Updated with fix for Python 2.7/3.5 in one of the new unit tests. |
|
Any feedback on the revised version of this PR? |
|
CC: @tjfulle I don't know the technical details of the implementation of this PR but I would be super excited if this type of feature could be merged and released in say |
|
Just wanted to comment in support of some (any) method to get spack to look for the user configuration in a location other than |
|
cc @gshipman |
|
@tylerjereddy @junghans @becker33: this is just a thought, but would it satisfy your use case better if we allowed some environments to be independent of everything except the Spack defaults? So, for example, you could have: spack:: # :: means do NOT include config from /etc, $spack/etc/spack, or ~/.spack
...This way you could specify per- I also think it's worthwhile to enable the user to customize whether a user's global config is factored in but I'm curious whether this would also fix your immediate problem. |
|
@tgamblin I checked with Mike, and he didn't seem to think this would work--we want our spack instance to be able to specify that each user has a local insulated/unique Note that we have no plans to adopt environments in production anytime soon, so |
|
#13916 is another PR to accomplish having the user config scope not be hard coded to |
|
Closing, since the underlying issue has been solved as documented here |
it is no longer absolutely required that
~/.spackbe used as the user-level configscope path---it can now be customized
to any arbitrary system path
~/.spackremains the default for backwardcompatibility, but a custom value may
be provided in
etc/spack/defaults/config.yamlto accomplish this, it was necessary to
generate a second
Configurationinstance containingonly the default scope, so that this scope
could be parsed for the
user_pathsettingwhen populating the true
Configurationscope
Fixes #12892
Fixes #13057
Closes #7433
cc @junghans @AndrewGaspar @alalazo
Notes
user_pathvariable value and my repos and mirror lists get cleared, and if I add new ones then the newuser_pathstarts getting populated with config files, which is a good sign, I think