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

Paths processing on Cygwin environment #2556

Open
genmeblog opened this Issue Jan 3, 2019 · 1 comment

Comments

Projects
None yet
1 participant
@genmeblog
Copy link

genmeblog commented Jan 3, 2019

Expected behavior

This bug is connected to the #2538 but after a little bit of debug I (probably) found the main reason for my case.

CIDER/nREPL should work on Cygwin or other mixed environment with mixed path conventions (Windows vs Unix).
It wasn't a problem till current version (0.19.0)

Actual behavior

After switching to sesman it looks like conversion between cygwin paths and window paths are missed.
This also can be general issue in other cases where paths are processed jointly by nREPL and Cider.

Emacs and Cygwin are using unix-like paths ie. /home/user/file etc. JVM and nrepl are using Windows paths. So, because of that this line fails: https://github.com/clojure-emacs/cider/blob/v0.19.0/cider-connection.el#L438
file-name-directory expects unix-like-path but classpath is filled by Windows paths

Cygwin version of Emacs has two functions cygwin-convert-file-name-to-windows and cygwin-convert-file-name-from-windows. The former is already wrapped in Cider (cider-to-nrepl-filename-function in cider-eval.el)

Steps to reproduce the problem

Reproducing is similar to #2538
Under Cygwin

  1. run lein repl
  2. run Emacs
  3. open any clj file from the project
  4. cider-connect
  5. open any clj file from different project (even opening ~/.lein/profiles.clj causes a problem)
  6. try to evaluate anything from your project (constantly calls sesman-friendly-session-p and fails)

Environment & Version information

CIDER version information

;; CIDER 0.20.0snapshot (package: 20190102.812), nREPL 0.5.3
;; Clojure 1.10.0, Java 1.8.0_66

Lein/Boot version

Leiningen 2.8.3 on Java 1.8.0_66 Java HotSpot(TM) 64-Bit Server VM

Emacs version

GNU Emacs 26.1 (build 1, x86_64-unknown-cygwin, GTK+ Version 3.22.28) of 2018-05-28

Operating system

Windows 10, Cygwin

@genmeblog

This comment has been minimized.

Copy link
Author

genmeblog commented Feb 27, 2019

I use following workaround to have it working. In function sesman-friendly-session-p I replace

(mapcar #'file-name-directory)

with

(mapcar #'cygwin-convert-file-name-from-windows)
(mapcar #'file-name-directory)
(mapcar #'cygwin-convert-file-name-to-windows)

This is of course not desired solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.