Thanks George,
Dw
Sent via mobile
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clo...@googlegroups.com
> Note that posts from new members are moderated - please be patient with your first post.
> To unsubscribe from this group, send email to
> clojure+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
On 25 Apr 2011, at 00:14, George Jahad wrote:
> Technomancy has been kind enough to merge it into the main swank-
> clojure repo, so it will a part of swank-clojure releases going
> forward.
It's very exciting that CDT is being merged with swank-clojure - great stuff!
I just tried the 1.4.0-SNAPSHOT and ran into issues:
Here's me using a slime REPL:
user> (use 'swank.cdt)
warning: unabled to add tools.jar to classpath. This may cause CDT initialization to fail.
No such var: core/swank-worker-thread-name
[Thrown class java.lang.Exception]
Restarts:
0: [QUIT] Quit to the SLIME top level
Backtrace:
0: clojure.lang.Compiler.resolveIn(Compiler.java:5651)
1: clojure.lang.Compiler.resolve(Compiler.java:5621)
2: clojure.lang.Compiler.analyzeSymbol(Compiler.java:5584)
3: clojure.lang.Compiler.analyze(Compiler.java:5172)
4: clojure.lang.Compiler.analyze(Compiler.java:5151)
5: clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3057)
6: clojure.lang.Compiler.analyzeSeq(Compiler.java:5371)
7: clojure.lang.Compiler.analyze(Compiler.java:5190)
8: clojure.lang.Compiler.analyze(Compiler.java:5151)
9: clojure.lang.Compiler$SetExpr.parse(Compiler.java:2546)
10: clojure.lang.Compiler.analyze(Compiler.java:5196)
11: clojure.lang.Compiler.access$100(Compiler.java:35)
12: clojure.lang.Compiler$DefExpr$Parser.parse(Compiler.java:438)
13: clojure.lang.Compiler.analyzeSeq(Compiler.java:5369)
14: clojure.lang.Compiler.analyze(Compiler.java:5190)
15: clojure.lang.Compiler.analyze(Compiler.java:5151)
16: clojure.lang.Compiler.eval(Compiler.java:5428)
17: clojure.lang.Compiler.load(Compiler.java:5857)
18: clojure.lang.RT.loadResourceScript(RT.java:340)
19: clojure.lang.RT.loadResourceScript(RT.java:331)
20: clojure.lang.RT.load(RT.java:409)
21: clojure.lang.RT.load(RT.java:381)
22: clojure.core$load$fn__4511.invoke(core.clj:4905)
23: clojure.core$load.doInvoke(core.clj:4904)
24: clojure.lang.RestFn.invoke(RestFn.java:409)
25: clojure.core$load_one.invoke(core.clj:4729)
26: clojure.core$load_lib.doInvoke(core.clj:4766)
27: clojure.lang.RestFn.applyTo(RestFn.java:143)
28: clojure.core$apply.invoke(core.clj:542)
29: clojure.core$load_libs.doInvoke(core.clj:4800)
30: clojure.lang.RestFn.applyTo(RestFn.java:138)
31: clojure.core$apply.invoke(core.clj:542)
32: clojure.core$require.doInvoke(core.clj:4869)
33: clojure.lang.RestFn.invoke(RestFn.java:458)
34: swank.core.cdt_backends$eval2627$loading__4410__auto____2628.invoke(cdt_backends.clj:1)
35: swank.core.cdt_backends$eval2627.invoke(cdt_backends.clj:1)
36: clojure.lang.Compiler.eval(Compiler.java:5424)
37: clojure.lang.Compiler.eval(Compiler.java:5415)
38: clojure.lang.Compiler.load(Compiler.java:5857)
39: clojure.lang.RT.loadResourceScript(RT.java:340)
40: clojure.lang.RT.loadResourceScript(RT.java:331)
41: clojure.lang.RT.load(RT.java:409)
42: clojure.lang.RT.load(RT.java:381)
43: clojure.core$load$fn__4511.invoke(core.clj:4905)
44: clojure.core$load.doInvoke(core.clj:4904)
45: clojure.lang.RestFn.invoke(RestFn.java:409)
46: clojure.core$load_one.invoke(core.clj:4729)
47: clojure.core$load_lib.doInvoke(core.clj:4766)
48: clojure.lang.RestFn.applyTo(RestFn.java:143)
49: clojure.core$apply.invoke(core.clj:542)
--more--
I'm using cake which I believe does fancy things with classloaders - perhaps this is causing an issue here too?
Where would be the best place to file a bug report?
Sam
I'm a bit further forward than I was before :-)
On 25 Apr 2011, at 15:41, George Jahad wrote:
> strange. haven't seen that one before.
>
> can you and jeff send me your project.clj file, and a directory
> listing of your lib and lib/dev directories?
>
> also what operating system/version/java vm are you using?
Here's my global cake directory - see that it has pulled in the source and cdt jars (these will be made available to all clojure projects started with cake)
λ tree ~/.cake
/Users/sam/.cake
├── build
├── classes
├── config
├── lib
│ ├── clojure-1.2.0.jar
│ ├── clojure-contrib-1.2.0.jar
│ ├── clojure-source-1.2.0.jar
│ ├── deps.clj
│ └── dev
│ ├── cdt-1.2.6.1-20110417.030036-6.jar
│ ├── debug-repl-0.3.1.jar
│ └── swank-clojure-1.4.0-20110417.030036-3.jar
├── pom.xml
├── project.clj
├── run
└── stable_version
5 directories, 11 files
the global project.clj file that pulled this stuff down is as follows:
(defproject global "0.0.0"
:description "Don't rename this project, but you can change the version if you want."
:dependencies [[clojure "1.2.0"]
[clojure-contrib "1.2.0"]
[clojure-source "1.2.0"]]
:dev-dependencies [[swank-clojure "1.4.0-SNAPSHOT"]])
I also have a project.clj for a blank project:
(defproject foo "0.0.1-SNAPSHOT"
:description "TODO: add summary of your project"
:dependencies [[clojure "1.2.0"]])
Notice that I don't include either swank-clojure or the jvm opts stuff here - swank-clojure is dealt with by the global project, and cake doesn't seem to honour jvm opts in the project.clj, it asks you to place them in your .cake/config:
jvm.opts = -agentlib:jdwp=transport=dt_socket,server=y,suspend=n
The project lib is also pretty sparse:
λ ls lib
clojure-1.2.0.jar deps.clj
OK, with that all configured, and set up, I start a swank server and try the following:
user> (use 'swank.cdt)
warning: unabled to add tools.jar to classpath. This may cause CDT initialization to fail.
Clearing CDT event requests and continuing.
Swank CDT release 1.4.0a started
Notice how this time I'm getting the CDT starting which is further than before - this was because I had forgotten that cake requires the jvm opts in its own config file. I'm also no longer seeing that stack trace.
However, I'm still seeing the tools.jar error - is this a major problem?
Sam
I deleted the swank-clojure 1.3 jar from 'lib' and it worked.
On 25 Apr 2011, at 17:35, George Jahad wrote:
>
> Can you set breakpoints and catch exceptions per the "test drive" in
> the doc?
>
Sort of. I'm not sure if I'm just doing the wrong things, but when execute
(difference #{1 2} #{2 3})
after setting:
(set-bp clojure.set/difference)
I get a nice buffer popping up:
CDT BreakpointEvent in thread Swank REPL Thread
From here you can: e/eval, v/show source, s/step, x/next, o/exit func
Restarts:
0: [QUIT] Quit to the SLIME top level
Backtrace:
0: clojure.set$difference.invoke(set.clj:48)
1: user$eval3070.invoke(NO_SOURCE_FILE:1)
2: clojure.lang.Compiler.eval(Compiler.java:5424)
3: clojure.lang.Compiler.eval(Compiler.java:5391)
4: clojure.core$eval.invoke(core.clj:2382)
--more--
When I press e the mini buffer prompts me to "Eval in frame:" and I propmpty type s1 to see the following error in the minibuffer:
Unexpected exception generated: java.lang.IllegalArgumentException: Invalid method
This stuff is all new to me, so I'm likely to be doing something silly.
> for my reference, which os/version/
> java version are you using?
λ java -version
java version "1.6.0_24"
Java(TM) SE Runtime Environment (build 1.6.0_24-b07-334-10M3326)
Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02-334, mixed mode)
on OS X 10.6.7
>
> Also, it sounds like cake setup if significantly different and I don't
> know anything about Cake. If you can generalize your setup and send
> it to me, I'll add it to the docs.
I think the version I was describing before was over complicated for a basic 'getting started' doc. I was attempting to get swank-clojure/CDT set up so that it worked on all my projects without needing to explicitly add/change anything. This is clearly something to strive for *after* I've managed to get it working in the simplest case!
Here's a simpler version of the setup:
In a fresh new project (created with `cake new bar`)
I edited the project.clj as follows:
λ cat project.clj
(defproject bar "0.0.1-SNAPSHOT"
:description "TODO: add summary of your project"
:dependencies [[clojure "1.2.0"]]
:dev-dependencies [[swank-clojure "1.4.0-SNAPSHOT"]
[clojure-source "1.2.0"]])
and created a file called config and placed it in .cake with the following contents:
λ cat .cake/config
jvm.opts = -agentlib:jdwp=transport=dt_socket,server=y,suspend=n
I then pulled the deps with `cake deps`. My lib contains the following:
λ tree lib
lib
├── clojure-1.2.0.jar
├── deps.clj
└── dev
├── cdt-1.2.6.1-20110417.030036-6.jar
├── clojure-source-1.2.0.jar
├── debug-repl-0.3.1.jar
└── swank-clojure-1.4.0-20110417.030036-3.jar
1 directory, 6 files
I can then start swank:
λ cake swank
Listening for transport dt_socket at address: 62404
started swank-clojure server on port 4005
> please keep me posted about any other issues you find!
Will do!
Sam
This seems like a very answer indeed.
Sorry if this sounds a bit dumb, but how do I run/use a JDK rather than a JRE. I'm just using a standard mac with developer tools installed (although I assume that has no Java elements these days). Might it already be installed and I'm not using it by default or is there a specific way of installing it?
Running `locate tools.jar` doesn't seem to come up with any hits...
Sam
>
>> When I press e the mini buffer prompts me to "Eval in frame:" and I
>> propmpty type s1 to see the following error in the minibuffer:
>> Unexpected exception generated: java.lang.IllegalArgumentException:
>> Invalid method This stuff is all new to me, so I'm likely to be
>> doing something silly.
>
> I doubt that. Most likely you have a fairly complicated installation,
> whose problems i haven't experienced yet.
That's pretty unlikely unless it is specifically cake that's the issue. I was running in a completely new and empty project with nothing except clojure and swank-clojure as deps.
>
> Sam, can I suggest we eliminate those installation issues by
> experimenting with a known working project, e.g. logos and seeing if
> that works for you?
This seems to work perfectly :-) No tools.jar errors and I can examine the contents of s1 and s2 - Great stuff! This is really exciting :-)
However, if I create a fresh new logos clone, modify the project.clj again, and pull the deps with cake, add the .cake/config jvm.opts line and start a swank server I get the same issues I saw before:
* A tools.jar warning
* An exception when trying to eval s1
I think that this is pretty clearly a cake issue. I do think it would be cool if this worked out of the box with both lein and cake. I like lein, but cake has better native dependency support which I find extremely useful for my projects.
Have any of the cake devs tried the CDT stuff yet? How might I help debug this?
Sam
I was originally using lein and the native-deps plugin for my projects, but it's much more cumbersome than cake's approach.
On the periphery it doesn't seem too bad, in your project.clj you need to include native-deps in your :dev-dependencies, and then specify the actual native deps in :native-dependencies as follows:
(defproject org.clojars.samaaron/monome-serial "0.1.3"
:description "An interface to the monome (http://monome.org)"
:dependencies [[org.clojure/clojure "1.2.0"]
[org.clojure/clojure-contrib "1.2.0"]]
:dev-dependencies [[native-deps "1.0.5"]]
:native-dependencies [[org.clojars.samaaron/rxtx "2.2.0"]])
Pulling all the deps is a two step process:
* lein deps
* lein native-deps
However, things get more tricky when some of your standard deps have native deps themselves. I had to resort to some hackery to get round this issue: https://github.com/improcess/beatbox/blob/c6e082019e5dad8c7cf37917461339670a38d65f/merge-checkout-deps.rb
With cake things are far, far simpler. There's no need for an extra plugin step, or for you to manually download the native deps of other deps. It is able to determine if a dep contains native deps and does the right thing. So now, the same project's project.clj looks as follows:
(defproject monome-serial "0.2.0"
:description "An interface to the monome (http://monome.org)"
:dependencies [[org.clojure/clojure "1.2.0"]
[org.clojure/clojure-contrib "1.2.0"]
[serial-port "1.0.7"]])
serial-port depends on the rxtx native libs:
(defproject serial-port "1.0.7"
:description "Simple serial port comms library. Wraps RxTx."
:dependencies [[org.clojure/clojure "1.2.0"]
[rxtx22 "1.0.5"]])
and cake deals with it all gracefully. All I need to do is:
cake deps
And cake pulls the correct native libs from all the dependencies and places them in lib/native. It's also smart and only pulls out the correct libs for my architecture.
I hope that this makes sense. It would be awesome if lein followed cake's lead here and did the same thing.
Sam
Here's my project.clj file:
(defproject foo "0.0.0-SNAPSHOT"
:description "project foo"
:dependencies [[org.clojure/clojure "1.3.0-alpha5"]
[seesaw "1.2.2"]]
:dev-dependencies [[swank-clojure "1.4.0-SNAPSHOT"]
[clojure-source "1.3.0-alpha5"]]
:jvm-opts ["-agentlib:jdwp=transport=dt_socket,server=y,suspend=n"]
:checksum-deps true)
lib/ contains this:
clojure-1.3.0-alpha5.jar
dev/
filters-2.0.235.jar
forms-1.2.1.jar
j18n-1.0.0.jar
miglayout-3.7.4.jar
seesaw-1.2.2.jar
swing-worker-1.1.jar
swingx-1.6.1.jar
tools.jar
and lib/dev/ contains this:
cdt-1.2.6.2-20111019.122151-1.jar
clojure-1.2.1.jar
clojure-source-1.3.0-alpha5.jar
debug-repl-0.3.1.jar
swank-clojure-1.4.0-20111019.122151-12.jar
I should be able to see the source of set.clj, right?
I know that's not much help but it might help someone else figure out
how/why your env might differ and why you didn't get source...?
(looks like you're on Windows from clojure\set.clj so that might be a
clue to a difference)
Sean
=====================================================================
C:\work\lab\joy\lib\dev> jar tf clojure-source-1.3.0-alpha5.jar
META-INF/
META-INF/MANIFEST.MF
clojure/
clojure/asm/
clojure/asm/AnnotationVisitor.java
clojure/asm/AnnotationWriter.java
clojure/asm/Attribute.java
clojure/asm/ByteVector.java
clojure/asm/ClassAdapter.java
clojure/asm/ClassReader.java
clojure/asm/ClassVisitor.java
clojure/asm/ClassWriter.java
clojure/asm/commons/
clojure/asm/commons/AdviceAdapter.java
clojure/asm/commons/AnalyzerAdapter.java
clojure/asm/commons/CodeSizeEvaluator.java
clojure/asm/commons/EmptyVisitor.java
clojure/asm/commons/GeneratorAdapter.java
clojure/asm/commons/LocalVariablesSorter.java
clojure/asm/commons/Method.java
clojure/asm/commons/package.html
clojure/asm/commons/SerialVersionUIDAdder.java
clojure/asm/commons/StaticInitMerger.java
clojure/asm/commons/TableSwitchGenerator.java
clojure/asm/Edge.java
clojure/asm/FieldVisitor.java
clojure/asm/FieldWriter.java
clojure/asm/Frame.java
clojure/asm/Handler.java
clojure/asm/Item.java
clojure/asm/Label.java
clojure/asm/MethodAdapter.java
clojure/asm/MethodVisitor.java
clojure/asm/MethodWriter.java
clojure/asm/Opcodes.java
clojure/asm/package.html
clojure/asm/Type.java
clojure/lang/
clojure/lang/AFn.java
clojure/lang/AFunction.java
clojure/lang/Agent.java
clojure/lang/AMapEntry.java
clojure/lang/APersistentMap.java
clojure/lang/APersistentSet.java
clojure/lang/APersistentVector.java
clojure/lang/ARef.java
clojure/lang/AReference.java
clojure/lang/ArityException.java
clojure/lang/ArrayChunk.java
clojure/lang/ArraySeq.java
clojure/lang/ASeq.java
clojure/lang/Associative.java
clojure/lang/Atom.java
clojure/lang/ATransientMap.java
clojure/lang/ATransientSet.java
clojure/lang/BigInt.java
clojure/lang/Binding.java
clojure/lang/Box.java
clojure/lang/ChunkBuffer.java
clojure/lang/ChunkedCons.java
clojure/lang/Compile.java
clojure/lang/Compiler.java
clojure/lang/Compiler.java.orig
clojure/lang/Compiler.java.rej
clojure/lang/Compiler.java~
clojure/lang/Cons.java
clojure/lang/Counted.java
clojure/lang/Delay.java
clojure/lang/DynamicClassLoader.java
clojure/lang/EnumerationSeq.java
clojure/lang/Fn.java
clojure/lang/IChunk.java
clojure/lang/IChunkedSeq.java
clojure/lang/IDeref.java
clojure/lang/IEditableCollection.java
clojure/lang/IFn.java
clojure/lang/IKeywordLookup.java
clojure/lang/ILookup.java
clojure/lang/ILookupSite.java
clojure/lang/ILookupThunk.java
clojure/lang/IMapEntry.java
clojure/lang/IMeta.java
clojure/lang/Indexed.java
clojure/lang/IndexedSeq.java
clojure/lang/IObj.java
clojure/lang/IPersistentCollection.java
clojure/lang/IPersistentList.java
clojure/lang/IPersistentMap.java
clojure/lang/IPersistentSet.java
clojure/lang/IPersistentStack.java
clojure/lang/IPersistentVector.java
clojure/lang/IPromiseImpl.java
clojure/lang/IProxy.java
clojure/lang/IReduce.java
clojure/lang/IRef.java
clojure/lang/IReference.java
clojure/lang/ISeq.java
clojure/lang/IteratorSeq.java
clojure/lang/ITransientAssociative.java
clojure/lang/ITransientCollection.java
clojure/lang/ITransientMap.java
clojure/lang/ITransientSet.java
clojure/lang/ITransientVector.java
clojure/lang/Keyword.java
clojure/lang/KeywordLookupSite.java
clojure/lang/LazilyPersistentVector.java
clojure/lang/LazySeq.java
clojure/lang/LineNumberingPushbackReader.java
clojure/lang/LispReader.java
clojure/lang/LockingTransaction.java
clojure/lang/MapEntry.java
clojure/lang/MapEquivalence.java
clojure/lang/MethodImplCache.java
clojure/lang/MultiFn.java
clojure/lang/Named.java
clojure/lang/Namespace.java
clojure/lang/Numbers.java
clojure/lang/Obj.java
clojure/lang/PersistentArrayMap.java
clojure/lang/PersistentHashMap.java
clojure/lang/PersistentHashSet.java
clojure/lang/PersistentList.java
clojure/lang/PersistentQueue.java
clojure/lang/PersistentStructMap.java
clojure/lang/PersistentTreeMap.java
clojure/lang/PersistentTreeSet.java
clojure/lang/PersistentVector.java
clojure/lang/ProxyHandler.java
clojure/lang/Range.java
clojure/lang/Ratio.java
clojure/lang/Ref.java
clojure/lang/Reflector.java
clojure/lang/Repl.java
clojure/lang/RestFn.java
clojure/lang/Reversible.java
clojure/lang/RT.java
clojure/lang/Script.java
clojure/lang/Seqable.java
clojure/lang/SeqEnumeration.java
clojure/lang/SeqIterator.java
clojure/lang/Sequential.java
clojure/lang/Settable.java
clojure/lang/Sorted.java
clojure/lang/StringSeq.java
clojure/lang/Symbol.java
clojure/lang/TransactionalHashMap.java
clojure/lang/Util.java
clojure/lang/Var.java
clojure/lang/XMLHandler.java
clojure/main.java
============================================================================
On Dec 7, 12:47 pm, Andrew <ache...@gmail.com> wrote:
> Thanks for taking the time Sean! You're right...
>
> - I'm on Windows XP
> - I had to copy tools.jar to my projects lib manually after lein deps
> (not sure how to change the classpath)
> - My emacs setup is munged -- I can run M-x eshell but not M-x shell; I
On Dec 7, 12:47 pm, Andrew <ache...@gmail.com> wrote:
> Thanks for taking the time Sean! You're right...
>
> - I'm on Windows XP
> - I had to copy tools.jar to my projects lib manually after lein deps
> (not sure how to change the classpath)
> - My emacs setup is munged -- I can run M-x eshell but not M-x shell; I
Aravindh Johendran suggested a fix a while ago. Let me try
integrating it and see if that doesn't fix the windows platform.
I'll let you know when I have something.
On Dec 6, 4:36 pm, Sean Corfield <seancorfi...@gmail.com> wrote:
> (looks like you're on Windows from clojure\set.clj so that might be a
> clue to a difference)
>
> Sean
>
On Dec 6, 11:05 pm, Young Kim <philo...@gmail.com> wrote:
> The following is the file lists in clojure-clojure-source-1.3.0-
> alpha5.jar on Windows 7.
> As you can see, there are no *.clj files in clojure-clojure-
> source-1.3.0-alpha5.jar.
> So I think that it is natural that 'clojure/set.clj - source not
> found.' message appeared.
> Do I misunderstand anything?
>
Andrew says he is seeing the problem on Clojure 1.2 as well.
I'm going to summarize your findings here for everyone else.
Basically, you found 3 problems:
1. The set-bp command requires full name-space qualification of the
function name.
2. On Windows, if attach.dll isn't on the java-library path, you get
the following errors:
on stdout:
java.util.ServiceConfigurationError:
com.sun.tools.attach.spi.AttachProvider: Pr
ovider sun.tools.attach.WindowsAttachProvider could not be
instantiated: java.la
ng.UnsatisfiedLinkError: no attach in java.library.path
at the repl:
CDT 1.4.0a startup failed: #<RuntimeException
java.lang.RuntimeException: java.io.IOException: no providers
installed>
The fix is to add something like the following to your project.clj:
:jvm-opts ["-agentlib:jdwp=transport=dt_socket,server=y,suspend=n"
"-Djava.library.path=C:\\usr\\lang\\java\\jdk\\jre\\bin"]
:extra-classpath-dirs ["C:\\usr\\lang\\java\\jdk\\lib\\tools.jar"]
3. You are seeing a problem with how swank-cdt handles file separators
on
Windows, which may be the same problem reported by Andrew above. I'll
have you try the fix I send him and see if it helps you as well.
Thanks again!
On Dec 7, 2:57 am, Young Kim <philo...@gmail.com> wrote:
> I posted the related problem onhttps://github.com/technomancy/swank-clojure/issues/86
The error I'm getting when I do (use 'swank.cdt) can be seen here
--
I start the REPL via M-x clojure-jack-in when viewing my project.clj
file. When I do (use 'swank.cdt) I see the following:
CDT ready
Clearing CDT event requests and continuing.
Swank CDT release 1.5.0a started
nil
user>
And CDT works fine for me...
I do not have tools.jar installed.
Sean
Adding swank-cdt to dev dependencies solved my problem.
Thank you very much!
Sent from my iPhone