Skip to content
This repository has been archived by the owner on Oct 21, 2022. It is now read-only.

conservatively inlining the most likely deps that could crash with project versions #48

Closed
wants to merge 1 commit into from

Conversation

rundis
Copy link
Contributor

@rundis rundis commented Jul 1, 2015

First attempt at addressing #44

Took the liberty of upping tools.reader to a sensibly up to date version while at it.

@geoffrys
Copy link

geoffrys commented Jul 1, 2015

What's lein deps :tree look like for this? I'm curious what's left to clash with a project.

@rundis
Copy link
Contributor Author

rundis commented Jul 2, 2015

Well the following I guess:

;;[cheshire "5.2.0"]
;;  [com.fasterxml.jackson.core/jackson-core "2.2.1"]
;;   [com.fasterxml.jackson.dataformat/jackson-dataformat-smile "2.2.1"]
;;   [tigris "0.1.1"]
;;[clj-stacktrace "0.2.7"]
 [clojure-complete "0.2.3" :scope "test" :exclusions [[org.clojure/clojure]]]
 [commons-io "2.4"]
 [fs "1.3.3"]
   [org.apache.commons/commons-compress "1.3"]
 [ibdknox/analyzer "0.0.2"]
 [org.clojure/clojure "1.5.1"]
 [org.clojure/clojurescript "0.0-2202" :exclusions [[org.apache.ant/ant]]]
   [com.google.javascript/closure-compiler "v20131014"]
     [args4j "2.0.16"]
     [com.google.code.findbugs/jsr305 "1.3.9"]
     [com.google.guava/guava "15.0"]
     [com.google.protobuf/protobuf-java "2.4.1"]
     [org.json/json "20090211"]
   [org.clojure/data.json "0.2.3"]
   [org.clojure/google-closure-library "0.0-20140226-71326067"]
     [org.clojure/google-closure-library-third-party "0.0-20140226-71326067"]
   [org.mozilla/rhino "1.7R4"]
 [org.clojure/tools.nrepl "0.2.3" :scope "test" :exclusions [[org.clojure/clojure]]] ;; overridden by lein to 0.2.6 for me
 ;;[org.clojure/tools.reader "0.9.2"]

@kenny-evitt
Copy link

@rundis I'm trying to test this but it doesn't seem to be working. When I open an InstaREPL tab and enter an expression – (+ 1 1 1) – I get the following in the console:

Invalid behavior: :lt.plugins.clojure.instarepl/on-eval-sonar

