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

Env vars are ignored when using GUI in macOS #10906

Closed
Andre0991 opened this issue Jun 16, 2018 · 76 comments
Closed

Env vars are ignored when using GUI in macOS #10906

Andre0991 opened this issue Jun 16, 2018 · 76 comments
Assignees
Labels

Comments

@Andre0991
Copy link
Contributor

Andre0991 commented Jun 16, 2018

When using GUI Emacs in macOS,(shell-command-to-string "env") displays my env vars defined in .bashrc, but not the ones in .bash_profile.

My config is here.

System Info 💻

  • OS: darwin
  • Emacs: 25.3.1
  • Spacemacs: 0.300.0
  • Spacemacs branch: develop (rev. 1abce5e)
  • Graphic display: t
  • Distribution: spacemacs
  • Editing style: hybrid
  • Completion: ivy
  • Layers:
(clojure common-lisp emacs-lisp erc git github html ivy javascript latex markdown org osx plantuml shell-scripts scala spacemacs-layouts syntax-checking themes-megapack theming version-control
         (shell :variables shell-default-shell 'eshell)
         (elfeed :variables rmh-elfeed-org-files
                 (list "~/Dropbox/backup/emacs/elfeed-feeds.org"))
         (c-c++ :variables c-c++-enable-clang-support t)
         (auto-completion :variables auto-completion-return-key-behavior 'complete auto-completion-tab-key-behavior 'cycle auto-completion-enable-help-tooltip nil auto-completion-enable-sort-by-usage t auto-completion-enable-snippets-in-popup nil :disabled-for latex)
         (spell-checking :variables spell-checking-enable-by-default nil enable-flyspell-auto-completion t)
         andre-common-lisp andre-elfeed andre-erc andre-eww andre-ivy nov)
  • System configuration features: JPEG RSVG IMAGEMAGICK NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS MODULES

Also, I use bash from Homebrew. My default shell is /usr/local/bin/bash (correct according to env).

Related to #10897.

@Andre0991
Copy link
Contributor Author

Other interesting thing to notice is that Homebrew added /usr/local/bin to /etc/paths, which ends up added to PATH, but Spacemacs is not picking it up, so I can't use Homebrew commands from Emacs.

@Andre0991
Copy link
Contributor Author

Andre0991 commented Jun 16, 2018

I just updated to the latest develop version (d3c594512d4e683edfa604053c424aa88c41b240), seems that even the vars from .bashrc are not being read.

What was happening is that I loaded a file that used exec-path-from-shell-copy-envs, so some of my vars were correctly when initialising it. As the vars seem to get cached, I didn't lose them when restarting Spacemacs with SPC q r. But I can confirm that it's not picking up any of my env vars.

@syl20bnr
Copy link
Owner

OSX layer was not responsible of importing env. vars, this was and still is done in spacemacs-bootstrap layer. We don't cache env. vars anymore, we fetch them all at startup time asynchronously.

Something prevents shell-command-to-string to work correctly in your environment. What is the value of shell-file-name ? What if you do M-! env RET ?

Could be Emacs 25 as well ? I'm on Emacs 26.

@Andre0991
Copy link
Contributor Author

shell-file-name looks correct:

shell-file-name is a variable defined in ‘C source code’.
Its value is "/usr/local/bin/bash"
Original value was "/bin/bash"

env is incomplete too.

Good point, I'll update to Emacs 26.

@Andre0991
Copy link
Contributor Author

Same issue with Emacs 26 :(

@anton-trunov
Copy link

I have the same issue. git bisect shows that 75f1d91 is what causes it.

@aaronjensen
Copy link
Contributor

For me, env vars in .bashrc are loaded for me, but not those in .bash_profile. This is fine for me as I just source my bashrc from bash_profile. macOS has rather weird semantics in that it tends to run a login shell for every terminal so we get used to putting this in bash_profile that should probably actually be in bashrc. Of course, you could argue that you should already have the things in bash_profile in your env...

@Andre0991
Copy link
Contributor Author

Andre0991 commented Jun 16, 2018

It's not getting vars from .bashrc here either, but it does pick up all vars if I start gui Emacs from terminal.

@Andre0991 Andre0991 changed the title Env vars from .bash_profile are ignored when using GUI in macOS Env vars are ignored when using GUI in macOS Jun 16, 2018
@fiveNinePlusR
Copy link
Contributor

are you exporting your variables? env doesn't pick up the changes unless you export them.

export PATH="/foo/bar/biz:$PATH"

if you do this in a shell:

env | grep test # prints nothing
TEST="test"
echo $TEST # prints test
env | grep test # prints nothing. 
export TEST
env | grep test # prints TEST=test

I just did a test and emacs opens up the shell as an interactive shell on mine(zsh though) but one common strategy for dotfiles is to have the non-interactive shell config set the path and then have the interactive one source the non-interactive one. I am not sure which type bash is calling.

you can test it by doing this in your bashrc and bash_profile

if [ -z "$PS1" ]; then
    export TEST="non interactive"
else
    export TEST="interactive"
fi

and then testing inside ielm or m-: with (getenv "TEST")

@Andre0991
Copy link
Contributor Author

Yes, I'm exporting them.

I just tested the snippet you posted. I put it in my .bashrc.

(getenv "TEST") returns interactive , as expected, when Emacs is started from terminal.
(getenv "TEST") returns nil when Emacs is started from its icon.

How can I debug that?

@fiveNinePlusR
Copy link
Contributor

where did you put that snippet? i would put it inside whatever the opposite file is and that is where you need to source the other file.

@Compro-Prasad
Copy link
Contributor

Compro-Prasad commented Jun 17, 2018

What do you mean by opposite file? .bash_profile?

@AlexArrufat
Copy link
Contributor

AlexArrufat commented Jun 17, 2018

A quick solution for Zsh users. Create/open your ~/.zshenv file and write source ~/.zshrc. With this you will have the same config you have for interactive and non-interactive shells.

Following a better practice, I tend to put env-vars / initializers in ´~/.zshenv´ and the ones suited for an interactive shells in ~/.zshrc. I don't have issues in any apps with this approach.

@fiveNinePlusR
Copy link
Contributor

What do you mean by opposite file? .bash_profile?

the interactive vs non-interactive file. i think it's .bashrc

@Andre0991
Copy link
Contributor Author

Andre0991 commented Jun 17, 2018

@fiveNinePlusR I used .bashrc in my previous test.
Putting it in .bash_profile doesn't help either, but I think this is expected in macOS (unless exec-path-from-shell is used).

@aaronjensen, are you using d12frosted/emacs-plus/emacs-plus from Homebrew?

To sum it up, the problem seems to be starting Emacs from GUI. It doesn't pick even bashrc in my case. Might be related to #3268.

@aaronjensen
Copy link
Contributor

@aaronjensen, are you using d12frosted/emacs-plus/emacs-plus from Homebrew?

Yes, with --HEAD though.

@Andre0991
Copy link
Contributor Author

@aaronjensen, are you starting Emacs from terminal?

@aaronjensen
Copy link
Contributor

@Andre0991 no

@chriskaukis
Copy link
Contributor

I started getting this issue also today after updating. I was using Emacs Plus version, but also have the Emacs Mac versions installed. I usually use Emacs Plus because I like the sexier title bar. However, out of curiosity I tried Emacs Mac and I don't get the problem.

Summary: Problem occurs in Emacs Plus started from GUI, but not from command line. Emacs Mac seems to work regardless.

@mkleehammer
Copy link

I'm seeing this now with the Emacs Mac version from https://emacsformacosx.com

It may be intermittent. I can't get it to work now, but was pretty sure it did a couple of times. Someone mentioned "asynchronously" earlier - is it possible it is a timing issue and things are initializing before it completes?

@agzam
Copy link
Contributor

agzam commented Jun 20, 2018

as a lame workaround I'm doing this for now:

  • add exec-path-from-shell to additional-pacakages
  • set exec-path-from-shell-variables in user-init
  • then manually call exec-path-from-shell-initialize (otherwise it doesn't work for me)

@mkleehammer
Copy link

I added (spacemacs/loadenv) to the bottom dotspacemacs/user-config and it seems to work. I don't see how since it is called last, but I wanted to work my way "backwards" in testing and it immediately started working.

@anton-trunov
Copy link

@mkleehammer Thanks for sharing!

Unfortunately, it didn't work for me since some of my layers rely on external utilities (e.g. ocaml layer relies on opam and merlin executables). So, instead I tried adding (spacemacs/loadenv) to dotspacemacs/user-init but I keep getting

(Spacemacs) Error in dotspacemacs/user-init: Symbol’s function definition is void: spacemacs/loadenv

So my workaround is cd ~/.emacs.d; git checkout d01658ec6.

@syl20bnr
Copy link
Owner

@anton-trunov can you test with a quick patch of the spacemacs code there ?

https://github.com/syl20bnr/spacemacs/blob/develop/layers/+distributions/spacemacs-bootstrap/funcs.el#L26-L27

Replace the if expression with:

      (let ((shell-command-switch "-ic"))
        (if dotspacemacs-import-env-vars-shell-file-name
            (let ((shell-file-name
                   dotspacemacs-import-env-vars-shell-file-name))
              (split-string (shell-command-to-string "env") "\n"))
          (split-string (shell-command-to-string "env") "\n"))))

the idea is to pass -i when invoking the shell.

@syl20bnr
Copy link
Owner

@anton-trunov you can try by just evaluating the code above, no need to patch the code I believe. What does the let bindings above returns for you ?

@anton-trunov
Copy link

@syl20bnr Thanks a bunch for looking into this issue! It's much appreciated. I'm working on a layer for the Lean theorem prover and looking forward to be able to contribute back to the Spacemacs community.

Here is the output for M-x eval-expression before applying the patch on current develop branch (6b4a79d):

("PWD=/Users/anton" "RUST_SRC_PATH=/Users/anton/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/src" "PKG_CONFIG_PATH=/usr/local/opt/libffi/lib/pkgconfig:/usr/local/opt/libffi/lib/pkgconfig:" "OLDPWD=/Users/anton" "SHLVL=0" "DISPLAY=192.168.1.132" "TERM=xterm-256color" "LANG=ru_RU.UTF-8" "XPC_FLAGS=0x0" "USER=anton" "XPC_SERVICE_NAME=org.gnu.Emacs.17160" "LOGNAME=anton" "PATH=/Users/anton/.opam/coq.8.8.0/bin:/usr/local/smlnj/bin:/usr/local/opt/coreutils/libexec/gnubin:/Users/anton/.cargo/bin/:/Users/anton/prj/coq/coq-bench:/Users/anton/prj/coq/coq-tools:/Users/anton/.cabal/bin:/Users/anton/.local/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/Users/anton/.cargo/bin/:/Users/anton/prj/coq/coq-bench:/Users/anton/prj/coq/coq-tools:/Users/anton/.cabal/bin:/Users/anton/.local/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/opt/fzf/bin" "SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.r8O0BAPgJi/Listeners" "Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.YaTy1pYZJi/Render" "HOME=/Users/anton" "SHELL=/bin/zsh" "__CF_USER_TEXT_ENCODING=0x1F6:0x0:0x0" "TMPDIR=/var/folders/6c/_7dzfcbd5q30wyqhppf7gf800000gp/T/" "LC_ALL=ru_RU.UTF-8" "ZSH=/Users/anton/.oh-my-zsh" "PAGER=less" "LESS=-R" "LSCOLORS=Gxfxcxdxbxegedabagacad" "OCAML_TOPLEVEL_PATH=/Users/anton/.opam/coq.8.8.0/lib/toplevel" "PERL5LIB=/Users/anton/.opam/coq.8.8.0/lib/perl5:" "MANPATH=:/Users/anton/.opam/coq.8.8.0/man" "OPAMUTF8MSGS=1" "CAML_LD_LIBRARY_PATH=/Users/anton/.opam/coq.8.8.0/lib/stublibs" "_=/usr/local/opt/coreutils/libexec/gnubin/env" "")

Alas, applying the patch it didn't work. Here is the log in `Messages:

Loading /Users/anton/.spacemacs...done
(Spacemacs) Warning: Cannot find "opam" or "merlin" executable. The ocaml layer won't work properly.
Starting new Ispell process ispell with default dictionary...
Error enabling Flyspell mode:
(Searching for program No such file or directory ispell)
Spacemacs is ready.
Starting new Ispell process ispell with default dictionary...
Error enabling Flyspell mode:
(Searching for program No such file or directory ispell)
Loading /Users/anton/.emacs.d/.cache/recentf...done
Skipping check for new version (reason: dotfile)
.emacs.d/layers/+spacemacs/spacemacs-purpose/local/spacemacs-purpose-popwin/spacemacs-purpose-popwin.el: Obsolete name arg "pupo" to constructor purpose-conf

The opam and merlin are in PATH (and ispell is too):

$ which opam
/usr/local/bin/opam
$ which ocamlmerlin
/Users/anton/.opam/coq.8.8.0/bin/ocamlmerlin

Just in case, here is the diff for your patch that I applied:

-      (if dotspacemacs-import-env-vars-shell-file-name
-          (let ((shell-file-name
-                 dotspacemacs-import-env-vars-shell-file-name))
-            (split-string (shell-command-to-string "env") "\n"))
-        (split-string (shell-command-to-string "env") "\n")))
+      (let ((shell-command-switch "-ic"))
+        (if dotspacemacs-import-env-vars-shell-file-name
+            (let ((shell-file-name
+                   dotspacemacs-import-env-vars-shell-file-name))
+              (split-string (shell-command-to-string "env") "\n"))
+          (split-string (shell-command-to-string "env") "\n"))))

