tools-deps

Discuss tools.deps.alpha, tools.build, and the clj/clojure command-line scripts! See also #depstar #clj-new
souenzzo 2020-09-11T14:58:20.180900Z

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

alexmiller 2020-09-11T15:00:28.181200Z

nothing has changed in this area afaik

alexmiller 2020-09-11T15:01:17.181800Z

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

alexmiller 2020-09-11T15:01:36.182200Z

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

alexmiller 2020-09-11T15:01:54.182500Z

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

souenzzo 2020-09-11T15:30:17.182600Z

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

alexmiller 2020-09-11T15:30:41.182800Z

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

alexmiller 2020-09-11T15:31:02.183Z

let me find it

alexmiller 2020-09-11T15:33:50.183200Z

https://clojure.atlassian.net/browse/TDEPS-56

alexmiller 2020-09-11T15:35:03.183400Z

similar but different issues on windows

đź‘Ť 1
lread 2020-09-11T17:01:30.183700Z

Here’s related issue around Windows https://clojure.atlassian.net/jira/software/c/projects/TDEPS/issues/TDEPS-133

alexmiller 2020-09-11T17:18:24.184500Z

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

lread 2020-09-11T17:20:58.185Z

aka the “corfield comma”!

seancorfield 2020-09-11T17:22:18.186200Z

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

seancorfield 2020-09-11T17:23:16.186300Z

I can think of worse things to be known for 🙂

dominicm 2020-09-11T17:29:00.187Z

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

dominicm 2020-09-11T17:29:18.187600Z

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

souenzzo 2020-09-11T17:51:36.188400Z

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?

seancorfield 2020-09-11T18:22:29.188600Z

Or use WSL2 for Clojure development? 🙂

1
alexmiller 2020-09-11T18:49:04.188900Z

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

lread 2020-09-11T18:49:45.189600Z

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.

alexmiller 2020-09-11T18:49:55.190100Z

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

alexmiller 2020-09-11T18:52:36.191900Z

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.

alexmiller 2020-09-11T18:54:18.193Z

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

seancorfield 2020-09-11T19:24:35.194Z

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?

alexmiller 2020-09-11T19:38:14.194400Z

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

2020-09-11T20:56:03.201300Z

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?

2020-09-11T21:05:36.201800Z

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

seancorfield 2020-09-11T21:21:24.202400Z

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

🙏 1
2020-09-11T21:23:12.203100Z

Thanks, I should have thought of that.