tailrecursion / ring-proxy

HTTP proxy ring middleware for Clojure web applications.
47 stars 14 forks source link

AOT Compilation locks down dependencies #8

Closed kbaribeau closed 10 years ago

kbaribeau commented 10 years ago

I'm not sure if this is an issue, or just a report of an ugly situation I ran into when trying to use ring-proxy.

It appears though that since :main was included in project.clj in this commit the ring-proxy jar includes many classes that actually belong to ring. This means users are no longer able to try and mix ring-proxy with any version of ring other than the one it had been compiled against, which (IMO) is unfortunate.

I wrote up a quick github repo to reproduce the specific error I was seeing yesterday here. It may be of interest.

So far, my workaround is just to use ring 1.1.8; but I didn't initially expect that a project this small would have major problems with an upgrade to 1.2.1.

Do you have any thoughts on this? I haven't encountered AOT compilation in clojure before, maybe these are just normal issues that everyone deals with, but I had expected :exclusions in leiningen to generally work with small libraries.

micha commented 10 years ago

I'll remove the :main from project.clj. That was the wrong way to do it anyway. Thanks for reporting the issue!

micha commented 10 years ago

Fixed in 92d6d5035c50eafa3ac0173411e6577222adc14d

kbaribeau commented 10 years ago

Hey, so compiling this locally looks great, but the clojars release appears to still have AOT stuff in the jar.

~/code/ring-proxy (master)$ curl -s https://clojars.org/repo/tailrecursion/ring-proxy/2.0.0-SNAPSHOT/ring-proxy-2.0.0-20140424.150236-4.jar | tar zt - | wc -l
    1080
~/code/ring-proxy (master)$ tar ztf target/ring-proxy-2.0.0-SNAPSHOT.jar | wc -l
       8

You might have to do lean clean or rm -rf target/ before deploying?

micha commented 10 years ago

Whew! I think we've got it right now :)

kbaribeau commented 10 years ago

Yup, looks good to me now.

Thanks!