@syl20bnr syl20bnr reopened this Jul 5, 2018
@syl20bnr
Copy link
Owner

syl20bnr commented Jul 5, 2018

Oops, missclick.

Explanation: on my system (macOS, no change whatsoever in config, vanilla macOS) -ilc only source profile files and not .bashrc, .bashrc is sourced in an interactive non-login shell only. Reference: man bash.

@Blaisorblade
Copy link
Contributor

@syl20bnr Fair enough — if your install is indeed vanilla, it should certainly be supported. I'm aware of this bash annoyance, but I thought all modern systems work around it — apparently vanilla Mac doesn't do this enough.

Usually, they put code in ~/.profile or ~/.bash_profile to source ~/.bashrc to workaround that bash misbehavior — and /etc/profile sources /etc/bashrc (at least that's still true on my Mac and should be vanilla).

@syl20bnr
Copy link
Owner

syl20bnr commented Jul 5, 2018 via email

@mkleehammer
Copy link

@syl20bnr I appreciate the hard work on this. I could use some clarification on how it is expected to work:

It now generates two PATH entries in the env file. I wasn't sure if that is what you were referring to in your previous comment:

Hopefully this should remain clean as we remove duplicates from the file so it is not an issue if we source the same file multiple times.

Both PATH entries are added to the exec-path so I assume this was by design. I'm asking because I notice it generates a bunch of duplicate entries in exec-path. These are harmless but I wasn't sure if that was expected.

Thanks again for working on all of this.

@Blaisorblade
Copy link
Contributor

@syl20bnr I hadn't noticed at first, but based on @mkleehammer and @roryk's comments (on 7c9f612), it seems that if you get different definitions for the same variable, behavior gets tricky. Arguably, Spacemacs should ask users to fix the result if there's any duplicate, or any line that doesn't look like KEY=value (say, fortune entries as in 7c9f612, errors because there's no terminal, etc.)?

IIUC, the user is supposed to remove such duplicate-but-not-really entries by hand — the point of the approach is that Spacemacs can't generate this file robustly, so it just does a best effort and you're supposed to clean up the result by hand.

Details below

@mkleehammer Not sure such dups are harmless in general, as @roryk noticed on 7c9f612. Usually, if there are conflicting definitions, one overrides the other; since PATH and exec-path are special, having

PATH=a
PATH=b

doesn't really mean that the second entry replaces the first (as for all other vars), but some unspecified mixture.

So does PATH in the loaded environment match exec-path? From the code I'm not sure (I looked at https://github.com/syl20bnr/spacemacs/blob/7c9f612c4f4a1eda7c8a11194ff2bce21ca53ca0/core/libs/load-env-vars.el and 7c9f612), and Emacs docs suggest this configuration is not well supported.

Worse, it's not clear which entry takes precedence, it depends on the alphabetic order. So, you could get

PATH=/usr/bin:/bin
PATH=/usr/local/bin:/usr/bin:/bin

or

PATH=/opt:/usr/bin:/bin
PATH=/usr/bin:/bin

and depending on how entries are added, it seems /usr/local/bin might be added after /usr/bin, so priority would change. Many put programs in /usr/local/bin to shadow those in /usr/bin, but such program shadowing would fail with PATH=/usr/bin:/bin:/usr/local/bin:/usr/bin:/bin.

For extra fun, that means that emacs would struggle running itself through emacsclient for users installing a non-system emacs in /usr/local, as recommended for OS X — this would risk picking the system's emacsclient. Why would emacs call emacsclient? Well, it could call some program (say, git commit) that calls emacsclient — possibly, the wrong emacsclient, which IME won't connect to the new Emacs.
Did I mention all this is really subtle? Good luck with the effort!

Blaisorblade referenced this issue Jul 5, 2018
Since bash will source different files depending on its mode, for instance
login vs. non-login shells, we fetch the env vars from both a login shell and
an interactive non-login shell. We try to cleanup the resulting file by removing
duplicates, sorting env vars etc...
@syl20bnr
Copy link
Owner

syl20bnr commented Jul 5, 2018 via email

@Blaisorblade
Copy link
Contributor

@syl20bnr Double-checked it now, it does document the behavior, I'd still prefer a more robust variant where Spacemacs complains till the file has nothing odd going on, rather than trying to do something good with it. But maybe users prefer trying to make sense of whatever's there, even though it's unreliable, so we'll see what they do.

@syl20bnr
Copy link
Owner

syl20bnr commented Jul 5, 2018

This is a good idea, we can certainly add a persistent warning at startup when duplicates are found (except PATH).

@Blaisorblade
Copy link
Contributor

Blaisorblade commented Jul 5, 2018

Tldr: as mentioned, merging PATH can give a wrong one, so you want a warning there too.

What’s more, I expect one of the two is the correct one, and the other adds no info, so you only want the user pick the right one. When you start a terminal, you got the right PATH there, but the terminal launched either a login or a non-login shell (but always an interactive one).* Hence, if the PATHs are different one is wrong, and merging them can give a wrong PATH. This reasoning is not completely foolproof, but seems robust enough for a default warning till you fix your environment.

EDIT: @Radious reports systems consistent with my predictions at 7c9f612#commitcomment-29623471.

@Andre0991
Copy link
Contributor Author

Andre0991 commented Jul 9, 2018

Is anyone getting weird results when sourcing files that define functions?

Example:

In bashrc:

source $HOME/foo.sh

In foo:

function bar {
  local from=${1:-50000}
  local to=$(($from + 500))
  for i in $(seq ${from} ${to})
  do
    if ! docker ps | grep -q ":$i->$i/tcp"; then
      echo $i;
      return 0;
    fi
  done
  return 1
}

Parts of this function is present in my .spacemacs.env.

Let me know if my description not enough for reproducing this. My setup is a bit more complicated than that.

@Roanmh
Copy link

Roanmh commented Jul 10, 2018

Hello, this thread has been extremely useful in debugging my issues with exec-path. While doing so, I have noticed a behavior goes along with the subtleties that @Blaisorblade and @mkleehammer have been talking about: I believe that at some point my exec-path was set such that paths like '/usr/bin' were the first elements. This caused my changes in my .spacemacs.env to behave unexpectedly. Even when I verified that PATH was correct (I also edited it into a single variable) in my .spacemacs.env, exec-path was not reflecting the order of the .spacemacs.env PATH variable. With further exploration, I cleared the value of exec-path before rerunning dotspacemacs/user-env. This worked, producing an exec-path that matched the .spacemacs.env PATH variable. While I am not sure that clearing exec-path is a best practice, perhaps this subtlety warrants a note in .spacemacs.env or the documentation to help users troubleshoot this issue, especially if this is found to be a more common state.

Thanks, all, for your help. I'm sorry I can't offer more insight as to how my 'exec-path' got to messed up, but I will post it if I figure it out.

@Blaisorblade
Copy link
Contributor

@Roanmh Uh, what you did sounds like the correct fix and something Spacemacs should do by default! Thanks for the report!

It's extremely unlikely that clearing exec-path would be bad for any user: the cleared entries would have to be missing from the sourced PATHs (which is usually a misconfiguration), and those can always edit .spacemacs.env to have all the needed entries (as it's supposed to have), and probably fix their config.

Analysis: When Emacs starts it gets some PATH (which for you has /usr/bin first), and then it copies that into exec-path — Emacs documentation demands they're in sync and Spacemacs should keep them as such, but Spacemacs apparently was resetting only PATH but not exec-path, and IIRC Spacemacs appends entries from .spacemacs.env to the exec-path.

So yes, that's similar to what I sketched above, but I missed this even though it's probably going to be even simpler to trigger!

@Blaisorblade
Copy link
Contributor

I guess this issue can be closed by now?

CodingSolo pushed a commit to CodingSolo/spacemacs that referenced this issue Oct 29, 2018
@edburyenegren-okta
Copy link

This seems like the most related issue for some additional info.

When attempting to use scss-stylelint as my checker in GUI, I get the error node: No such file or directory [env]. Naturally, I thought, "my paths aren't being picked up correctly because of nvm"

A list of "howevers":

  • The output of flycheck-verify-setup returns an all clear:
  scss-lint (disabled)
    - may enable:         Automatically disabled!
    - executable:         Not found
    - configuration file: Found at "/Users/edbury/.scss-lint.yml"

  scss-stylelint
    - may enable:         yes
    - executable:         Found at /Users/edbury/.nvm/versions/node/v8.11.1/bin/stylelint
    - configuration file: Found at "/Users/edbury/some/path/.stylelintrc.json"

  sass/scss-sass-lint
    - may enable:         Automatically disabled!
    - executable:         Not found
    - configuration file: Not found

  scss
    - may enable: Automatically disabled!
    - executable: Not found

Flycheck Mode is enabled. Use SPC u C-c ! x to enable disabled checkers.

--------------------

Flycheck version: 32snapshot (package: 20190213.1525)
Emacs version:    26.1
System:           x86_64-apple-darwin17.5.0
Window system:    ns
  • This only happens in the GUI application. Running emacs in -nw resolves the issue; however, in GUI, running M-: (executable-find "node") does return the correct path (which matches flycheck-verify-setup).

  • Even using flycheck-set-checker-executable, the binary can be located and set successfully, but the GUI app still returns the "not found" error.

  • the nvm path shows in exec-path. Clearly, flycheck is able to locate the executable, so something else is going on between there and the actual linting being done.

@SuperMMX
Copy link

SuperMMX commented Nov 2, 2019

I got exactly the same issue as @edburyenegren-okta mentioned above, but my case if for tslint and I am running Linux with latest trunk Emacs and latest trunk Spacemacs.

The error message is

Wrote /media/Misc/Projects/SuperMMX/divitcm-core/src/main/DiviTCM.ts
Suspicious state from syntax checker typescript-tslint: Flycheck checker typescript-tslint returned non-zero exit code 127, but its output contained no errors: /usr/bin/env: ‘node’: No such file or directory

Try installing a more recent version of typescript-tslint, and please open a bug report if the issue persists in the latest release. Thanks!

The flycheck-verify-setup result is

Syntax checkers for buffer DiviTCM.ts in typescript-mode:

First checker to run:

typescript-tslint
- may enable: yes
- executable: Found at /media/Misc/Software/node/bin/tslint
- configuration file: Found at "/media/Misc/Projects/SuperMMX/divitcm-core/tslint.json"

Checkers that are compatible with this mode, but will not run until properly configured:

javascript-eslint (disabled)
- may enable: Automatically disabled!
- executable: Not found
- config file: missing or incorrect

Flycheck Mode is enabled. Use SPC u C-c ! x to enable disabled checkers.


Flycheck version: 32snapshot (package: 20191028.2247)
Emacs version: 27.0.50
System: x86_64-pc-linux-gnu
Window system: x

@SuperMMX
Copy link

SuperMMX commented Nov 2, 2019

I figured about why, there are two PATH entries in my .spacemacs.env, the commented out the first one and it works.

Same solution in this ticket: #12396 (comment)

@bigfish
Copy link

bigfish commented Dec 12, 2019

I spent a bunch of time trying to figure this out until I realized that spacemacs had created a ~/.spacemacs.env which was missing most of my env vars. I ran 'env' in my terminal which had everything setup properly, and replaced my .spacemacs.env with it. Then everything worked. I didn't know about .spacemacs.env... It is documented here: https://develop.spacemacs.org/doc/DOCUMENTATION.html#default-behavior

@yurighensev
Copy link

@bigfish thanks for that, what solved for me was removing .spacemacs.env altogher, and letting spacemacs recreate it. I received this warning upon starting it:

Warnings:
- Spacemacs has imported your environment variables from your shell and saved them
to /home/yuri/.spacemacs.env'. Open this file for more info (SPC f e e) or call spacemacs/edit-env' function.

I suspect that the first time I started spacemacs I still hadn't moved from bash, then it copied in the wrong envs.

@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 Oct 17, 2021
@lebensterben lebensterben removed the stale marked as a stale issue/pr (usually by a bot) label Jan 22, 2022
@lebensterben lebensterben self-assigned this Jan 22, 2022
Copy link

github-actions bot commented May 1, 2024

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 May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests