CLJS-418: Unspecified dependency on google-closure-library-third-party

120 views
Skip to first unread message

Stuart Sierra

unread,
Nov 16, 2012, 8:29:38 PM11/16/12
to clo...@googlegroups.com
http://dev.clojure.org/jira/browse/CLJS-418

We currently distribute the Google Closure Library in two separate JARs: the main library and the third-party extensions. We do this because the third-party extensions are covered by different licenses.

But, as it turns out, various classes in the main library have explicit dependencies on things in the third-party extensions. See See also this G.Closure mailing list discussion:
https://groups.google.com/d/msg/closure-library-discuss/4DG-XJn0s4E/i7nlq84V41kJ

As a result, the ClojureScript browser-connected REPL has a transitive dependency on the Google Closure Library third-party extensions. This manifests as an error in script/cljsc and a NullPointerException in lein-cljsbuild.

It seems that the dependency on third-party extensions is unavoidable. There are several possible fixes:

1. Release a new G.Closure Library JAR with a *declared dependency* on the third-party extensions JAR. This best reflects the *actual* dependency relationships.

2. Release a new G.Closure Library JAR with the third-party extensions included in the JAR. This would make it harder to exclude the third-party-licensed code from projects which do not actually require it.

3. Release a new version of ClojureScript with a declared dependency on the third-party extensions JAR. This makes the dependency more visible to ClojureScript developers.

Regardless of the approach taken, developers can always use explicit dependencies/exclusions to choose which version of the G.Closure library to include in their projects.

Stuart Sierra

unread,
Nov 16, 2012, 8:37:24 PM11/16/12
to clo...@googlegroups.com
I should mention, there's an easy temporary fix: just add the third-party library as a dependency in your project:

    ;; In :dependencies vector of Leiningen's project.clj
    [org.clojure/google-closure-library-third-party "0.0-2029"]

-S

Stuart Sierra

unread,
Nov 17, 2012, 3:34:34 PM11/17/12
to clo...@googlegroups.com
The real question I'm hoping somebody can answer is: what changed to cause this? The G.Closure library or ClojureScript?

-S

Herwig Hochleitner

unread,
Nov 18, 2012, 4:43:26 PM11/18/12
to clo...@googlegroups.com
In the case of the dependency in crosspagechannel, relevant to the browser repl, svn blame tells me that in commit r1816, the dependency to goog.async.Deferred got added to xpc: http://code.google.com/p/closure-library/source/diff?spec=svn1816&r=1816&format=side&path=/trunk/closure/goog/net/xpc/crosspagechannel.js&old_path=/trunk/closure/goog/net/xpc/crosspagechannel.js&old=1814

At that point in time, goog.asyncDeferred was in third_party, just as it is now: http://code.google.com/p/closure-library/source/browse/trunk/third_party/closure/goog/mochikit/async/deferred.js?r=1816

It's regrettable, that google doesn't follow a policy of not depending on third_party from core - what's the point of third_party then anyway - but in the face of that, I'd recommend declaring the dependency and be done with it.


2012/11/17 Stuart Sierra <the.stua...@gmail.com>
The real question I'm hoping somebody can answer is: what changed to cause this? The G.Closure library or ClojureScript?


-S

--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply all
Reply to author
Forward
0 new messages