-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Less aggressive environment variable caching per default (better none at all) #11510
Comments
cc @spacefrogg |
+1 I just setup |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid! |
For what it's worth, I think the default behavior of Spacemacs here is still problematic. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid! |
6220ace introduced support for generating and loading
spacemacs.env
to have stable environments.As far as I can tell from e.g. #10906, one of the main purposes of this was to make sure
$PATH
looks correct on all OSes.On networked systems, where users have a central home directory, but machines do their specific environment setup, and on systems where environment variables change frequently (e.g. NixOS), this is very problematic and can introduce unexpected behavior in a very subtle and hard-to-debug way.
From the documentation I can read that this behavior can be disabled by commenting out a call in a function the
.spacemacs
file. However, the default behavior after upgrading spacemacs but not updating the.spacemacs
file to the new template, is to load that file anyways. (a013d86#diff-6104ae45148ccdd2fc150ad8aa59ab80R150). This results in spacemacs loading an env file (e.g. if it has been created from another machine), and loading variables (e.g. SHELL) which do not make sense for the present system.However, in my opinion that is only a symptom for a bigger issue:
It is not the responsibility of an application, but of whatever is calling the application, to make sure it is called with the correct environment. The previous behavior, where it was loaded ad hoc never created a problem there, and I didn't know it did this (which I should not have to know as user), but it did not introduce this kind of problems. Caching everything by default introduces state where there should be no state.
For the systems which don't set up PATH correctly, (and I assume the majority of linux systems does it correctly), I think the solution should be on the level of wrapping the call to spacemacs correctly, rather than trying to fix that from within the application. As for caching, I think that introduces more problems than it can solve.
Please feel free to correct me if my assumptions about this change are wrong.
The text was updated successfully, but these errors were encountered: