jonyepsilon / lein-gorilla Goto Github PK
View Code? Open in Web Editor NEWA leiningen plugin for the Gorilla REPL
License: MIT License
A leiningen plugin for the Gorilla REPL
License: MIT License
I try "lein gorilla" but it exits out after saying ctrl-c exits out.
Hi!
I dig this work, thanks a lot for all the time and energy you've invested in Gorilla so far.
I was trying to start up a notebook to share some thoughts with my team using lein-gorilla, and ran into problems with getting it to work. Namely, somewhere in the dependency chain lein-gorilla ends up pulling in [ring/ring-json "0.3.1"]
which ultimately ends up loading [ring/ring-core "1.2.2"]
which has an ns decl that uses (require ...)
instead of (:require ...)
.
Create a new lein project. In deps include [org.clojure/clojure "1.9.0-alpha17"]
. In plugins include [lein-gorilla "0.4.0"]
. Run lein gorilla
.
Clojure spec will complain about the ns decl in ring.util.mime-types.
I found I could work around this with the following dependencies decl:
[gorilla-repl "0.4.0" :exclusions [ring/ring-json compojure]]
[ring/ring-json "0.4.0"]
[compojure "1.6.0"]]
and the following alias:
:aliases {"gorilla" ["run" "-m" "gorilla-repl.core/run-gorilla-server" "{:port \"3000\" :ip \"127.0.0.1\" :nrepl-port 0 :gorilla-version \"0.4.0\" :project \"<my project here>\", :gorilla-options nil}"]}
Trying to add exclusions to :plugins didn't work for me.
Hi,
I use gorilla and and cider, which used to work very well, albeit with some dependency difficulties that could be resolved with exclusions. However, I can not get refactor-nrepl to work. I tried putting it in different places, even cloning the gorilla repos, adding an explicit dependency and lein installing the patched versions, but it still seems to ignore it, so every time I start cider, I get a complaint that refactor-nrepl isn't active. I could live with that, but in some combinations of lein gorilla, gorilla repl, cider, tools.nrepl something really appears to break, and things outside of the functionality of refactor stop working, like overall evaluating cells in a worksheet. Do you have any advice how to deal with that?
Should I just use git repos for cider and the clj-refactor.el and force them to stable versions?
I'm running lein-gorilla 0.3.1 on cygwin. Executing:
$ lein gorilla
from bash spawns a new bash process, which spawns a bash sub-process, which spawns a java subprocess, which spawns another java subprocess.
bash.exe (original, from which lein gorilla is executed)
bash.exe (new)
- bash.exe (subprocess)
- - java.exe
- - - java.exe
Ctrl+C kills the new bash.exe, the subprocess bash, and the first java.exe, but orphans the last java process.
This becomes a problem when trying to restart gorilla:
$ lein gorilla
Gorilla-REPL: 0.3.1
Started nREPL server on port 53008
Exception in thread "main" java.net.BindException: Address already in use: bind, compiling:(C:\cygwin\tmp\form-init8307404900158704503.clj:1:102)
at clojure.lang.Compiler.load(Compiler.java:7142)
at clojure.lang.Compiler.loadFile(Compiler.java:7086)
at clojure.main$load_script.invoke(main.clj:274)
at clojure.main$init_opt.invoke(main.clj:279)
at clojure.main$initialize.invoke(main.clj:307)
at clojure.main$null_opt.invoke(main.clj:342)
at clojure.main$main.doInvoke(main.clj:420)
at clojure.lang.RestFn.invoke(RestFn.java:421)
at clojure.lang.Var.invoke(Var.java:383)
at clojure.lang.AFn.applyToHelper(AFn.java:156)
at clojure.lang.Var.applyTo(Var.java:700)
at clojure.main.main(main.java:37)
Caused by: java.net.BindException: Address already in use: bind
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Unknown Source)
at sun.nio.ch.Net.bind(Unknown Source)
at sun.nio.ch.ServerSocketChannelImpl.bind(Unknown Source)
at sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source)
at sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source)
at org.httpkit.server.HttpServer.<init>(HttpServer.java:42)
at org.httpkit.server$run_server.invoke(server.clj:8)
at gorilla_repl.core$run_gorilla_server.invoke(core.clj:114)
at user$eval3284.invoke(form-init8307404900158704503.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:6703)
at clojure.lang.Compiler.eval(Compiler.java:6693)
at clojure.lang.Compiler.load(Compiler.java:7130)
... 11 more
Manually killing the orphaned java.exe fixes this problem.
When I run regular lein repl, i can see all my functions and vars which i wrote in src/jjson/core.clj.
jjson.core=> (clojure.repl/dir jjson.core)
-main
add_curly_brace
apath
apps
...
However I cannot see any of that in the gorilla repl:
(ns jjson.core
(:require [gorilla-plot.core :as plot]))
=> nil
(clojure.repl/dir jjson.core)
=> nil
Hi,
I am just installe lein-gorilla,
{:user {:dependencies [[slamhound "1.5.5"]]
:plugins [[jonase/eastwood "0.1.3"]
[lein-gorilla "0.3.0-SNAPSHOT"]]
:aliases {"slamhound" ["run" "-m" "slam.hound"]}}}
But when I try to fired it up:
simo@simo:~$ lein gorilla :port 8999
Gorilla-REPL.
Started nREPL server on port 58113
Running at http://localhost:8999/worksheet.html .
Ctrl+C to exit.
simo@simo:~$
Obviously without me pressing Ctrl+C
Exact same deal with the 0.3.1 and the 0.2.0
simo@simo:~$ lein version
Leiningen 2.3.1 on Java 1.7.0_55 OpenJDK 64-Bit Server VM
Am I doing something wrong ?
Dear Jony,
Thank you for Gorilla.
Sadly, SUN/Oracle's Java 10 doesn't like it. From below it sounds not Gorilla-specific, but this seems to be the place to report.
# SUN's java version "10.0.1" 2018-04-17 on 64bit SUSE
# The problem probably also exists with OpenJDK 10. However, OpenJDK has more issues (it can't run lein at all).
lein new app playground
cd playground
# edit project.clj to add :plugins [[lein-gorilla "0.4.0"]] and :jvm-opts ["--add-modules" "java.xml.bind"]. See below for why :jvm-opts. After editing, project.clj is:
(defproject playground "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.8.0"]]
:main ^:skip-aot playground.core
:target-path "target/%s"
:plugins [[lein-gorilla "0.4.0"]]
:jvm-opts ["--add-modules" "java.xml.bind"]
:profiles {:uberjar {:aot :all}})
# To double-check, this should be an alternative to the above Ljvm-opts, but it didn't help either:
export JAVA_TOOL_OPTIONS="-Djdk.launcher.addmods=java.xml.bind"
#Gorilla fails:
lein gorilla
Picked up JAVA_TOOL_OPTIONS: -Djdk.launcher.addmods=java.xml.bind
clojure.lang.Compiler$CompilerException: java.lang.ClassNotFoundException: javax.xml.bind.DatatypeConverter, compiling:(org/httpkit/server.clj:1:1)
at clojure.lang.Compiler.load (Compiler.java:7391)
clojure.lang.RT.loadResourceScript (RT.java:372)
...
Related, applied above but it didn't fix this for Java 10: bhauman/lein-figwheel#612.
The class should exist in Java 10: https://docs.oracle.com/javase/10/docs/api/javax/xml/bind/DatatypeConverter.html.
Please help.
The bug JonyEpsilon/gorilla-repl#269 has been fixed in 0.4.1 but lein-gorilla is still using 0.4.0. Could you put gorilla-repl 0.4.1 on clojars and make lein-gorilla use it?
(PS: https://github.com/JonyEpsilon/gorilla-repl-viewer also still has the wrong cdn.mathjax.org address for mathjax in view.html and document.html).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.