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

"No such file or directory, bash.exe: warning: could not find /tmp, please create!" when I start emacs #14407

Closed
ShapelessCat opened this issue Feb 21, 2021 · 17 comments

Comments

@ShapelessCat
Copy link

ShapelessCat commented Feb 21, 2021

Description :octocat:

When I start my emacs in Windows 10, I see "1 error(s) at startup! spacemacs may not be able to operate properly." and

(Spacemacs) Error in dotspacemacs/user-config: Searching for program: No such file or directory, bash.exe: warning: could not find /tmp, please create!

I think it has been showing up since last week.

Reproduction guide 🪲

  • Start Emacs

Observed behaviour: 👀 💔

Loading c:/Users/LanJ/.spacemacs...done
Spacemacs is ready.
(Spacemacs) Error in dotspacemacs/user-config: Searching for program: No such file or directory, bash.exe: warning: could not find /tmp, please create!

Loading c:/Users/LanJ/.emacs.d/.cache/recentf...done
Skipping check for new version (reason: dotfile)
Package cl is deprecated
Error running timer ‘global-git-gutter+-mode’: (file-missing "Searching for program" "No such file or directory" "bash.exe: warning: could not find /tmp, please create!")

Expected behaviour: ❤️ 😄
No error message

System Info 💻

  • OS: windows-nt
  • Emacs: 27.1
  • Spacemacs: 0.300.0
  • Spacemacs branch: develop (rev. 9ecce82)
  • Graphic display: t
  • Distribution: spacemacs
  • Editing style: vim
  • Completion: helm
  • Layers:
