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

Not compatible with Cygwin? #30

Closed
dmos62 opened this issue Dec 8, 2014 · 21 comments
Closed

Not compatible with Cygwin? #30

dmos62 opened this issue Dec 8, 2014 · 21 comments

Comments

@dmos62
Copy link

dmos62 commented Dec 8, 2014

Can't seem to get it running under Cygwin. I shall try and illustrate by copy pasting commands from mintty:

$ ls -l boot.sh
-rwxr-xr-x+ 1 Domas None 7012598 Dec  7 21:23 boot.sh

$ boot.sh
Error: Unable to access jarfile /home/Domas/bin/boot.sh

$ java -jar boot.sh -V
#https://github.com/boot-clj/boot
#Mon Dec 08 10:27:04 EET 2014
BOOT_CLOJURE_VERSION=1.6.0
BOOT_VERSION=2.0.0-pre28

Now here comes the crash (?). I will run the repl, but it will not respond to any input, I will ultimately Ctrl-c:

Domas@DomoHP-Win81 ~/bin
$ java -jar boot.sh repl
nREPL server listening: 0.0.0.0:49542
REPL-y 0.3.4, nREPL 0.2.4
Clojure 1.6.0
Java HotSpot(TM) 64-Bit Server VM 1.7.0_71-b14
        Exit: Control+D or (exit) or (quit)
    Commands: (user/help)
        Docs: (doc function-name-here)
              (find-doc "part-of-name-here")
Find by Name: (find-name "part-of-name-here")
      Source: (source function-name-here)
     Javadoc: (javadoc java-object-or-class-here)
    Examples from clojuredocs.org: [clojuredocs or cdoc]
              (user/clojuredocs name-here)
              (user/clojuredocs "ns-here" "name-here")
boot.user=> (+ 2 2)

$ (+ 2 2)
-bash: +: command not found

Some additional information below. Notably I am using a Windows Java installation, which has not caused problems running sbt or leiningen by the way.

$ java -version
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

$ javac -version
javac 1.7.0_71

$ which java
/cygdrive/c/Program Files/Java/jdk1.7.0_71/bin/java

$ which javac
/cygdrive/c/Program Files/Java/jdk1.7.0_71/bin/javac

$ echo $TERM
xterm-256color
@micha
Copy link
Contributor

micha commented Dec 8, 2014

Did you try the boot.exe windows executable instead of the boot.sh unix one?

@dmos62
Copy link
Author

dmos62 commented Dec 9, 2014

Running boot.exe repl in the Windows Command Prompt works, though some characters are badly displayed. Running boot.exe repl in Cygwin gives same results as boot.sh repl. It prompts for input, but does not respond.

@micha
Copy link
Contributor

micha commented Dec 10, 2014

@dmos62 What is your system's locale set to?

@dmos62
Copy link
Author

dmos62 commented Dec 10, 2014

Are these the variables you have in mind? As you can see only LANG is set.

$ echo $LC_ALL

$ echo $LC_TYPE

$ echo $LANG
C.UTF-8

I have tried boot.sh repl on a fresh Cygwin install and it did not respond as well.

@micha
Copy link
Contributor

micha commented Dec 17, 2014

Have you had any luck debugging this issue?

@dmos62
Copy link
Author

dmos62 commented Dec 17, 2014

No, I have not. Something else I have noticed is that repl -s returns immediately after printing nREPL server listening: 0.0.0.0:51144 without actually leaving behind a running REPL server. Same happens whether running boot.sh or boot.exe.

@alandipert
Copy link
Contributor

@dmos62 re: repl -s - the repl task doesn't block by default. To get the behavior I think you want you can compose with another builtin task, wait, with e.g. boot repl -s wait

@dmos62
Copy link
Author

dmos62 commented Dec 18, 2014

Just to clarify again, boot repl -s wait works fine, can connect to it and if running boot.exe from Windows cmd it evals input properly (except for certain characters being badly displayed); it's boot repl -c that does not receive any input from Mintty.

@schmir
Copy link
Contributor

schmir commented Feb 1, 2015

I can confirm the issue.

It looks like cygwin's mintty has many problems with windows console applications:

nodejs/node-v0.x-archive#6459
https://code.google.com/p/mintty/issues/detail?id=56
https://code.google.com/p/mintty/issues/detail?id=244

Judging from the last link, the repl client may try to check if System/console is nil and refuse to start.

@micha
Copy link
Contributor

micha commented Mar 5, 2015

@dmos62 Can you use the leiningen repl client in Cygwin? Or does that result in the same problem?

@micha micha added the blocked label Mar 5, 2015
@dmos62
Copy link
Author

