Giter VIP home page Giter VIP logo

lein-gorilla's People

Contributors

benfb avatar jonyepsilon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

lein-gorilla's Issues

Incompatability with Clojure 1.9-alpha17

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 ...).

Steps to reproduce:

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.

Symptoms

Clojure spec will complain about the ns decl in ring.util.mime-types.

Workarounds

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.

nrepl refactor support?

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?

"java.net.BindException: Address already in use..." caused by orphaned java process

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.

namespace objects not visible from namespace

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

Immediately Exit ?

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 ?

Gorilla and Java 10

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.