atomisthq / jibbit

Dockerless Clojure Image builds using deps.edn
Eclipse Public License 1.0
111 stars 9 forks source link

aot does not work correctly due to outdated tools.build #10

Closed gnarroway closed 2 years ago

gnarroway commented 2 years ago

Have been trying out jibbit and there are various strange behaviours

jibbit: 0.1.13 tools.build: 0.7.5

Does not work without :aot

Class files are not included in the jar when using :aot

could not find or load main class

I've spent time debugging the 2nd issue and it seems to be due to using tools.build 0.7.5, where src-dirs must be provided explicit as they are not inferred from the basis (aka paths in deps.edn). I can confirm that using tools.build 0.8.1 directly, the compile-clj function generates the class files correctly even without specifying src-dirs (which is how jibbit uses it).

Alternatively, allowing src-paths to be provided as an arg could work around it, though is a bit ugly.

slimslenderslacks commented 2 years ago

@gnarroway - there was also a problem that first sprang up in 0.7.5 with some transitive dependencies pulled in by maven. It introduced a conflict between jib and maven (something to do with com.google.guava/guava). It really broke a lot actually. I discovered it while trying to upgrade to v0.8.1 of tools.build. I think I know the exclusion that will fix this, and it should fix everything for 0.7.5 as well.

I was planning on doing a 0.1.14 with 0.8.1 and could probably do that tomorrow morning. Are you okay with 0.8.1 of tools.build?

gnarroway commented 2 years ago

0.8.1 sounds good. As you said there seems to be some conflicts that need to be resolved though (I just tried bumping the dep and other things broke). Might be a good opportunity to add some initial tests to the CI so the common use cases can be validated proactively as the various moving parts (docker/jib/tools.build) change.

Thanks!

gnarroway commented 2 years ago

By the way, everything seemed to work for me by setting up my alias like:

slimslenderslacks commented 2 years ago

Ya, that makes sense. I've now moved v0.1.14 on to use 0.8.1 and I've let jib own that guava dependency by putting an exclusion on the tools.build dep

https://github.com/atomisthq/jibbit/blob/main/deps.edn#L5

You should be able to just move on to v0.1.14 now and I think your transitive deps will be right again.