depstar

Discussion around https://github.com/seancorfield/depstar
zilti 2020-09-11T08:56:37.015500Z

Yea it was really weird... At first it only failed on our build server, and I thought "eh maybe my colleague updated something" and built it locally. Which worked at first. I remove all jars, classes, and even .cpcache on make clean so that can't be it. I am on the go right now, but I'll send an issue report later today 👍

cap10morgan 2020-09-11T15:24:37.017500Z

@seancorfield Would a PR adding an --omit-source option (like lein's) to depstar be welcome? I'm sort of doing it with the -X option, but would love to have something a little more comprehensive and less regex-copy-pasta-everywhere.

seancorfield 2020-09-11T16:52:33.021300Z

@cap10morgan Is the difficulty here making sure you only omit source in your own project? An AOT'd uberjar is going to contain a few source files from Clojure itself...

cap10morgan 2020-09-11T17:06:29.023Z

See, I wasn’t even aware of that. But it makes sense. :) So yeah, that’s good confirmation of my sneaking suspicion that my regex solution wasn’t quite right.

seancorfield 2020-09-11T17:10:50.024400Z

Another option to consider: do your compile manually and then build the uberjar with just the classes folder on the classpath, not the src folder.

seancorfield 2020-09-11T21:22:09.024700Z

@markbastian No idea what that "*" was for -- it's never been needed

seancorfield 2020-09-11T21:23:02.025400Z

This should have always worked

["-m" "hf.depstar.uberjar"
  "target/myproject-with-dependencies.jar"
  "--compile"
  "--verbose"
  "-m" "myproject.main"]

seancorfield 2020-09-11T21:23:11.025600Z

(in :main-opts)

2020-09-11T21:24:33.027800Z

I think my only issue was that the presence of the "" used to work and now made the jar .jar. As long as dropping the * fixes it, I'm good. I just wanted to make sure I wasn't screwing it up. Thanks!

seancorfield 2020-09-11T21:24:33.027900Z

I suspect that "*" was simply ignored before but the argument processing has been cleaned up so you can put the JAR file name after the options if you want.

seancorfield 2020-09-11T21:25:18.028900Z

(technically, you can put the JAR filename anywhere now, but it will likely assume the last non-option argument is the JAR name)

2020-09-11T21:25:31.029300Z

That explains it.

seancorfield 2020-09-11T21:25:35.029500Z

I could enhance that to complain about multiple JAR files I guess.

2020-09-11T21:26:39.030600Z

That would be great, but don't feel obligated. If filing a ticket would help you I'd be happy to. Thanks for the help, and thanks for depstar.

seancorfield 2020-09-11T21:27:09.031100Z

clojure -m hf.depstar.uberjar foo.jar bar.jar 
WARNING: When invoking clojure.main, use -M
Building uber jar: bar.jar
Processing pom.xml for {seancorfield/depstar {:mvn/version "1.1.104"}}
So, yeah, it silently ignores foo.bar here. I'll add an issue to fix it.

seancorfield 2020-09-11T21:28:10.032200Z

https://github.com/seancorfield/depstar/issues/38

2020-09-11T21:28:13.032400Z

Generally no big deal, but * followed by a thoughtless rm * could certainly ruin someone's afternoon.

seancorfield 2020-09-11T21:28:42.033100Z

I wonder if someone thought --compile took an argument that was a namespace wildcard?

2020-09-11T21:28:53.033400Z

Kind of a corner case since it would require errantly putting * after compile under that assumption.

2020-09-11T21:29:08.033800Z

That was what I thought months back when I was first working with depstar.