Added Option to disable user configs#7433
Conversation
- When using spack at the system level, as a central installer amongst a group of users, the user configs simply a source of confusion and problems. - Added a user_configs option at the config.yaml level, which default to True. - Spack user configs are now added in spack __init__.py.
healther
left a comment
There was a problem hiding this comment.
There was a discussion involving at least me @adamjstewart @tgamblin and maybe @alalazo and @scheibelp some time ago. I really like the proposal, but we should be careful that moving the misc cache to a common location does not introduce problems. The alternative would be to simply add a misc cache for every unique user below $SPACK_ROOT.
It would also allow users to put spack into ~/.spack which I know there was at least one request for (albeit I can't find the issue anymore)
etc/spack/defaults/config.yaml
Outdated
|
|
||
|
|
||
| # Whether or not to use configs from the user's home directory ~/.spack. | ||
| user_configs: false |
There was a problem hiding this comment.
Doesn't that mean that there is no user_config by default?
|
|
||
| misc_cache_path = canonicalize_path( | ||
| _config.get('misc_cache', join_path(user_config_path, 'cache'))) | ||
| _config.get('misc_cache', _default_misc_cache_path)) |
There was a problem hiding this comment.
I don't know enough about the internal workings of spack, but this may interfere with multiple people trying to access it at the same time. I'm not really sure which kind of information is stored in the misc-cache anyways, though...
There was a problem hiding this comment.
misc_cache is a FileCache object; all the read and writes are done with a file lock. It should be fine.
My main concern in this regard is permissions, but that's a general problem with a shared spack install anyway. The easy answer is for all users to use a shared group, and have the group sticky bit set on the root directory.
|
Closing as stale. Feel free to reopen if you think this should be revisited. |
For our use case, there should be no user specific configuration to Spack, as the configuration is common to the entire team. Leaving them in place is highly likely to cause problems. As such, I've added a config option to disable them.
The option (default True) is checked in spack init, and user configs are added to the ConfigScope there.
The only complication is the misc_cache directory, which is based on the user config directory. That now defaults to being created in the same parent directory as the normal cache.