Skip to content

Commit 18d96f7

Browse files
ilmottayevh-berdnyk
authored andcommitted
Fix: resolve our Clojure source dependencies first in the classpath (#17919)
In PR #17867 we have a namespace named schema.core, but this namespace is taken by library prismatic/schema already (see https://github.com/plumatic/schema/tree/master/src/cljc/schema), a library used by our direct dependency on bidi 2.1.6. This leads to a broken build where the ClojureScript compiler reports undeclared vars (https://clojurescript.org/reference/compiler-options#warnings). We change the order Java resolves dependencies via the classpath mechanism. We now first resolve our own Clojure sources, and then project dependencies.
1 parent 67e3a78 commit 18d96f7

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

nix/mobile/jsbundle/default.nix

+6-3
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,12 @@ stdenv.mkDerivation {
6767
'';
6868
buildPhase = ''
6969
# Assemble CLASSPATH from available clojure dependencies.
70-
# We append 'src' so it can find the local sources.
71-
export CLASS_PATH="$(find ${deps.clojure} \
72-
-iname '*.jar' | tr '\n' ':')src"
70+
# We prepend 'src' so it can find the local sources and prioritize
71+
# our own namespaces over dependencies, given that indirect dependencies
72+
# can also cause naming conflicts (e.g. prismatic/schema already uses
73+
# namespace schema.core).
74+
export CLASS_PATH="src:$(find ${deps.clojure} \
75+
-iname '*.jar' | tr '\n' ':')"
7376
7477
# target must be one of the builds defined in shadow-cljs.edn
7578
java -cp "$CLASS_PATH" clojure.main \

0 commit comments

Comments
 (0)