(better-defaults emacs-lisp git helm lsp markdown multiple-cursors org version-control treemacs python java windows-scripts
                 (scala :variable scala-backend 'scala-metals)
                 rust racket erlang elixir)
  • System configuration features: XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY W32NOTIFY ACL GNUTLS LIBXML2 HARFBUZZ ZLIB TOOLKIT_SCROLL_BARS MODULES THREADS JSON PDUMPER LCMS2 GMP

Backtrace 🐾

<<BACKTRACE IF RELEVANT>>
@alexey0308
Copy link

@ShapelessCat Does creation of the /tmp directory help? like in answers here?

@lebensterben
Copy link
Collaborator

@alexey0308
This is either an upstream bug, or the error message is not precise, because Windows system doesn't have /tmp directory.

@alexey0308
Copy link

@lebensterben https://gitforwindows.org/requirements.html

Parts of Git are implemented in shell script, and Git for Windows runs those scripts via MSYS2's POSIX emulation layer, which in turn is based on the Cygwin POSIX emulation layer.

I do not know, where it actually mounts /tmp in the end, but the link posted is for Windows.

@lebensterben
Copy link
Collaborator

Does our auto-generated system info distinguish WSL from Windows?
It seems to me WSL is getting wider adoption that many issues are more or less caused by it.

@alexey0308
Copy link

@lebensterben WSL is virtualization. I suppose, one would see 'gnu/linux' in system-type there (?).

Here it is native Windows compilation of Emacs, but the first link I attached is about Git installation, not Emacs.

@ShapelessCat
Copy link
Author

@ShapelessCat Does creation of the /tmp directory help? like in answers here?

I tried it even before creating this issue, and it doesn't work.

@alexey0308
Copy link

Are you able to clone anything from github using your git on your machine? Just to document it, if it is actually relevant to Emacs at all?

@ShapelessCat
Copy link
Author

Are you able to clone anything from github using your git on your machine? Just to document it, if it is actually relevant to Emacs at all?

My git works well.

@TradDog
Copy link

TradDog commented Feb 26, 2021

I can confirm I have the same issue.

Trad.

@alexey0308
Copy link

alexey0308 commented Feb 26, 2021

@TradDog it can also be then path problem: Emacs is not able to find executable, because it misses the directory in the PATH environment variable (which also can be modified in the .spacemacs.env file, SPS e e)

Can you confirm, that M-: (executable-find "bash.exe") outputs nil for you?

@ShapelessCat @TradDog It might be the path reason, see @duianto comment, namely about keeping .emacs.d under AppData\Roaming\ path or adding the HOME variable.

UPD I was wrong about the path, @duianto comment was actually about HOME on Windows.

In the Emacs docs

The Windows equivalent of HOME is the user-specific application data directory. The actual location depends on the Windows version; typical values are C:\Documents and Settings\username\Application Data on Windows 2000 up to XP, C:\Users\username\AppData\Roaming on Windows Vista and later,

So one should either install under C:\Users\username\AppData\Roaming or set HOME variable accordingly.

@duianto
Copy link
Collaborator

duianto commented Feb 26, 2021

I'm not seeing the error message.

For me (executable-find "bash.exe") returns:

"c:/tools/cygwin/bin/bash.exe"

Cygwin was downloaded from: https://www.cygwin.com/

Windows 10, System Info (Click to expand)
#### System Info :computer:
- OS: windows-nt
- Emacs: 27.1
- Spacemacs: 0.300.0
- Spacemacs branch: develop (rev. 54e3cc572)
- Graphic display: t
- Distribution: spacemacs
- Editing style: vim
- Completion: helm
- Layers:
```elisp
(auto-completion autohotkey emacs-lisp git helm html markdown multiple-cursors
                 (org :variables org-agenda-files
                      '("c:/Users/username/org/"))
                 shell spell-checking syntax-checking treemacs version-control)
```
- System configuration features: XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY W32NOTIFY ACL GNUTLS LIBXML2 HARFBUZZ ZLIB TOOLKIT_SCROLL_BARS MODULES THREADS JSON PDUMPER LCMS2 GMP

@ShapelessCat
Copy link
Author

ShapelessCat commented Feb 27, 2021

@duianto
Run (executable-find "bash.exe"), and I get C:\Users\username\Programs\cmder\vendor\git-for-windows\bin\bash.exe.

@alexey0308 @duianto
When using HOME equals "C:/Users/username", I can't find a way to make it work.

When stopping setting HOME manually in system environment, and move spacemacs configuration files to C:\Users\username\AppData\Roaming, I still can see the same error. Then I tried to comment version-control out from the dotspacemacs-configuration-layers to remove the package git-gutter+, and then uncomment version-control and reinstall git-gutter+. After then, it works.

Since I see errors when using both settings and I can only resolve that issue in the second setting (for the first setting, I did similar things, but it didn't work), I'm still not clear about WHY. Anyway, at the end it works. Hi @TradDog, you can try what I did.

Thanks! @alexey0308 @duianto

I'll keep this issue open for several days to see if someone else has the same issue, and they know exactly why.

@alexey0308
Copy link

Hi @ShapelessCat ,

after moving under AppData\Roaming, is the output of executable-find changed?

@lebensterben
Copy link
Collaborator

reinstalling a package to fix the problem sounds weird to me...

how did git-gutter+ mess with bash.exe in the first place?

@TradDog
Copy link

TradDog commented Feb 27, 2021

@ShapelessCat Then I tried to comment version-control out from the dotspacemacs-configuration-layers
Hi,

nice trick ShapelessCat. Commenting version-control got rid of the error.

To get the version-control layer to work again, it may have just been a question
of uncommenting again and trigger re-install as you suggest.

Now, for full disclosure, I had git intalled through cmder
(https://cmder.net/) in $CMDERROOT/vendor/git-for-windows
I had installed a tmp in all directories I could think of:

  • $CMDERROOT/vendor/git-for-windows which seems to be the root ("/") in CMDER
  • ~/tmp
    I noticed the mingw64 under $CMDERROOT/vendor/git-for-windows where I also
    installed a tmp for good measure.

At any rate thanks for the tip. That worked for me.

Trad

@ShapelessCat
Copy link
Author

ShapelessCat commented Mar 1, 2021

Hi @ShapelessCat ,

after moving under AppData\Roaming, is the output of executable-find changed?

@alexey0308 No change.

@ShapelessCat
Copy link
Author

ShapelessCat commented Mar 1, 2021

reinstalling a package to fix the problem sounds weird to me...

how did git-gutter+ mess with bash.exe in the first place?

Hi @lebensterben,
For me, it's sounds weird, too. However, this kind of issues happened several time when I tried to use spacemacs in different computers. Though, not all issues are exactly like the one at this time, reinstall some packages helped me resolving some issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants