-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What config scope should be the default? #2184
Comments
I had no idea any of these commands exist. Why should I learn them to look at a single scope if I have emacs/vim/etc? Now that there are so many overriding scopes... I would be interested in a "merge" command that shows you the resulting configuration file (I believe it already exists?) Something like: Something akin to
To be honest... I don't use these commands much either. My modus operandus seems to be to edit config files directly. I think the defaults seem reasonable. But allowing the defaults to be changed in config might be overkill. I would lean toward hard-coding the way commands choose which scope to edit, and let the user override with a command line option. If they're not hard-coded, then it becomes harder to tell people which commands to issue. Because the right command for one installation will edit the wrong scope on another. Especially since there are now eight places where the default scope to edit can be changed.
Does this take cross-compilers into account? (Sorry, cross-compilers make my head hurt). |
You don't have to. But I'm not really asking you to -- our users like these, and it's easier for me to send commands in an email to copy/paste than to tell a user to edit a file in a precise way. cf. the command line instructions on every single PR on github.
yay!
I'm trying to anticipate the project scope you want, but maybe you're right. Default could be user, or
They're actually below this level. Each platform can have multiple OS/targets that live on it. e.g, BG/Q has a different OS/target combo on the login nodes vs. on the compute nodes. Cray has different OS's. That's all handled within Platform-specific configs are there mainly so that we can ship good defaults for machines like BG/Q and Cray. |
|
Agreed!
Also agreed! This might be too much clutter to do by default, but we should at least have a flag to enable this. As for Modify operations, I don't personally need platform-specific configurations, but I can see why others would. A setting in @tgamblin I'm glad you're taking a look at this! This inconsistency caused #2042 and #2164 for me. As long as those are fixed, I don't care that much about the implementation. I'm hoping that I can run |
#11919 is superseded by the default config edit scope proposed here. @scheibelp @tgamblin That would also alleviate concerns from Chris Nelson and Ross Bartlett about polluting user home directories, and others have brought up concerns. Should be easy to implement. |
I don't think we need a special command to edit a file; that's what editors are for. Documentation on what the scopes are, and where they are found (in case you want to edit them) is useful. The advent of Spack Environments removes need to pollute your home directory; and now the scopes are moved to within the environment. For those two reasons, I wouldn't mind seeing this Issue closed. |
It came up while documenting #2152 that Spack is inconsistent about which config scope is edited from command to command. Currently, the sort-of-inconsistently-implemented default behavior is to edit the highest-precedence available scope, which used to be
user
, but as of #2030 it's the platform-specific scope for the current platform (e.g.~/.spack/bgq/config.yaml
).I figure I should bounce this off of people before editing it. See if you think what I'm proposing below is reasonable.
Currently there are 11 commands that take a scope argument. I've labeled them as either "read" operations or "modify" operations. I think they should behave as follows:
Read operations:
spack config get
spack compilers / spack compiler list
spack mirror list
spack repo list
I think all of these should show merged results by default, and allow the user to select a specific scope with
--scope=<scope>
if they want to.Modify operations:
spack config edit
spack compiler add / spack compiler find
spack compiler remove
spack mirror add
spack mirror remove
spack repo add
spack repo remove
I think instead of taking the highest precedence scope (which among other things might change from spack version to spack version if we implement additional scopes), we should implement this policy:
default_edit_scope
option inconfig.yaml
, and out of the box it would be set to edit theuser
scope by default.<scope>
, commands should edit the generic<scope>
config by default, but it should edit an architecture-specific<scope>/<platform>
config if it exists. I think this is a) natural and b) prevents the user from getting confused if they, say, forgot they made a platform-specific config.spack compiler add/find
should modify the platform-specific scope by default.Does this policy seem reasonable? the other option would be to require a scope parameter for edit commands, but I think it's nice for users to be able to say, e.g.,
spack config edit
orspack repo add
without thinking about scopes.@alalazo @davydden @adamjstewart @citibeth
The text was updated successfully, but these errors were encountered: