Fork me on GitHub
#tools-deps
<
2020-09-11
>
souenzzo14:09:20

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

Alex Miller (Clojure team)15:09:28

nothing has changed in this area afaik

Alex Miller (Clojure team)15:09:17

things in :main-opts go into a file, and then back out of a file which causes problems due to word-splitting in bash

Alex Miller (Clojure team)15:09:36

so if you replace the space after compile with a , that will help

Alex Miller (Clojure team)15:09:54

this is a known issue (but it has always been a known issue :)

souenzzo15:09:17

Should I try to PR? I worked with bash for some years 🙂

Alex Miller (Clojure team)15:09:41

there is a ticket and about 4 different patches on there already :)

Alex Miller (Clojure team)15:09:03

similar but different issues on windows

👍 3
seancorfield17:09:47

I just routinely use , instead of whitespace when writing stuff in deps.edn and even on the command-line for clojure 🙂

lread17:09:58

aka the “corfield comma”!

seancorfield17:09:16

I can think of worse things to be known for 🙂

souenzzo17:09:36

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?

seancorfield18:09:29

Or use WSL2 for Clojure development? 🙂

simple_smile 3
lread18:09:45

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.

seancorfield17:09:47

I just routinely use , instead of whitespace when writing stuff in deps.edn and even on the command-line for clojure 🙂

Alex Miller (Clojure team)17:09:24

now of course, you can just use -X in many cases instead :)

seancorfield17:09:18

Although you can't use -X to do a simple compile because it requires a symbol and -X passes a hash map 🙂

dominicm17:09:00

I reckon we'll see a pack of map versions of core functions.

vlaaad17:09:11

All you need is a single invoke :

(defn invoke [{:keys [fn args]}]
  (apply fn args))

(invoke {:fn inc :args [1]}) => 2

dominicm17:09:18

Or maybe the work on kwargs, will include positional arguments too?

vlaaad17:09:11

All you need is a single invoke :

(defn invoke [{:keys [fn args]}]
  (apply fn args))

(invoke {:fn inc :args [1]}) => 2

Alex Miller (Clojure team)18:09:04

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

Alex Miller (Clojure team)18:09:55

Based on feedback from last week, added some things back to ease the migration.

Alex Miller (Clojure team)18:09:36

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.

Alex Miller (Clojure team)18:09:18

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

seancorfield19:09:35

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?

Alex Miller (Clojure team)19:09:14

yes, just re-added, not going to do the expanded thing

markbastian20:09:03

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?

markbastian21:09:36

Actually, looks like :aot is part of the -X functionality. I missed that.

seancorfield21:09:24

@markbastian There's a #depstar channel now for dedicated help...

🙏 3
markbastian21:09:12

Thanks, I should have thought of that.