ClojureScript

Browser repl does not work if the JVM working directory is not the CLJS directory

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Declined
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    MacOS 10.6.8, Java SE Runtime Environment (build 1.6.0_26-b03-384-10M3425)

Description

The browser repl hangs if the JVM working directory is not in the CLJS repository ($CLOJURESCRIPT_HOME). This is an odd and nonintuitive restriction.

For example, if my machine has $CLOJURESCRIPT_HOME set to ~/src/clojurescript, and I'm using emacs inferior lisp:

Dired to ~/src/clojurescript, set inferior-lisp-program to "script/repl", everything works fine.

Dired to ~/src/foo, set inferior-lisp-program to "../clojurescript/script/repl", the Clojure repl starts up fine, but the ClojureScript repl hangs.

This is not a classpath error: I have verified that the classpath is identical in both cases. Everything except the ClojureScript repl works in both cases.

Nor is it an error with the 'script/repl' startup script - I was initially using my own startup script in a completely separate directory, which is where I discovered the problem.

Activity

Hide
David Nolen added a comment -

Does this problem occur at the command line sans Emacs?

Show
David Nolen added a comment - Does this problem occur at the command line sans Emacs?
Hide
Brenton Ashworth added a comment -

I can't reproduce the problem.

Here is what I did:

  • Create directory foo next to clojurescript
  • cd foo & cp -a ../clojurescript/samples/repl/* .
  • In emacs
    • dired to foo
    • M-x set-variable
      • inferior-lisp-program
      • "../clojurescript/script/repl"
    • M-x run-lisp
  • In the REPL
    • (use 'cljs.closure)
    • (def opts {:output-to "main.js" :output-dir "out"})
    • (build "src" opts)
    • (require '[cljs.repl :as repl])
    • (require '[cljs.repl.browser :as browser])
    • (def env (browser/repl-env))
    • (repl/repl env)
  • Open foo/index.html in browser

At this point everything works.

I also tried doing the same from the command line, just running ../clojurescript/script/repl which also worked.

Show
Brenton Ashworth added a comment - I can't reproduce the problem. Here is what I did:
  • Create directory foo next to clojurescript
  • cd foo & cp -a ../clojurescript/samples/repl/* .
  • In emacs
    • dired to foo
    • M-x set-variable
      • inferior-lisp-program
      • "../clojurescript/script/repl"
    • M-x run-lisp
  • In the REPL
    • (use 'cljs.closure)
    • (def opts {:output-to "main.js" :output-dir "out"})
    • (build "src" opts)
    • (require '[cljs.repl :as repl])
    • (require '[cljs.repl.browser :as browser])
    • (def env (browser/repl-env))
    • (repl/repl env)
  • Open foo/index.html in browser
At this point everything works. I also tried doing the same from the command line, just running ../clojurescript/script/repl which also worked.
Hide
Luke VanderHart added a comment -

I've replicated your steps and it works.

There must be something more subtle and complex going on with my shell environment. I will try to isolate it - I'll let you know if there's anything in ClojureScript that needs to be fixed.

In the meantime, we can close this ticket as "cannot reproduce" since apparently it's only happening on some of my projects, reason TBD.

Thanks!

Show
Luke VanderHart added a comment - I've replicated your steps and it works. There must be something more subtle and complex going on with my shell environment. I will try to isolate it - I'll let you know if there's anything in ClojureScript that needs to be fixed. In the meantime, we can close this ticket as "cannot reproduce" since apparently it's only happening on some of my projects, reason TBD. Thanks!
Hide
Luke VanderHart added a comment -

Cannot reproduce, suspect user error. Will re-open if ClojureScript does turn out to be at fault.

Show
Luke VanderHart added a comment - Cannot reproduce, suspect user error. Will re-open if ClojureScript does turn out to be at fault.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: