Fork me on GitHub
#tools-deps
<
2019-07-11
>
borkdude08:07:36

lately I'm getting

Full report at:
/var/folders/2m/h3cvrr1x4296p315vbk7m32c0000gp/T/clojure-6407140529537279679.edn
when I get an exception running a program with tools.deps. Is there a way to get the old behavior back?

kirill.salykin08:07:24

--report=stderr I think

borkdude08:07:12

> file - write to a temp file (default, falls back to stderr) when would this "fall back to stderr" as a default?

borkdude08:07:26

if it has no write access?

borkdude08:07:12

This doesn't work for me:

clj --report stderr -A:clj-kondo --lint corpus/unresolved_symbol.clj

borkdude08:07:30

It says "-A:clj-kondo (No such file or directory)"

kirill.salykin08:07:09

maybe try with -A:clj-kondo in the end?

borkdude08:07:33

--lint ... are arguments to clj-kondo

borkdude08:07:16

it worked with the java property

vlaaad08:07:27

--report stderr are clojure.main arguments right?

vlaaad08:07:24

maybe you need to modify :clj-kondo alias's :main-opts and put --report stderr there?

borkdude08:07:42

yeah, that makes sense

dominicm10:07:41

I think that a JVM option variant was added too, for leiningen.

borkdude10:07:05

I'm using that right now, works

dominicm10:07:41

> Specifically, the default behavior for error reporting with Clojure 1.10.1-beta3 is to write the error report and stack trace to a file, but you can also change that to stderr via system property -Dclojure.main.report=stderr if you prefer.

borkdude10:07:04

yes, that one

kirill.salykin08:07:56

seems reasonable

kirill.salykin14:07:37

If I copy jar to .m2 and add it to deps.edn - it works

mkdir -p ~/.m2/repository/athena/athena-jdbc/2.0.7/
wget -O ~/.m2/repository/athena/athena-jdbc/2.0.7/athena-jdbc-2.0.7.jar 
:deps {athena/athena-jdbc {:mvn/version "2.0.7"}
but if I add it via local/root - tools.deps starts to complain about wrong data in pom :deps {athena/athena-jdbc {:local/root “lib/athena-jdbc.jar”} why is such difference? is there a way to add jar as from .m2 but from within the project?

ghadi14:07:19

if you get an error, can you post it in a snippet (COMMAND-SHIFT-ENTER) @kirill.salykin

kirill.salykin14:07:49

yes, one moment

ghadi14:07:51

I would like to see the error from when you add it via :local/root

ghadi14:07:40

ok this is what I suspected

ghadi14:07:23

when tools.deps uses a local jar with :local/root && the jar contains an internal pom.xml, it will try to read the pom and fetch dependencies

kirill.salykin14:07:37

shall I remove all poms?

ghadi14:07:51

yeah you could

kirill.salykin14:07:04

and why it doesnt try to do it when reading from .m2?

ghadi14:07:04

only one pom will matter, I forget the exact path

ghadi14:07:37

it will try to read the pom in .m2 - but not the pom within the jar, the one next to the jar if present

ghadi14:07:46

Maybe ^, I forget the exact details

kirill.salykin14:07:56

there is no pom with the jar

ghadi14:07:10

But anyways, if it goes through the .m2 path that's a different handler entirely -- uses Maven Resolver

kirill.salykin14:07:15

only this published by aws

ghadi14:07:34

kill the pom from the jar and you can use it in local/root

kirill.salykin14:07:13

does it make sense to add some flag to force tools.deps not try to fetch deps defined in pom? what do you think?

kirill.salykin14:07:56

eg

{:deps {jdbc {:local/root "...", :ignore-pom? true}}}

ghadi14:07:36

I'll have to check with Alex about why it does that in the first place

ghadi14:07:44

before making solutions

kirill.salykin14:07:58

of course, just a little proposal

kirill.salykin14:07:02

thanks a lot for help

ghadi14:07:52

😂 been pasting that everywhere ^

seancorfield15:07:21

Can you specify the JAR in :paths and not worry about dependency resolution?

ghadi15:07:05

^^^ oh of course

kirill.salykin16:07:27

Oh, I ll try, thanks!

alexmiller16:07:04

If you’re using a jar, that has transitive dependencies, how else are you going to satisfy those deps?

ghadi16:07:56

most of them don't have transitive deps @alexmiller -- the usecase is usually downloading some database driver that is self-contained in the jar

ghadi16:07:25

if you were using bare java, you'd put it on the classpath directly

ghadi16:07:38

which means, use :paths

alexmiller16:07:51

yes, tools.deps purpose is to build out transitive deps, and it will do so with local jars as well. The no deps case is kind of the base case and it doesn’t matter

kirill.salykin16:07:33

Thanks for clarification