ninjudd / cake Goto Github PK
View Code? Open in Web Editor NEWA tasty build tool for Clojure.
Home Page: clojure-cake.org
License: Eclipse Public License 1.0
A tasty build tool for Clojure.
Home Page: clojure-cake.org
License: Eclipse Public License 1.0
The first time you run cake repl in a directory with a project.clj file, the repl does not actually launch. If you run it a second time it works.
I note that outside of a directory that contains a project.clj file, cake repl properly launches a repl the first time.
I'm on OS X 10.6, JDK 1.6 64bit
Using cake 0.4.16.
Start with no cake JVMs (cake stop).
Steps to reproduce:
Expected:
Both tasks run.
Actual:
Once I saw a crash. Another time I saw this at the "cake swank" prompt:
$ cake swank
[cake] connection to cake jvm is taking a long time...
[cake] you can use ^C to abort and use 'cake kill' or 'cake kill -9' to force the jvm to restart
% cake
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/cake-0.3.11/bin/cake:88:in readlink': Invalid argument - /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/cake-0.3.11/bin/cake (Errno::EINVAL) from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/cake-0.3.11/bin/cake:88:in
readlink'
from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/cake-0.3.11/bin/cake:95
from /opt/ruby-enterprise-1.8.7-2010.02/bin/cake:19:in `load'
from /opt/ruby-enterprise-1.8.7-2010.02/bin/cake:19
I'm using cake 0.3.3 installed via gem. cake eval works perfectly in a directory with a project.clj.
Calling read in a cake repl causes the repl to hang waiting for input.
This affects at least cake 0.3.4
The completion lists do not seem to include the special form symbols: #{def, if do, let, quote, var, fn, loop, recur, throw, try, monitor-enter, monitor-exit, dot, new, set!}
We want to allow for users to be able to put a 'template' project in ~/.cake/template
that will be used when they run cake new
.
EDIT: after some more research I realize that cake and cake repl work but only if you are currently in a directory with a project.clj. The standalone "cake repl" no longer works and gives the following exception:
[deps] fetching cake libraries. this may take a moment... Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1 (io.clj:37) at clojure.lang.Compiler.load(Compiler.java:5858) at clojure.lang.RT.loadResourceScript(RT.java:340) at clojure.lang.RT.loadResourceScript(RT.java:331) at clojure.lang.RT.load(RT.java:409) at clojure.lang.RT.load(RT.java:381) at clojure.core$load$fn__1412.invoke(core.clj:4905) at clojure.core$load.doInvoke(core.clj:4904) at clojure.lang.RestFn.invoke(RestFn.java:409) at clojure.core$load_one.invoke(core.clj:4729) at clojure.core$load_lib.doInvoke(core.clj:4766) at clojure.lang.RestFn.applyTo(RestFn.java:143) at clojure.core$apply.invoke(core.clj:542) at clojure.core$load_libs.doInvoke(core.clj:4800) at clojure.lang.RestFn.applyTo(RestFn.java:138) at clojure.core$apply.invoke(core.clj:544) at clojure.core$use.doInvoke(core.clj:4880) at clojure.lang.RestFn.invoke(RestFn.java:458) at cake.tasks.new$eval4196$loading__1295__auto____4197.invoke(new.clj:1) at cake.tasks.new$eval4196.invoke(new.clj:1) at clojure.lang.Compiler.eval(Compiler.java:5419) at clojure.lang.Compiler.eval(Compiler.java:5410) at clojure.lang.Compiler.load(Compiler.java:5852) at clojure.lang.RT.loadResourceScript(RT.java:340) at clojure.lang.RT.loadResourceScript(RT.java:331) at clojure.lang.RT.load(RT.java:409) at clojure.lang.RT.load(RT.java:381) at clojure.core$load$fn__1412.invoke(core.clj:4905) at clojure.core$load.doInvoke(core.clj:4904) at clojure.lang.RestFn.invoke(RestFn.java:409) at clojure.core$load_one.invoke(core.clj:4729) at clojure.core$load_lib.doInvoke(core.clj:4766) at clojure.lang.RestFn.applyTo(RestFn.java:143) at clojure.core$apply.invoke(core.clj:542) at clojure.core$load_libs.doInvoke(core.clj:4804) at clojure.lang.RestFn.applyTo(RestFn.java:138) at clojure.core$apply.invoke(core.clj:542) at clojure.core$require.doInvoke(core.clj:4869) at clojure.lang.RestFn.invoke(RestFn.java:409) at cake$start_server.invoke(cake.clj:197) at user$eval4127.invoke(NO_SOURCE_FILE:1) at clojure.lang.Compiler.eval(Compiler.java:5419) at clojure.lang.Compiler.eval(Compiler.java:5386) at clojure.core$eval.invoke(core.clj:2382) at clojure.main$eval_opt.invoke(main.clj:235) at clojure.main$initialize.invoke(main.clj:254) at clojure.main$script_opt.invoke(main.clj:270) at clojure.main$main.doInvoke(main.clj:354) at clojure.lang.RestFn.invoke(RestFn.java:437) at clojure.lang.Var.invoke(Var.java:373) at clojure.lang.AFn.applyToHelper(AFn.java:169) at clojure.lang.Var.applyTo(Var.java:482) at clojure.main.main(main.java:37) Caused by: java.lang.ArrayIndexOutOfBoundsException: 1 at clojure.lang.PersistentArrayMap$Seq.first(PersistentArrayMap.java:236) at clojure.lang.APersistentMap.hashCode(APersistentMap.java:94) at clojure.lang.ASeq.hashCode(ASeq.java:69) at clojure.lang.ASeq.hashCode(ASeq.java:69) at clojure.lang.ASeq.hashCode(ASeq.java:69) at clojure.lang.ASeq.hashCode(ASeq.java:69) at clojure.lang.ASeq.hashCode(ASeq.java:69) at clojure.lang.Util.hash(Util.java:65) at clojure.lang.PersistentHashMap.containsKey(PersistentHashMap.java:123) at clojure.lang.Compiler.isSpecial(Compiler.java:292) at clojure.lang.LispReader$SyntaxQuoteReader.syntaxQuote(LispReader.java:702) at clojure.lang.LispReader$SyntaxQuoteReader.invoke(LispReader.java:692) at clojure.lang.LispReader.readDelimitedList(LispReader.java:1051) at clojure.lang.LispReader$ListReader.invoke(LispReader.java:900) at clojure.lang.LispReader.readDelimitedList(LispReader.java:1051) at clojure.lang.LispReader$ListReader.invoke(LispReader.java:900) at clojure.lang.LispReader.read(LispReader.java:145) at clojure.lang.Compiler.load(Compiler.java:5849) ... 51 more
I discovered that there were still RC2 clojure jars in the ~/.cake directory, so I deleted ~/.cake thinking that it would automatically be rebuild...
cake started spewing errors wanting to chdir in .cake and wasn't happy until I mkdir ~/.cake... after which it rebuild the .cake directory tree with the latest and greatest clojure jars...
With a new JVM instance, every first call to "cake clean":
E:\clojure\istext>cake clean
java.net.SocketException: Connection reset
at java.net.SocketInputStream.read (:-1)
sun.nio.cs.StreamDecoder.readBytes (:-1)
sun.nio.cs.StreamDecoder.implRead (:-1)
sun.nio.cs.StreamDecoder.read (:-1)
java.io.InputStreamReader.read (:-1)
java.io.BufferedReader.fill (:-1)
java.io.BufferedReader.readLine (:-1)
java.io.BufferedReader.readLine (:-1)
cake$bake_STAR_.invoke (cake.clj:138)
cake.tasks.clean$eval6075$fn__6076.invoke (clean.clj:8)
cake$run_task$fn__4087.invoke (cake.clj:102)
cake$run_task.invoke (cake.clj:101)
cake$process_command.invoke (cake.clj:162)
cake.server$create$fn__3914.invoke (server.clj:107)
cake.contrib.server_socket$accept_fn$fn__3617$fn__3620.invoke (server_socket.clj:39)
cake.contrib.server_socket$accept_fn$fn__3617.invoke (server_socket.clj:38)
clojure.lang.AFn.run (AFn.java:24)
java.lang.Thread.run (:-1)
There are three cases, depending on how cake was installed:
cake clean; git pull; cake deps
gem update cake
It would be nice to be able to run one-off Clojure scripts with cake. It would be particularly sweet to have this command bind
cake/cwdbefore loading the .clj file to be run.
Make it possible to search clojars.org for projects and possibly make it possible to automatically include a project to dependencies.
http://github.com/Licenser/lein-search is a good place to look. I haven't spoken to Licenser but he may be interested in porting it?
First, let's invoke uberjar:
E:\clojure\istext>cake uberjar
[jar] Building jar: E:\clojure\istext\istext-1.0.jar
[uberjar] Building jar: E:\clojure\istext\istext-1.0-standalone.jar
Fine, now deps:
E:\clojure\istext>cake deps
Fetching dependencies...
[deps] Copying 1 file to E:\clojure\istext\build\lib
[deps] Deleting directory E:\clojure\istext\lib
org.apache.tools.ant.BuildException: Unable to delete file E:\clojure\istext\lib\clojure-1.1.0.jar
at org.apache.tools.ant.taskdefs.Delete.handle (Delete.java:701)
org.apache.tools.ant.taskdefs.Delete.removeDir (Delete.java:750)
org.apache.tools.ant.taskdefs.Delete.execute (Delete.java:572)
sun.reflect.NativeMethodAccessorImpl.invoke0 (:-2)
sun.reflect.NativeMethodAccessorImpl.invoke (:-1)
sun.reflect.DelegatingMethodAccessorImpl.invoke (:-1)
java.lang.reflect.Method.invoke (:-1)
clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:90)
clojure.lang.Reflector.invokeNoArgInstanceMember (Reflector.java:265)
cake.tasks.dependencies$eval4443$fn__4450.invoke (dependencies.clj:120)
cake$run_task$fn__4087.invoke (cake.clj:102)
cake$run_task.invoke (cake.clj:101)
cake$process_command.invoke (cake.clj:162)
cake.server$create$fn__3914.invoke (server.clj:107)
cake.contrib.server_socket$accept_fn$fn__3617$fn__3620.invoke (server_socket.clj:39)
cake.contrib.server_socket$accept_fn$fn__3617.invoke (server_socket.clj:38)
clojure.lang.AFn.run (AFn.java:24)
java.lang.Thread.run (:-1)
...and it starts working again after "cake clean".
If I have an executable script that looks like this in a project directory
#!/usr/bin/env cake (println (System/getProperty "user.dir"))
I see the output as the global path. If I specify I run, I see it as the project directory. I don't suppose this can be resolved?
This makes it impossible to eval or load source that contains sets.
On those systems that have lsof available (macosx does), you can easily find out who the user is associated with an socket port for loopback/localhost connections.
You could use that to implement a simple access control rule that you only accept connections from the same user as you are...
Unfortunately the info that lsof gets is not easily available thru (portable) system calls (at least not a couple years ago when i looked at it), so you would have to run lsof from the command line and parse.
~>cat ~/.cake/.cake/*.pid
897
35447
0.4.13-SNAPSHOT
889
32566
0.4.13-SNAPSHOT
~>lsof -i :35447
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
java 897 franks 20u IPv6 0x06ef71f0 0t0 TCP [::127.0.0.1]:35447 (LISTEN)
java 897 franks 24u IPv6 0x078826d0 0t0 TCP [::127.0.0.1]:35447->[::127.0.0.1]:51889 (ESTABLISHED)
ruby 1211 franks 3u IPv4 0x0c55cb1c 0t0 TCP localhost:51889->localhost:35447 (ESTABLISHED)
~>whoami
franks
~>lsof -i :32566
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
java 889 franks 20u IPv6 0x078810e0 0t0 TCP [::127.0.0.1]:32566 (LISTEN)
Subject says it all. I just ran into this, and it seems to violate the least surprise principal. I think cake uberjar and cake bin should incorporate the project.java_opts settings into the builds.
When you run 'cake test' and are doing AOT compilation or java compilation, test runs in the stale project JVM and thus does not see your changes.
To fix this, we need a way to restart bake over the socket.
From IRC:
ninjudd, lancepantz: In the last commit, on line 800 and 805 of the Ruby file, you removed "lib/dev/*" from the classpath. Now, when you try to add a task by adding it to dependencies or dev dependencies, and then adding :tasks [namespace.tasks], the namespace is not found. I fixed it by adding it back (for now, anyway, just to test my task).
The exact jar I'm using is cake-0.4.16-20100917.180912.jar.
To reproduce, just try adding tasks to any project. Here is my project.clj:
(defproject irclj "0.3.0-SNAPSHOT"
:description "A simple IRC library/bot framework."
:dependencies [[org.clojure/clojure "1.2.0"]
[org.clojure/clojure-contrib "1.2.0"]]
:tasks [cake-autodoc.tasks]
:dev-dependencies [[swank-clojure "1.2.1"]
[cake-autodoc "0.0.1-SNAPSHOT"]])
I also tried with the protobuf library, just in case I had broken something myself. It didn't work either.
Here is the exception:
java.io.FileNotFoundException: Could not locate cake_autodoc/tasks__init.class or cake_autodoc/tasks.clj on classpath:
at clojure.lang.RT.load (RT.java:412)
clojure.lang.RT.load (RT.java:381)
clojure.core$load$fn__4511.invoke (core.clj:4905)
clojure.core$load.doInvoke (core.clj:4904)
clojure.lang.RestFn.invoke (RestFn.java:409)
clojure.core$load_one.invoke (core.clj:4729)
clojure.core$load_lib.doInvoke (core.clj:4766)
clojure.lang.RestFn.applyTo (RestFn.java:143)
clojure.core$apply.invoke (core.clj:542)
clojure.core$load_libs.doInvoke (core.clj:4800)
clojure.lang.RestFn.applyTo (RestFn.java:138)
clojure.core$apply.invoke (core.clj:542)
clojure.core$require.doInvoke (core.clj:4869)
clojure.lang.RestFn.invoke (RestFn.java:409)
cake.core$eval1436.invoke (project.clj:1)
clojure.lang.Compiler.eval (Compiler.java:5424)
clojure.lang.Compiler.eval (Compiler.java:5414)
clojure.lang.Compiler.load (Compiler.java:5857)
clojure.lang.Compiler.loadFile (Compiler.java:5820)
clojure.lang.RT$3.invoke (RT.java:296)
cake.project$init.invoke (project.clj:29)
cake.core$start_server.invoke (core.clj:213)
user$eval889.invoke (NO_SOURCE_FILE:1)
clojure.lang.Compiler.eval (Compiler.java:5424)
clojure.lang.Compiler.eval (Compiler.java:5391)
clojure.core$eval.invoke (core.clj:2382)
clojure.main$eval_opt.invoke (main.clj:235)
clojure.main$initialize.invoke (main.clj:254)
clojure.main$null_opt.invoke (main.clj:279)
clojure.main$main.doInvoke (main.clj:354)
clojure.lang.RestFn.invoke (RestFn.java:422)
clojure.lang.Var.invoke (Var.java:369)
clojure.lang.AFn.applyToHelper (AFn.java:165)
clojure.lang.Var.applyTo (Var.java:482)
clojure.main.main (main.java:37)
I was able to temporarily fix the problem by editing Ruby file (cake) and adding "lib/dev/*" on line 800 and 805.
Not sure how easy that would be, but it would be nice not to pollute stdout with error message like pages of java stack traces especially when you're running cake as a shell script.
In that case a non-0 exit status should be the indicator that something went wrong in the script.
Hello,
I really like the way cake uses ant to build war files and I prefer it over the leiningen plugin that I wrote.
However, at the moment cake war puts src/*.clj files into / of the war file. I feel that it would be better if they went into WEB-INF/classes because:
Saul
cake help
d:/Ruby/lib/ruby/gems/1.8/gems/cake-0.3.6/bin/cake:47:in readlink': readlink() function is unimplemented on this machine (NotImplementedError) from d:/Ruby/lib/ruby/gems/1.8/gems/cake-0.3.6/bin/cake:47 from d:/Ruby/bin/cake:19:in
load'
from d:/Ruby/bin/cake:19
My program works fine in lein repl but in cake repl, I get a java.security.NoSuchAlgorithmException
Please see this output:
http://gist.github.com/596672
Both repls are using the same Java version:
user=> (System/getProperty "java.version")
"1.6.0_20"
Thank you!
There is no security in place to authenticate the cake-client to the jvm and vv, but it makes it a little more difficult if the world can not see what ports you are listening on in the .pid files.
Apparently cake does not work well if the calling shell is zsh (which is my main shell).
I work on OS X right now; however, I can try to replicate the bug on Linux as well.
Essentially, this is what happens when I run a clojure script:
% cake run counter.clj
clojure.lang.LispReader$ReaderException: java.lang.Exception: Unsupported escape character: \e
at clojure.lang.LispReader.read (LispReader.java:180)
clojure.core$read.invoke (core.clj:2884)
clojure.core$read.invoke (core.clj:2882)
clojure.core$read.invoke (core.clj:2880)
clojure.core$read.invoke (core.clj:2878)
cake.server$create$fn__3919.invoke (server.clj:112)
cake.contrib.server_socket$accept_fn$fn__3618$fn__3621.invoke (server_socket.clj:39)
cake.contrib.server_socket$accept_fn$fn__3618.invoke (server_socket.clj:38)
clojure.lang.AFn.run (AFn.java:24)
java.lang.Thread.run (Thread.java:637)
The very same script, when run with bash works perfectly:
$ cake run counter.clj
Calling bash from zsh and the running cake does not work:
$ cake run counter.clj
clojure.lang.LispReader$ReaderException: java.lang.Exception: Unsupported escape character: \e
at clojure.lang.LispReader.read (LispReader.java:180)
clojure.core$read.invoke (core.clj:2884)
clojure.core$read.invoke (core.clj:2882)
clojure.core$read.invoke (core.clj:2880)
clojure.core$read.invoke (core.clj:2878)
cake.server$create$fn__3919.invoke (server.clj:112)
cake.contrib.server_socket$accept_fn$fn__3618$fn__3621.invoke (server_socket.clj:39)
cake.contrib.server_socket$accept_fn$fn__3618.invoke (server_socket.clj:38)
clojure.lang.AFn.run (AFn.java:24)
java.lang.Thread.run (Thread.java:637)
cake repl works in every environment.
http://github.com/ninjudd/cake-standalone/raw/master/jars/cake-0.4.18.jar
[=============================================================================]
Invalid maximum heap size: -Xmx8192M
The specified size exceeds the maximum representable size.
env | grep JAVA
JAVA_OPTS=-server -Xmx8192M -Xms512M -agentlib:yjpagent -Dfile.encoding=UTF-8 -Dswank.encoding=utf-8 -Djava.awt.headless=true
I have no problems running 8GB JVMs, so cake should not complain. It doesn't start with -Xmx4096M, either.
E:\clojure\istext>cake repl
Fetching dependencies...
[deps] Copying 1 file to e:\clojure\istext\build\lib
[deps] Deleting directory e:\clojure\istext\lib
[deps] Attempting to rename dir: build\lib to lib
(now waits forever, no timeout)
I installed cake as gem and I have latest (cake - 0.3.13). But got this error:
C:/Ruby191/lib/ruby/gems/1.9.1/gems/cake-0.3.13/bin/cake:13:in require': no such file to load -- win32/process (LoadError) from C:/Ruby191/lib/ruby/gems/1.9.1/gems/cake-0.3.13/bin/cake:13:in
<top (required)>'
from C:/Ruby191/bin/cake:19:in load' from C:/Ruby191/bin/cake:19:in
Can you look into this? Thanks.
This would be awesome!
a bad binding form passed to bake creates an infinite loop of nils:
(deftask gen-context
(bake [(:use xmlgen.core)]
lance:xmlgen $ cake gen-context
evaluating form: (let (:use xmlgen.core))
java.lang.RuntimeException: java.lang.IllegalArgumentException: let requires an even number of forms in binding vector (NO_SOURCE_FILE:0)
at clojure.lang.LazySeq.sval (LazySeq.java:47)
clojure.lang.LazySeq.seq (LazySeq.java:56)
clojure.lang.LazySeq.next (LazySeq.java:85)
clojure.lang.RT.next (RT.java:560)
clojure.core$next.invoke (core.clj:61)
clojure.core$last.invoke (core.clj:228)
cake.server$eval_multi.invoke (server.clj:81)
bake.core$project_eval.invoke (core.clj:23)
cake.server$create$fn__2177.invoke (server.clj:133)
cake.contrib.server_socket$accept_fn$fn__1845$fn__1848.invoke (server_socket.clj:39)
cake.contrib.server_socket$accept_fn$fn__1845.invoke (server_socket.clj:38)
clojure.lang.AFn.run (AFn.java:24)
java.lang.Thread.run (Thread.java:637)
Caused by: clojure.lang.Compiler$CompilerException: java.lang.IllegalArgumentException: let requires an even number of forms in binding vector (NO_SOURCE_FILE:0)
at clojure.lang.Compiler.eval (Compiler.java:5440)
clojure.lang.Compiler.eval (Compiler.java:5391)
clojure.core$eval.invoke (core.clj:2382)
cake.server$eval_verbose.invoke (server.clj:71)
cake.server$eval_multi$iter__2140__2144$fn__2145$fn__2146.invoke (server.clj:82)
cake.server$eval_multi$iter__2140__2144$fn__2145.invoke (server.clj:81)
clojure.lang.LazySeq.sval (LazySeq.java:42)
clojure.lang.LazySeq.seq (LazySeq.java:56)
clojure.lang.LazySeq.next (LazySeq.java:85)
clojure.lang.RT.next (RT.java:560)
clojure.core$next.invoke (core.clj:61)
clojure.core$last.invoke (core.clj:228)
cake.server$eval_multi.invoke (server.clj:81)
bake.core$project_eval.invoke (core.clj:23)
cake.server$create$fn__2177.invoke (server.clj:133)
cake.contrib.server_socket$accept_fn$fn__1845$fn__1848.invoke (server_socket.clj:39)
cake.contrib.server_socket$accept_fn$fn__1845.invoke (server_socket.clj:38)
clojure.lang.AFn.run (AFn.java:24)
java.lang.Thread.run (Thread.java:637)
Caused by: java.lang.IllegalArgumentException: let requires an even number of forms in binding vector
at clojure.core$let.doInvoke (core.clj:3469)
clojure.lang.RestFn.invoke (RestFn.java:468)
clojure.lang.Var.invoke (Var.java:377)
clojure.lang.AFn.applyToHelper (AFn.java:174)
clojure.lang.Var.applyTo (Var.java:482)
clojure.lang.Compiler.macroexpand1 (Compiler.java:5286)
clojure.lang.Compiler.macroexpand (Compiler.java:5341)
clojure.lang.Compiler.eval (Compiler.java:5409)
clojure.lang.Compiler.eval (Compiler.java:5391)
clojure.core$eval.invoke (core.clj:2382)
cake.server$eval_verbose.invoke (server.clj:71)
cake.server$eval_multi$iter__2140__2144$fn__2145$fn__2146.invoke (server.clj:82)
cake.server$eval_multi$iter__2140__2144$fn__2145.invoke (server.clj:81)
clojure.lang.LazySeq.sval (LazySeq.java:42)
clojure.lang.LazySeq.seq (LazySeq.java:56)
clojure.lang.LazySeq.next (LazySeq.java:85)
clojure.lang.RT.next (RT.java:560)
clojure.core$next.invoke (core.clj:61)
clojure.core$last.invoke (core.clj:228)
cake.server$eval_multi.invoke (server.clj:81)
bake.core$project_eval.invoke (core.clj:23)
cake.server$create$fn__2177.invoke (server.clj:133)
cake.contrib.server_socket$accept_fn$fn__1845$fn__1848.invoke (server_socket.clj:39)
cake.contrib.server_socket$accept_fn$fn__1845.invoke (server_socket.clj:38)
clojure.lang.AFn.run (AFn.java:24)
java.lang.Thread.run (Thread.java:637)
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
Give the ability to set default options for new project.clj files. For instance, allow user to set default :dev-dependencies, :dependencies, :tasks location, etc.
project.clj:
...
:tasks [foo.tasks]
...
foo/src/foo/tasks.clj:
(ns foo.tasks)
(deftask hello-world
(println "hello world."))
$ cake help
Exception in thread "main" java.lang.Exception: Unable to resolve symbol: deftask in this context (tasks.clj:3)
at clojure.lang.Compiler.analyze(Compiler.java:5200)
at clojure.lang.Compiler.analyze(Compiler.java:5146)
at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3031)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:5366)
Installed ruby (1.8.7), gems, cake (gem) and win32-process (gem) under Cygwin on Windows XP SP3 but still get the following error when running the cake script:
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- io/wait (LoadError)
cake eval '(println *ns*)' #
Seems like it should default to user, no?
When using cake to compile and test clojure itself (http://github.com/ninjudd/clojure), cake test prints errors when it shouldn't. This is because clojure.test-clojure.test uses test-ns-hook to override reporting. Cake should respect this if possible.
Cake version 0.4.17
OS: Mac OS X 10.6.4
This happens in a common use case of cake upgrade followed by another use of cake.
Start with not Cake JVMs (cake stop)
Expected:
Task runs
Actual:
$ cake test
/Library/Ruby/Gems/1.8/gems/cake-0.4.17/bin/cake:336:in kill': Operation not permitted (Errno::EPERM) from /Library/Ruby/Gems/1.8/gems/cake-0.4.17/bin/cake:336:in
refresh'
from /Library/Ruby/Gems/1.8/gems/cake-0.4.17/bin/cake:317:in initialize' from /Library/Ruby/Gems/1.8/gems/cake-0.4.17/bin/cake:807:in
new'
from /Library/Ruby/Gems/1.8/gems/cake-0.4.17/bin/cake:807
from /usr/bin/cake:19:in `load'
from /usr/bin/cake:19
My theory is that running cake via sudo causes cake to run JVMs as superuser. No other task can access these JVMs.
Note the following appears to work:
Workaround:
$ sudo cake stop
Solution suggestions:
Add special case code for "cake upgrade" that detects (1) if no JVMs are running, and (2) if running as superuser. If both 1 and 2 are true, then run task in non-persistent JVM.
Alternately, If there's some way to run as the user that started sudo, launching the persistent JVM as that user may work.
'cake deps force' should not be necessary
report is not called
I have a project which I can compile with 'lein compile && lein uberjar' to produce a working jar file. Executing java -jar jarfile.jar starts the application. Running 'cake compile' works fine and the application compiles, running 'cake uberjar' produces the standalone jar file as it should, then this:
$ java -jar application-1.0.0-SNAPSHOT-standalone.jar
Exception in thread "main" java.lang.ExceptionInInitializerError
Caused by: java.lang.IllegalStateException: Can't change/establish root binding of: warn-on-reflection with set (core.clj:1)
....
If the referred core.clj is my own core.clj, then it has injected a reference to warn-on-reflection which for some odd reason cannot be resolved. If its clojure/core.clj, the something else is going on. Either way, the uberjar functionality is broken.
The current "f" branch provides environments which let you bundle together various values (for example, settings for release and debug versions of your software) and then specify which set of values to use when run on the command-line.
It would be wonderful to have this facility available for compiled JARs.
For example, I have a function I've written called include-js to include a javascript module in a compojure app. In debug mode, that function returns a dynamic URL that serves the raw JS file, and in release mode, that function points to a web server location with the compiled module. The environments feature lets you run the webapp from the command line in different ways, but the functionality cannot be used in the compiled war.
the configuration concept looks to be a better solution to transitive dependencies than maven exclusions. i imagine this will probably break compatibility with lein project.clj's, so thats worth some discussion
Hi I am trying to run the autotest task but it fails. Here is the trace.
cake autotest
/home/pdelgallego/bin/cake/bin/cake:830:in `send_command': wrong number of arguments (2 for 1) (ArgumentError)
from /home/pdelgallego/bin/cake/bin/cake:830
Cake test task seems to work alright.
cake test
Testing tmp.test.core
FAIL in (replace-me) (core.clj:6)
No tests have been written.
expected: false
actual: false
Ran 1 tests containing 1 assertions.
Finished in 0.032693399 seconds.
This is on ubuntu 10.04, clojure 1.2
I would like to compile jar files that do not include .clj files. I refer you to :
http://github.com/technomancy/leiningen/commit/0e189a8da31cdefd90118b2d96414f3dc8ad5d3d
Feature:
~/.bake/tasks.clj exists as the global list of tasks -- you can use them anywhere on your system.
rayne@ubuntu:~/cljprojs/cake-github$ cake github.repos.create cake-github --description="A command-line interface to the Github API as a cake plugin. Tasty."
{:github.repos.create ["cake-github" "--description=A command-line interface to the Github API as a cake plugin. Tasty."]}
It doesn't seem to like quotes after a --option. Note that all that task did was print the options raw.
Cake tries to force a 32bit VM unless its on Windows, so I expect this will break on all 64bit non-windows systems. To resolve it, I uncommented the 3rd line:
def vm_opts
opts = '-client'
opts << ' -d32' unless $win # <-- this one
end
In the file /usr/lib/ruby/gems/1.9.1/gems/cake-0.4.9/bin/cake
Running a clean install of cake:
‹ ~ › ∴ gem install cake
Successfully installed cake-0.4.15
1 gem installed
Installing ri documentation for cake-0.4.15...
Installing RDoc documentation for cake-0.4.15...
‹ ~ › ∴ cake
/Users/hinmanm/.rvm/gems/ruby-1.9.1-p378/gems/cake-0.4.15/bin/cake:731:in `chdir': No such file or directory - /Users/hinmanm/.cake (Errno::ENOENT)
from /Users/hinmanm/.rvm/gems/ruby-1.9.1-p378/gems/cake-0.4.15/bin/cake:731:in `<top (required)>'
from /Users/hinmanm/.rvm/gems/ruby-1.9.1-p378/bin/cake:19:in `load'
from /Users/hinmanm/.rvm/gems/ruby-1.9.1-p378/bin/cake:19:in `<main>'
‹ ~ › ∴ mkdir .cake
‹ ~ › ∴ cake
clojure.lang.LispReader$ReaderException: java.lang.Exception: Unsupported escape character: \x
at clojure.lang.LispReader.read (LispReader.java:180)
clojure.core$read.invoke (core.clj:2884)
clojure.core$read.invoke (core.clj:2882)
clojure.core$read.invoke (core.clj:2880)
clojure.core$read.invoke (core.clj:2878)
cake.server$create$fn__730.invoke (server.clj:121)
cake.contrib.server_socket$accept_fn$fn__398$fn__401.invoke (server_socket.clj:39)
cake.contrib.server_socket$accept_fn$fn__398.invoke (server_socket.clj:38)
clojure.lang.AFn.run (AFn.java:24)
java.lang.Thread.run (Thread.java:637)
Caused by: java.lang.Exception: Unsupported escape character: \x
at clojure.lang.LispReader$StringReader.invoke (LispReader.java:451)
clojure.lang.LispReader.readDelimitedList (LispReader.java:1051)
clojure.lang.LispReader$MapReader.invoke (LispReader.java:1006)
clojure.lang.LispReader.readDelimitedList (LispReader.java:1051)
clojure.lang.LispReader$MapReader.invoke (LispReader.java:1006)
clojure.lang.LispReader.read (LispReader.java:145)
clojure.core$read.invoke (core.clj:2884)
clojure.core$read.invoke (core.clj:2882)
clojure.core$read.invoke (core.clj:2880)
clojure.core$read.invoke (core.clj:2878)
cake.server$create$fn__730.invoke (server.clj:121)
cake.contrib.server_socket$accept_fn$fn__398$fn__401.invoke (server_socket.clj:39)
cake.contrib.server_socket$accept_fn$fn__398.invoke (server_socket.clj:38)
clojure.lang.AFn.run (AFn.java:24)
java.lang.Thread.run (Thread.java:637)
clojure.lang.LispReader$ReaderException: java.lang.Exception: Unsupported escape character: \x
at clojure.lang.LispReader.read (LispReader.java:180)
clojure.core$read.invoke (core.clj:2884)
clojure.core$read.invoke (core.clj:2882)
clojure.core$read.invoke (core.clj:2880)
clojure.core$read.invoke (core.clj:2878)
cake.server$create$fn__730.invoke (server.clj:121)
cake.contrib.server_socket$accept_fn$fn__398$fn__401.invoke (server_socket.clj:39)
cake.contrib.server_socket$accept_fn$fn__398.invoke (server_socket.clj:38)
clojure.lang.AFn.run (AFn.java:24)
java.lang.Thread.run (Thread.java:637)
Caused by: java.lang.Exception: Unsupported escape character: \x
at clojure.lang.LispReader$StringReader.invoke (LispReader.java:451)
etc, etc, etc
Ruby version 1.9.1-p378
lein repl
will intermingle output from threads in the repl itself, making it easy for debugging. cake repl
doesn't have this behaviour and ignores thread stderr/stdout.
As an alternative to add some simple authentication to the cake-client and server interaction, the cake-server could add a cookie to the .pid file (some random number or uuid), which the client can communicate for example in the ping/pong exchange.
The idea is that if the .pid files can only be read/written by the user, then the user is the only one who can read the cookie and send it.
The client is also the only one who can read the port number rom the .pid file, but there are other ways to find open ports (netstat and friends) that could be misused.
"Well configured systems" allow only root privileges to snoop on the tcp stream (tcpdump/wireshark), which means that encryption is normally not needed for communication over the loopback (unless you're paranoid...).
Anyway - some lightweight authentication mechanism between cake client-server that would prevent any other user on the system to connect to the cake-server, would be good.
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.