dmos62 commented Mar 5, 2015

lein repl works fine; however, interestingly, lein trampoline repl has the same problem. More specifically lein trampoline repl stopped responding after the first run, lein clean does not help.

@schmir
Copy link
Contributor

schmir commented Mar 9, 2015

see technomancy/leiningen#850

@dmos62
Copy link
Author

dmos62 commented Mar 10, 2015

Opened an issue technomancy/leiningen#1852

On Mon, Mar 9, 2015 at 9:12 PM, Ralf Schmitt notifications@github.com
wrote:

see technomancy/leiningen#850
technomancy/leiningen#850


Reply to this email directly or view it on GitHub
#30 (comment).

@micha
Copy link
Contributor

micha commented Mar 11, 2015

@dmos62 Can you try the stty and system properties workarounds as described in technomancy/leiningen#850 and see if that will fix boot.sh in Cygwin? Thanks!

@dmos62
Copy link
Author

dmos62 commented Mar 12, 2015

The workaround works:

~/bin % cat boot
#!/bin/bash
stty -icanon min 1 -echo
java \
      -Djline.terminal=jline.UnixTerminal \
      -jar boot.sh "$@"
stty icanon echo

First(?) session on Cygwin:

~/bin % boot repl
nREPL server listening: 0.0.0.0:63406
REPL-y 0.3.4, nREPL 0.2.4
Clojure 1.6.0
Java HotSpot(TM) 64-Bit Server VM 1.7.0_71-b14
        Exit: Control+D or (exit) or (quit)
    Commands: (user/help)
        Docs: (doc function-name-here)
              (find-doc "part-of-name-here")
Find by Name: (find-name "part-of-name-here")
      Source: (source function-name-here)
    Javadoc: (javadoc java-object-or-class-here)
    Examples from clojuredocs.org: [clojuredocs or cdoc]
              (user/clojuredocs name-here)
              (user/clojuredocs "ns-here" "name-here")
boot.user=> (+ 2 2)
4
boot.user=> "hello"
"hello"
boot.user=>

@micha
Copy link
Contributor

micha commented Mar 12, 2015

Ok awesome, I'll work something out for this. Hopefully it won't need to be too ugly. I'll push to a branch so you can test it before it gets merged into master, okay?

@micha micha added in progress and removed blocked labels Mar 12, 2015
@micha micha self-assigned this Mar 12, 2015
@dmos62
Copy link
Author

dmos62 commented Mar 12, 2015

Sounds good.

On Thu, Mar 12, 2015 at 6:08 PM, Micha Niskin notifications@github.com
wrote:

Ok awesome, I'll work something out for this. Hopefully it won't need to
be too ugly. I'll push to a branch so you can test it before it gets
merged into master, okay?


Reply to this email directly or view it on GitHub
#30 (comment).

@micha micha closed this as completed in 536d073 Mar 15, 2015
@micha micha removed the in progress label Mar 15, 2015
@micha
Copy link
Contributor

micha commented Mar 15, 2015

@dmos62 Can you please verify that this does in fact work? Thanks :)

@micha micha modified the milestones: rc13, future Mar 15, 2015
@dmos62
Copy link
Author

dmos62 commented Mar 16, 2015

@micha I verify :) though an interesting echo effect appeared, but that's another story.

% bin/boot.sh repl                                      
nREPL server started on port 59805 on host 127.0.0.1 - nrepl://127.0.0.1:59805
REPL-y 0.3.5, nREPL 0.2.7
Clojure 1.6.0
Java HotSpot(TM) 64-Bit Server VM 1.7.0_71-b14
[omited]
boot.user=> (+ 2 2)
(+ 2 2)
4
boot.user=> "hello"
"hello"
"hello"
boot.user=>

@micha
Copy link
Contributor

micha commented Mar 16, 2015

That looks like the stty -echo wasn't working for some reason?

@dmos62
Copy link
Author

dmos62 commented Mar 16, 2015

Yes. The shell calls seem to be exactly the same like in the workaround script, yet when I wrap the latest boot in that script the echo disappears.

@micha micha reopened this Mar 20, 2015
@micha micha modified the milestones: rc14, rc13 Mar 20, 2015
micha added a commit that referenced this issue Apr 5, 2015
@micha micha modified the milestones: 2.0.0, rc14 Apr 15, 2015
@alandipert alandipert modified the milestones: future, 2.0.0 May 21, 2015
@micha micha added blocked and removed in progress labels Oct 27, 2015
@micha micha added the wontfix label Nov 9, 2015
@micha micha closed this as completed Nov 9, 2015
@micha micha removed the blocked label Nov 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants