Fork me on GitHub
#depstar
<
2020-09-11
>
zilti08:09:37

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 đź‘Ť

cap10morgan15:09:37

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

seancorfield16:09:33

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

cap10morgan17:09:29

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.

seancorfield17:09:50

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.

seancorfield21:09:09

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

seancorfield21:09:02

This should have always worked

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

seancorfield21:09:11

(in :main-opts)

markbastian21:09:33

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!

seancorfield21:09:33

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.

seancorfield21:09:18

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

markbastian21:09:31

That explains it.

seancorfield21:09:35

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

markbastian21:09:39

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.

seancorfield21:09:09

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.

markbastian21:09:13

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

seancorfield21:09:42

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

markbastian21:09:53

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

markbastian21:09:08

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