Skip to content
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

Closed
timor opened this issue Oct 26, 2018 · 5 comments
Closed
Labels
- Mailling list - stale marked as a stale issue/pr (usually by a bot)

Comments

@timor
Copy link
Contributor

timor commented Oct 26, 2018

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.

@timor
Copy link
Contributor Author

timor commented Oct 26, 2018

cc @spacefrogg

@dlurton
Copy link

dlurton commented Nov 19, 2018

+1

I just setup opam and the ocaml layer which involved some adjustments to my PATH and other environment variables and then subsequently wasted the last 3 hours of my life trying to figure out why it wasn't able to find ocamlbuild in PATH despite everything. I finally found this issue, deleted .spacemacs.env and tried again to find the problem solved. Looks like .spacemacs.env was last updated before I installed opam. :(

@timor timor changed the title Less aggressive environment variable caching per default Less aggressive environment variable caching per default (better none at all) Nov 25, 2018
timor pushed a commit to timor/spacemacs that referenced this issue Jan 26, 2019
timor pushed a commit to timor/spacemacs that referenced this issue Jan 26, 2019
timor added a commit to timor/spacemacs that referenced this issue Feb 20, 2019
timor added a commit to timor/spacemacs that referenced this issue Oct 21, 2019
timor added a commit to timor/spacemacs that referenced this issue Jan 3, 2020
timor added a commit to timor/spacemacs that referenced this issue Jan 10, 2020
@github-actions
Copy link

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!

@github-actions github-actions bot added the stale marked as a stale issue/pr (usually by a bot) label Feb 28, 2020
@timor
Copy link
Contributor Author

timor commented Feb 28, 2020

For what it's worth, I think the default behavior of Spacemacs here is still problematic.

@duianto duianto removed the stale marked as a stale issue/pr (usually by a bot) label Mar 8, 2020
timor added a commit to timor/spacemacs that referenced this issue Jun 10, 2020
timor added a commit to timor/spacemacs that referenced this issue Jun 25, 2020
timor added a commit to timor/spacemacs that referenced this issue Nov 26, 2020
@github-actions
Copy link

github-actions bot commented Mar 8, 2021

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!

@github-actions github-actions bot added the stale marked as a stale issue/pr (usually by a bot) label Mar 8, 2021
timor added a commit to timor/spacemacs that referenced this issue Mar 18, 2021
timor added a commit to timor/spacemacs that referenced this issue Mar 28, 2021
timor added a commit to timor/spacemacs that referenced this issue Jul 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- Mailling list - stale marked as a stale issue/pr (usually by a bot)
Projects
None yet
Development

No branches or pull requests

4 participants