TypeError: Cannot read property 'call' of undefined
    at notify (C:%5C@GitHub%5CLightTable%5Cbuilds%5Clighttable-0.8.0-windows%5Cresources%5Capp%5Cplugins%5CClojure%5Cclojure_compiled.js:1243:23)
    at check_all (C:%5C@GitHub%5CLightTable%5Cbuilds%5Clighttable-0.8.0-windows%5Cresources%5Capp%5Cplugins%5CClojure%5Cclojure_compiled.js:1258:83)
    at run_local_server (C:%5C@GitHub%5CLightTable%5Cbuilds%5Clighttable-0.8.0-windows%5Cresources%5Capp%5Cplugins%5CClojure%5Cclojure_compiled.js:1193:110)
    at try_connect (C:%5C@GitHub%5CLightTable%5Cbuilds%5Clighttable-0.8.0-windows%5Cresources%5Capp%5Cplugins%5CClojure%5Cclojure_compiled.js:331:45)
    at lt.objs.eval.find_client (file:///C:/@GitHub/LightTable/builds/lighttable-0.8.0-windows/resources/app/core/node_modules/lighttable/bootstrap.js:30915:16)
    at lt.objs.eval.get_client_BANG_ (file:///C:/@GitHub/LightTable/builds/lighttable-0.8.0-windows/resources/app/core/node_modules/lighttable/bootstrap.js:30942:32)
    at Function.__BEH__on_eval_sonar (C:%5C@GitHub%5CLightTable%5Cbuilds%5Clighttable-0.8.0-windows%5Cresources%5Capp%5Cplugins%5CClojure%5Cclojure_compiled.js:1306:69)
    at c (file:///C:/@GitHub/LightTable/builds/lighttable-0.8.0-windows/resources/app/core/node_modules/lighttable/bootstrap.js:6196:14)
    at a (file:///C:/@GitHub/LightTable/builds/lighttable-0.8.0-windows/resources/app/core/node_modules/lighttable/bootstrap.js:6236:18)
    at c (file:///C:/@GitHub/LightTable/builds/lighttable-0.8.0-windows/resources/app/core/node_modules/lighttable/bootstrap.js:20443:76)

Any ideas?

Maybe I'm not deploying the plugin correctly. I pulled your branch into _\LightTable\deploy\plugins\Clojure_, ran ./build.sh in that plugin directory, and then ran script/build-app.sh in the root LT repo directory.

@rundis
Copy link
Contributor Author

rundis commented Aug 11, 2015

sorry should have added instructions. Never used the build scripts myself, they might be broken. But in any case I didn't think of adding the necessary changes to them for this wip pull (:

Firstly, the fix includes using mranderson : https://github.com/benedekfazekas/mranderson

To test locally, go to the lein-light sub project in the clojure plugin

  • $ lein source-deps
  • $ lein with-profile plugin.mranderson/config install

So the following needs to be addressed also before any merge and subsequent release I think:

  • fix build script(s)
  • version of lein light should be upped
  • consider inlining the fs dependency too, because there is already someone reported a error due too a conflict (someone using ultra I believe)
  • i guess we'll need clojars credentials to be able to upload new versions of the lein-light nrepl middleware jar

The big drawback of using mranderson/source inlining is that there is considerable overhead (several seconds on my machine) firing up the nrepl. (Think its due to loading/compiling a whole bunch of more classes). Cider has the same issue btw.

@rundis
Copy link
Contributor Author

rundis commented Aug 11, 2015

To be even clearer;
It's just the lein-light nrepl jar that has been adressed. i have no idea about the state of the clojure plugin on latest master. To test this pull, you don't need to ( and probably shouldn't by the looks of the error msg) install the plugin. You just need to package and locally deploy (to local m2) the lein-light jar.

Btw i think the bundling in the github project is confusing and would argue that the middleware lein-light could happily deserve a separate github proj with a travis build and deploy facility of it's own. Hey we could even start adding some tests even :-)

Its fair that the runner and the clojurescript part stays bundled like todays, since that sets up the default version of lein-light that works with its corresponding clojurescript plugin. However when connecting to a running nrepl outside of lt we should be free to promote newer versions of the middleware (say regular snapshots etc) for people to try.

@kenny-evitt
Copy link

@rundis Whew! Thanks for the info. I noticed that you hadn't modified the plugin per se but I didn't suspect that I could skip deploying the plugin as a whole. Nor did I suspect that the latest code just doesn't work. I'll follow your instructions to test this.

I still can't tell why the plugin failed for me anyways. The code that's failing, because a core function is missing (or never existed), looks like it was copied from the main repo prior to the first tagged version of this plugin. I am confused and I'd like to understand how I screwed up.

Also, the build.sh script doesn't compile the ClojureScript code for the plugin. I'm not sure how to best do that.

@joshuafcole Any tips on how to compile the ClojureScript for this? Any reason why it shouldn't be part of the build script? Or a separate build script?

@kenny-evitt
Copy link

I ran into an error running lein source-deps from within the lein-light-nrepl sub-directory:

retrieve dependencies and munge clojure source files
    prefixing imports in clojure files...
java.io.FileNotFoundException: C:\@GitHub\LightTable\deploy\plugins\Clojure\lein-light-nrepl\target\srcdeps (Access is denied)

@kenny-evitt
Copy link

I opened an issue for Leiningen on the off chance that it's a bug with it.

I'll try on some combination of my Ubuntu and Mac OS X boxes tonight if I can.

@kenny-evitt
Copy link

I was able to run lein source-deps on a Mac OS X box.

@kenny-evitt
Copy link

@rundis I was able to run lein with-profile plugin.mranderson/config install too, on the same Mac OS X box, and it worked. I then ran cp target/lein-light-nrepl-0.1.0.jar ~/.m2/repository/lein-light-nrepl/lein-light-nrepl/0.1.0/ to deploy the JAR to my local M2 repository – tell me if that's wrong.

  • [ ] Let's create a Bash script to deploy the JAR to the developer's local M2 repository. This seems to be a cowpath worth paving now. I don't want to have to remember anything more than the bare minimum.

[I edited your comment above to change your bullets into checkboxes. I like the checkbox convention as an indication of tasks that we should complete, or explicitly 'delete' or strike, before we close an issue.]

I still ran into the original issue, at least with my personal project. Light Table's lament:

We couldn't connect.

Looks like there was an issue trying to connect to the project. Here's what we got:
WARNING: user-level profile defined in project files.
final project:  ...
...
Error loading lighttable.nrepl.handler: java.lang.RuntimeException: Unable to resolve var: reader/*alias-map* in this context, compiling:(cljs/analyzer.clj:1499:11)
Exception in thread "main" java.lang.RuntimeException: Unable to resolve var: lighttable.nrepl.handler/lighttable-ops in this context, compiling:(/private/var/folders/cp/_g96khd52396h676bs66939w0000gp/T/form-init441802471007400206.clj:1:4998)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:6567)
    at clojure.lang.Compiler.analyze(Compiler.java:6361)
    at clojure.lang.Compiler.analyze(Compiler.java:6322)
    at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3624)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:6562)
    at clojure.lang.Compiler.analyze(Compiler.java:6361)
    at clojure.lang.Compiler.analyze(Compiler.java:6322)
    at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3624)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:6562)
    at clojure.lang.Compiler.analyze(Compiler.java:6361)
    at clojure.lang.Compiler.access$100(Compiler.java:37)
    at clojure.lang.Compiler$LetExpr$Parser.parse(Compiler.java:5973)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:6560)
    at clojure.lang.Compiler.analyze(Compiler.java:6361)
    at clojure.lang.Compiler.analyze(Compiler.java:6322)
    at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:5708)
    at clojure.lang.Compiler$FnMethod.parse(Compiler.java:5139)
    at clojure.lang.Compiler$FnExpr.parse(Compiler.java:3751)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:6558)
    at clojure.lang.Compiler.analyze(Compiler.java:6361)
    at clojure.lang.Compiler.eval(Compiler.java:6616)
    at clojure.lang.Compiler.eval(Compiler.java:6609)
    at clojure.lang.Compiler.load(Compiler.java:7064)
    at clojure.lang.Compiler.loadFile(Compiler.java:7020)
    at clojure.main$load_script.invoke(main.clj:294)
    at clojure.main$init_opt.invoke(main.clj:299)
    at clojure.main$initialize.invoke(main.clj:327)
    at clojure.main$null_opt.invoke(main.clj:362)
    at clojure.main$main.doInvoke(main.clj:440)
    at clojure.lang.RestFn.invoke(RestFn.java:421)
    at clojure.lang.Var.invoke(Var.java:419)
    at clojure.lang.AFn.applyToHelper(AFn.java:163)
    at clojure.lang.Var.applyTo(Var.java:532)
    at clojure.main.main(main.java:37)
Caused by: java.lang.RuntimeException: Unable to resolve var: lighttable.nrepl.handler/lighttable-ops in this context
    at clojure.lang.Util.runtimeException(Util.java:219)
    at clojure.lang.Compiler$TheVarExpr$Parser.parse(Compiler.java:650)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:6560)
    ... 33 more
clojure.lang.ExceptionInfo: Subprocess failed {:exit-code 1}
    at clojure.core$ex_info.invoke(core.clj:4327)
    at leiningen.core.eval$fn__3532.invoke(eval.clj:226)
    at clojure.lang.MultiFn.invoke(MultiFn.java:231)
    at leiningen.core.eval$eval_in_project.invoke(eval.clj:326)
    at clojure.lang.AFn.applyToHelper(AFn.java:167)
    at clojure.lang.AFn.applyTo(AFn.java:151)
    at clojure.core$apply.invoke(core.clj:619)
    at leiningen.repl$repl.doInvoke(repl.clj:261)
    at clojure.lang.RestFn.invoke(RestFn.java:425)
    at leiningen.light_nrepl$light.doInvoke(light_nrepl.clj:56)
    at clojure.lang.RestFn.invoke(RestFn.java:423)
    at leiningen.light_nrepl$_main.doInvoke(light_nrepl.clj:68)
    at clojure.lang.RestFn.invoke(RestFn.java:397)
    at clojure.lang.AFn.applyToHelper(AFn.java:159)
    at clojure.lang.RestFn.applyTo(RestFn.java:132)
    at leiningen.light_nrepl.main(Unknown Source)

@rundis
Copy link
Contributor Author

rundis commented Aug 18, 2015

lein with-profile plugin.mranderson/config install does install the jar into your local ~/m2 . No need for copying or bashscripts.
I could make a aggregate lein task that does:

  clean
  source-deps ; this step is vital as it generates the inlined code
  install ; with-profile plugin.mranderson/config - adding the profile to the command is critical to ensure the generated inlined code is actually part of the generated jar

if following this steps doesn't seem to work, would you mind checking the jar file if it contains the inlined code for the the dependencies at all. Just looking at the size of the jar would be a hint, but you might want to do a quick scan to ensure that you find some tools.readers namespaces in the jar file
unzip -l target/lein-light-nrepl-0.1.0.jar | grep tools.reader

@rundis
Copy link
Contributor Author

rundis commented Aug 24, 2015

@kenny-evitt did you get any further with trying this out ?

@kenny-evitt
Copy link

@rundis I just tried to test this on an Ubuntu box. lein source-deps and lein with-profile plugin.mranderson/config install ran fine.

unzip -l target/lein-light-nrepl-0.1.0.jar | grep tools.reader looked good to me:

        0  2015-08-29 20:02   deps/toolsreader/v0v9v2/clojure/tools/reader/
        0  2015-08-29 20:02   deps/toolsreader/v0v9v2/clojure/tools/reader/impl/
     1297  2015-08-29 20:02   deps/toolsreader/v0v9v2/clojure/tools/reader/impl/ExceptionInfo$_toString.class
      759  2015-08-29 20:02   deps/toolsreader/v0v9v2/clojure/tools/reader/impl/ExceptionInfo$_getData.class
     1630  2015-08-29 20:02   deps/toolsreader/v0v9v2/clojure/tools/reader/impl/ExceptionInfo$loading__4910__auto__.class
     1054  2015-08-29 20:02   deps/toolsreader/v0v9v2/clojure/tools/reader/impl/ExceptionInfo$_init.class
     1911  2015-08-29 20:02   deps/toolsreader/v0v9v2/clojure/tools/reader/impl/ExceptionInfo$fn__32.class
     5050  2015-08-29 20:02   deps/toolsreader/v0v9v2/clojure/tools/reader/impl/ExceptionInfo.class
     4458  2015-08-29 20:02   deps/toolsreader/v0v9v2/clojure/tools/reader/impl/ExceptionInfo__init.class
    11624  2015-08-29 20:01   deps/toolsreader/v0v9v2/clojure/tools/reader/default_data_readers.clj
    14149  2015-08-29 20:01   deps/toolsreader/v0v9v2/clojure/tools/reader/edn.clj
    11955  2015-08-29 20:01   deps/toolsreader/v0v9v2/clojure/tools/reader/reader_types.clj
     4503  2015-08-29 20:01   deps/toolsreader/v0v9v2/clojure/tools/reader/impl/utils.clj
     4650  2015-08-29 20:01   deps/toolsreader/v0v9v2/clojure/tools/reader/impl/commons.clj
     1276  2015-08-29 20:01   deps/toolsreader/v0v9v2/clojure/tools/reader/impl/ExceptionInfo.clj
    35043  2015-08-29 20:01   deps/toolsreader/v0v9v2/clojure/tools/reader.clj
        0  2015-08-29 20:01   leinlightnrepl010/clojure/tools/reader/
        0  2015-08-29 20:01   leinlightnrepl010/clojure/tools/reader/impl/
     1257  2015-08-29 20:01   leinlightnrepl010/clojure/tools/reader/impl/ExceptionInfo$_toString.class
      719  2015-08-29 20:01   leinlightnrepl010/clojure/tools/reader/impl/ExceptionInfo$_getData.class
     1024  2015-08-29 20:01   leinlightnrepl010/clojure/tools/reader/impl/ExceptionInfo$_init.class
     1582  2015-08-29 20:01   leinlightnrepl010/clojure/tools/reader/impl/ExceptionInfo$loading__4784__auto__.class
     4960  2015-08-29 20:01   leinlightnrepl010/clojure/tools/reader/impl/ExceptionInfo.class
     3897  2015-08-29 20:01   leinlightnrepl010/clojure/tools/reader/impl/ExceptionInfo__init.class

But it seemed like the issue is still un-resolved, at least for my personal project. Light Table's complaint is below.

Is there anything I need to do beyond the initial two commands? Should I close and re-open LT? Refresh the plugin list? Is trying to reproduce the original issue the right way to test this? Are your changes intended to fix some but not all of the (possibly) conflicting dependencies?

We couldn't connect.

Looks like there was an issue trying to connect to the project. Here's what we got:
final project:  ...
...
Error loading lighttable.nrepl.handler: java.lang.RuntimeException: Unable to resolve var: reader/*alias-map* in this context, compiling:(cljs/analyzer.clj:1499:11)
Exception in thread "main" java.lang.RuntimeException: Unable to resolve var: lighttable.nrepl.handler/lighttable-ops in this context, compiling:(/tmp/form-init2579655661770142248.clj:1:4890)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:6567)
    at clojure.lang.Compiler.analyze(Compiler.java:6361)
    at clojure.lang.Compiler.analyze(Compiler.java:6322)
    at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3624)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:6562)
    at clojure.lang.Compiler.analyze(Compiler.java:6361)
    at clojure.lang.Compiler.analyze(Compiler.java:6322)
    at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3624)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:6562)
    at clojure.lang.Compiler.analyze(Compiler.java:6361)
    at clojure.lang.Compiler.access$100(Compiler.java:37)
    at clojure.lang.Compiler$LetExpr$Parser.parse(Compiler.java:5973)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:6560)
    at clojure.lang.Compiler.analyze(Compiler.java:6361)
    at clojure.lang.Compiler.analyze(Compiler.java:6322)
    at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:5708)
    at clojure.lang.Compiler$FnMethod.parse(Compiler.java:5139)
    at clojure.lang.Compiler$FnExpr.parse(Compiler.java:3751)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:6558)
    at clojure.lang.Compiler.analyze(Compiler.java:6361)
    at clojure.lang.Compiler.eval(Compiler.java:6616)
    at clojure.lang.Compiler.eval(Compiler.java:6609)
    at clojure.lang.Compiler.load(Compiler.java:7064)
    at clojure.lang.Compiler.loadFile(Compiler.java:7020)
    at clojure.main$load_script.invoke(main.clj:294)
    at clojure.main$init_opt.invoke(main.clj:299)
    at clojure.main$initialize.invoke(main.clj:327)
    at clojure.main$null_opt.invoke(main.clj:362)
    at clojure.main$main.doInvoke(main.clj:440)
    at clojure.lang.RestFn.invoke(RestFn.java:421)
    at clojure.lang.Var.invoke(Var.java:419)
    at clojure.lang.AFn.applyToHelper(AFn.java:163)
    at clojure.lang.Var.applyTo(Var.java:532)
    at clojure.main.main(main.java:37)
Caused by: java.lang.RuntimeException: Unable to resolve var: lighttable.nrepl.handler/lighttable-ops in this context
    at clojure.lang.Util.runtimeException(Util.java:219)
    at clojure.lang.Compiler$TheVarExpr$Parser.parse(Compiler.java:650)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:6560)
    ... 33 more
clojure.lang.ExceptionInfo: Subprocess failed {:exit-code 1}
    at clojure.core$ex_info.invoke(core.clj:4327)
    at leiningen.core.eval$fn__3532.invoke(eval.clj:226)
    at clojure.lang.MultiFn.invoke(MultiFn.java:231)
    at leiningen.core.eval$eval_in_project.invoke(eval.clj:326)
    at clojure.lang.AFn.applyToHelper(AFn.java:167)
    at clojure.lang.AFn.applyTo(AFn.java:151)
    at clojure.core$apply.invoke(core.clj:619)
    at leiningen.repl$repl.doInvoke(repl.clj:261)
    at clojure.lang.RestFn.invoke(RestFn.java:425)
    at leiningen.light_nrepl$light.doInvoke(light_nrepl.clj:56)
    at clojure.lang.RestFn.invoke(RestFn.java:423)
    at leiningen.light_nrepl$_main.doInvoke(light_nrepl.clj:68)
    at clojure.lang.RestFn.invoke(RestFn.java:397)
    at clojure.lang.AFn.applyToHelper(AFn.java:159)
    at clojure.lang.RestFn.applyTo(RestFn.java:132)
    at leiningen.light_nrepl.main(Unknown Source)

@kenny-evitt
Copy link

@rundis I got the same error even after closing and re-opening LT.

@cldwalker cldwalker mentioned this pull request Aug 31, 2015
@rundis
Copy link
Contributor Author

rundis commented Aug 31, 2015

Arghh..

My bad with regards to LightTable/LightTable#1052
The issue there is of course the uberjaring step that leaves an old version of tools-reader classes in the target folder for the project. Something which I tried to address with #43

Starting a new clojure client from Light Table has two steps:

  1. kicking of runner (lein-light-standalone.jar) (client in light table terms)
  2. Which again kicks off a separate process for the actual project (nrepl) with the lein-light middleware

The problem is with 2, when the project classpath is set up target/classes obviously comes as one of the first entries in the classpath.When uberjaring the sample project in question has an old version of tools.reader left in target/classes.

I thought that inlining tools.reader would resolve the problem, and for some issues with like the actual code in lein-light it will, but the problem kenny got above is from trying to compile the clojurescript dependency which also depends on tools.reader (0.8.3).

The runner project tries to enforce tools.reader 0.8.3 when kicking off the nrepl process, but I believe to no avail in this case as target/classes wins.

So what to do:
a) inline the clojurescript dependency (have a feeling this might be to big an ask from mranderson, but I'll give it a go (will take ages to munge though, and fearful of what it will do to the connect time for projects),
b) Use the hack or something similar as in #43 , but this feels like it would only solve the corner-case with uberjar, but not if for some reason the project or the users profiles.clj or whatever pulls in an incompatible version of tools.reader (that is incompatible with the clojurescript dep)
c) Figure out a way to make lein nrepl to push tools.reader earlier on in the classpath
d) Perhaps there is a way to get rid of the ClojureScript dep or somehow just pull in what we need ?
e) open for other great ideas, because I'm starting to run out of any

in summary: someone please give me a dependency isolation story in clojure/jvm that actually works in a repl/nrepl scenario !

@rundis
Copy link
Contributor Author

rundis commented Sep 1, 2015

Unsurprisingly inlining the ClojureScript dependency was certainly a dead end.

@kenny-evitt
Copy link

@rundis Thanks for the heroic effort.

Maybe the previous iterations of this plus #43 are enough? In my case, I've never run into anything except the uberjar corner case.

Also, a quick Google search for "clojure repl dependency isolation" included boot. It seems like they solve the same or similar problem by just not having any dependencies:

Code from other projects was incorporated into boot wherever necessary to eliminate external dependencies of boot itself. This ensures that the project classpath remains pristine and free from potential dependency conflicts.

@cldwalker cldwalker mentioned this pull request Sep 5, 2015
@cldwalker
Copy link
Member

@rundis Thanks for your herculean efforts here. I agree with @kenny-evitt that some version of #43 (b) is plenty for the uberjar corner case. We'll address other corner cases as needed.

As for this PR, do you have an example project that fails without these fixes? The guestbook example connects fine with the latest master (which has no fs).

@rundis
Copy link
Contributor Author

rundis commented Sep 8, 2015

@cldwalker If I use the guestbook example I can reproduce the problem with master of the clojure plugin. The issue is with tools.reader not fs ! The [compojure "1.1.6"] dep in guestbook pulls in tools.reader 0.7.3.

So when I do lein ring uberjar, tools.reader will be extracted (and aot'ed ?) into target/classes
Trying to connect with lighttable after that will make target/classes be part of my classpath and it will take precedence over any tools.reader dep we add as part of using the runner.
Well that's my theory anyway.

One version of #43 could of course be to try and nuke only classes from deps that overlap with deps we aren't inlining as part of our nrepl middleware

@kenny-evitt
Copy link

@rundis Please excuse me if this is stupid, but what about uberjar-ing the runner? Is there some compelling reason why that's a bad idea?

@rundis
Copy link
Contributor Author

rundis commented Sep 11, 2015

@kenny-evitt The runner is already uberjar'ed

@kenny-evitt
Copy link

@rundis Ahhh – and it's lein-light-nrepl that's failing to be loaded because of the classpath non-isolation.

How crazy would it be to remove all of the dependencies from lein-ligh-nrepl? We'd still run into problems because of Clojure/ClojureScript version mismatches even if we did that, right?

@kenny-evitt
Copy link

@rundis I think the only failsafe means of isolation is what Leiningen does:

It [the "project JVM" sub-process] can only communicate with Leiningen's process via the file system, sockets, and its exit code.

That seems like a major rewrite.

@cldwalker
Copy link
Member

Now that #52 has landed, guestbook should be fine. Is there a known test project this PR fixes?

@rundis
Copy link
Contributor Author

rundis commented Sep 17, 2015

@cldwalker Well not that I can think of from the top of my head. I'd have to try and create one with a conflict for any of the remaining dependencies in the lein-light middleware.
Whilst I'd love to be safer in terms on avoiding dependency conflicts, I think the price is high with the additional startup time and bulky artifact, so the problem really needs to feel real to be worth it.

I think we can close this for now and rather reconsider introducing (an updated version of) something like this if we run into frequent issues related to dependency conflicts after we ship 0.8

@cldwalker
Copy link
Member

@rundis Sounds good. Other options to consider next time are https://github.com/jonase/eastwood/tree/master/copy-deps-scripts or to read from the project.clj and give better errors

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants