Fix: resolve our Clojure source dependencies first in the classpath (#17919)
In PR https://github.com/status-im/status-mobile/pull/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.
This commit is contained in:
parent
2e2d15adfb
commit
17ebedd6b8
|
@ -67,9 +67,12 @@ stdenv.mkDerivation {
|
||||||
'';
|
'';
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
# Assemble CLASSPATH from available clojure dependencies.
|
# Assemble CLASSPATH from available clojure dependencies.
|
||||||
# We append 'src' so it can find the local sources.
|
# We prepend 'src' so it can find the local sources and prioritize
|
||||||
export CLASS_PATH="$(find ${deps.clojure} \
|
# our own namespaces over dependencies, given that indirect dependencies
|
||||||
-iname '*.jar' | tr '\n' ':')src"
|
# can also cause naming conflicts (e.g. prismatic/schema already uses
|
||||||
|
# namespace schema.core).
|
||||||
|
export CLASS_PATH="src:$(find ${deps.clojure} \
|
||||||
|
-iname '*.jar' | tr '\n' ':')"
|
||||||
|
|
||||||
# target must be one of the builds defined in shadow-cljs.edn
|
# target must be one of the builds defined in shadow-cljs.edn
|
||||||
java -cp "$CLASS_PATH" clojure.main \
|
java -cp "$CLASS_PATH" clojure.main \
|
||||||
|
|
Loading…
Reference in New Issue