I'm using clojure
1.10.1.645
on linux
When I do clojure -e "(compile 'app.main)"
it results in java .... -e '(compile '\''app.main)'
wich works
When I create a alias :aot {:main-opts ["-e" "(compile 'app.main)"]}
It results in java commnad like -e '(compile' ''\''conduit.server)'
which will do a EOF
error, as it will try to eval (compile
Is it a know issue? I think that I already used it before (it looks like a regression for me)
PS: I'm using bash -x /usr/bin/clojure ...
to know which "final java command" clojure is calling
nothing has changed in this area afaik
things in :main-opts go into a file, and then back out of a file which causes problems due to word-splitting in bash
so if you replace the space after compile with a , that will help
this is a known issue (but it has always been a known issue :)
Should I try to PR? I worked with bash for some years 🙂
there is a ticket and about 4 different patches on there already :)
let me find it
similar but different issues on windows
Here’s related issue around Windows https://clojure.atlassian.net/jira/software/c/projects/TDEPS/issues/TDEPS-133
now of course, you can just use -X in many cases instead :)
aka the “corfield comma”!
Although you can't use -X
to do a simple compile
because it requires a symbol and -X
passes a hash map 🙂
I can think of worse things to be known for 🙂
I reckon we'll see a pack of map versions of core functions.
Or maybe the work on kwargs, will include positional arguments too?
Now thinking about Windows. I can't implement a bash-friendly solution, once it may be dificult to implement in "cmd", once it may need to "interpret" that file as bash. How is going that idea of do like "deps.exe" and use a graal-binary to replace bash/bat?
Or use WSL2 for Clojure development? 🙂
A new prerelease version of clj is now available (1.10.1.681): • Reinstate -R, -C, and -Spom from last week's prerelease (but still deprecated) • TDEPS-155 - Some error message improvements for various bad coordinate cases
If you want to work on plain old Windows and don’t need to stay with official Clojure tools, you might consider trying https://github.com/borkdude/deps.clj. Using its deps.exe
in place of clojujre.exe
made sense for me when testing my project under Windows on GitHub Actions.
Based on feedback from last week, added some things back to ease the migration.
For the moment -Spom will not warn. The -X:deps mvn-pom version was really missing support for modifications to the classpath previously pulled from clj invocation itself. I've added that as an arg but needs more thinking.
@seancorfield I've also standardized all the deprecation warnings to be stderr, if you wanted to pipe redirect them to /dev/null and ignore that's at least possible now. also I fixed the exec.jar issue in the installation.
Thanks @alexmiller -- just to confirm, is -R
exactly the same as before? It hasn't expanded to support other types of arg maps like -A
?
yes, just re-added, not going to do the expanded thing
I had an uberjar alias using depstar that was configured with main opts of:
["-m" "hf.depstar.uberjar"
"target/myproject-with-dependencies.jar"
"--compile" "*" ;Note - the * seems to be needed for older versions of the args, but not now.
"--verbose"
"-m" "myproject.main"]
It was using the RELEASE version of depstar. I noticed that now instead of putting the jar in target/myproject-with-dependencies.jar it creates a jar named (Note: Do not rm *
). It seems to work fine if I set the explicit version to 1.1.104 and drop the "".
Is this the right way to build the standalone jar with aot compilation? It looks like --compile will do transitive compilation from your entry point. Is there a way to specify aoting the whole project? I saw that you can do :aot true. If I did that would it go in the main args or next to the :main-args key in the deps file?Actually, looks like :aot is part of the -X functionality. I missed that.
@markbastian There's a #depstar channel now for dedicated help...
Thanks, I should have thought of that.