Fork me on GitHub
#depstar
<
2020-10-19
>
kenny18:10:43

Any idea why an uberjar build would get stuck on "Copying pom.xml to META-INF/maven/citadel/citadel/pom.xml"? It ran for 10 minutes before the CI killed the job. I can repro it locally too. Ran like this. v1.1.128

clojure -J-Dclojure.main.report=stderr -R:uberjar -m hf.depstar.uberjar citadel-standalone.jar -C --main cs.citadel --verbose

seancorfield18:10:39

@kenny Since that's the last thing it does before exiting, I wonder if you have some top-level defs in your code that are kicking off execution of something that is preventing the process from terminating?

seancorfield18:10:28

Is your project somewhere public, where I can take a look?

kenny19:10:27

That does seem possible and definitely needs to be fixed. It's something new occurring in an absolutely massive PR. Unfortunately is proprietary code. Any thoughts on how to find something like that if that was the issue?

seancorfield19:10:18

If it is successfully building the JAR before that PR and "hanging" on building the JAR with that PR in place, that would clearly point at something in the PR. Beyond that, pretty much impossible to tell without access to the code.

kenny19:10:00

Yep. Current PR changes: +8,643ย โˆ’5,343 ๐Ÿ˜…

kenny19:10:27

Curious as to why that's the location of the pause in uberjar build though. I would've thought it'd occur during compilation.

seancorfield19:10:22

Sounds like it is hanging at exit -- which is common if your code is starting up processes when namespaces are loaded (as in compilation).

seancorfield19:10:37

Try removing the -C --main cs.citadel options and seeing if it'll complete in a timely manner -- that would just copy code without loading any namespaces, and that would confirm it is some top-level def in the PR.

kenny19:10:44

Yep - no hang with that. Shoot, this will be quite the search...

seancorfield19:10:27

At least you're only looking for top-level def forms that were added (or changed)... ๐Ÿ™‚

seancorfield19:10:40

Or a top-level block of code I guess (even worse).

kenny19:10:52

Comment stuff out until it works. Tried and true method ๐Ÿ™‚ Thankfully the feedback cycle is only 15-20s.

seancorfield19:10:45

depstar doesn't (currently) call (shutdown-agents) which it probably should when AOT is requested, which might mitigate this problem in some situations -- but it's better not to have to do that ๐Ÿ˜

kenny19:10:21

Worked it all the way back using the comment method. Adding uncomplicate.neanderthal.native to my require hangs the jvm. Commenting it out succeeds with no hang.

kenny19:10:17

No clue why. We did bump the neanderthal version in this PR so that must be it.

seancorfield19:10:05

If you want to try a quick tweak I committed: seancorfield/depstar {:git/url "" :sha "2a5b903fa249ac42ace66a875b6eba1b29fe1519"} -- that calls (shutdown-agents) at the end.

kenny20:10:08

That'd only cause a hang for 30 or 60s right?

seancorfield20:10:24

Yeah, up to 60 seconds, but I figured it might be worth a try.

kenny20:10:09

Worked it back to the neanderthal version now. 0.35.0 works and 0.36.0 and later hang.

kenny20:10:18

^ diff between 0.35.0 and 0.36.0. Will try your tweak real quick.

kenny20:10:38

Ha! That was it! Using the depstar with shutdown-agents doesn't cause any hang.

seancorfield20:10:34

Naughty code in Neanderthal there but glad to hear the depstar tweak fixed it. I'll cut 1.1.132 later today I expect with that fix in it (and then I'll update clj-new to use that updated version ๐Ÿ™‚ )

kenny20:10:03

That is quite odd. That lib does some crazy stuff so I'll give him the benefit of the doubt ๐Ÿ™‚

kenny20:10:17

Anyway, thanks for the help Sean ๐Ÿ™‚

cch121:10:34

Iโ€™m new to depstar and Iโ€™m having trouble understanding how transitive dependencies are packaged into a jar file. Iโ€™m building a library that depends on ring/ring-codec (a maven dependency), but the generated jar file does not include the transitive dependency. Is this by design? If so, are consumers of my lib required to add a dependency on ring-codec themselves? Hereโ€™s how I invoke depstar: clojure -M:depstar -m hf.depstar.jar janus.jar. My libโ€™s deps.edn has a :deps section that mentions ring-codec. The alias for depstar itself is straight from the github README.

seancorfield22:10:33

Uberjars get transitive dependencies. Thin jars get just the project source code.

seancorfield22:10:39

This is the exact same behavior as Leiningen and Boot, which also both produce thin jars and uberjars.