Changing the order of classpath entry and not having paths be at the beginning of the CLASSPATH will break existing code that uses `(io/resource ...)` to load resources from the CLASSPATH. While in theory the order of the classpath should not matter, in practice it does, often involuntarily. Fighweel-main's default behavior is to load `public/index.html` which works fine if the local paths come first, but will fail if any other JAR has a `public/index.html` resource.
And as we learned, they do! Please consider going back to the old, defined behavior. All other build tools I know have - for good or bad - a defined CLASSPATH order. Thanks, Jochen On Monday, August 10, 2020 at 9:08:00 PM UTC-7 Alex Miller wrote: > Bunch of things here... > > Clojure maintains its own brew tap and a "stable" release that you can > obtain with `brew install clojure/tools/clojure` (the brew conventions > automatically find the prior repo based on that). That tap also includes > prerelease unstable versions that can be obtained with "@version" - more on > that is doc'ed in the readme for that repo. The current stable version is > 1.10.1.561. > > Homebrew core is what you are pulling from if you just do `brew install > clojure`. The formula there is no longer maintained by the Clojure team as > anyone can update it (and have, with changes we did not agree with). There > is no "ownership" model in homebrew-core. I would happily remove it from > there but they said they would not accept that PR. Recently, the > homebrew-core formula has been updated by members of the homebrew team to > newer prerelease (not yet stable) versions of clj. There is not really > anything we can do about this. > > The classpath difference is interesting. The classpath is a set of path > roots and in general the files in these paths should be mutually exclusive. > If the roots are mutually exclusive, then the classpath order is > unimportant (as the JVM will always find the same class/clj/resource file > regardless). Roots that include the same file are nearly always trouble and > the source of "jar hell" style problems. clj and deps.edn provide features > to cover most of the scenarios where users are typically tempted to use > ordering for replacement (:override-deps, :classpath-overrides, etc). > > Based on this, we did knowingly make a change since the last stable > release that effectively made the classpath unordered (all the roots go > through keys of a map at one point). To date, I had not seen any issues > with that, so this is a useful data point we can take into consideration. I > assume you're getting an index.html out of some library that's either > unimportant or accidentally included. For now, I'd recommend that you > continue using the latest stable version from the official Clojure homebrew > tap. > > Re the version - you can see the version with either `clj -h` (first line) > or `clj -Sdescribe`. > > Relevant links: > > * Clojure homebrew tap - https://github.com/clojure/homebrew-tools > * Official clj stable formula - > https://github.com/clojure/homebrew-tools/blob/master/Formula/clojure.rb > (what you get with `brew install clojure/tools/clojure`) > * Getting started/install doc - https://clojure.org/guides/getting_started > * Homebrew core - https://github.com/Homebrew/homebrew-core > * clj reference - https://clojure.org/reference/deps_and_cli (or see `clj > -h` or `man clj`) > > > On Monday, August 10, 2020 at 7:04:40 PM UTC-5 cloo...@gmail.com wrote: > >> P.S. There seems to be no *`clojure --version`* flag. Should this be >> added to the command line tool? >> >> >> On Mon, Aug 10, 2020 at 4:58 PM Alan Thompson <cloo...@gmail.com> wrote: >> >>> Hi. Just helped a colleague debug a vexing problem on a CLJS project >>> using Figwheel.Main. >>> >>> If we do *`brew install clojure/tools/clojure`*, it works: >>> >>> ~/work/tmp810/xanadu > clj --help >>> Version: *1.10.1.561* >>> >>> Usage: clojure [dep-opt*] [--] [init-opt*] [main-opt] [arg*] >>> clj [dep-opt*] [--] [init-opt*] [main-opt] [arg*] >>> >>> The clojure script is a runner for Clojure. clj is a wrapper >>> for interactive repl use. These scripts ultimately construct and >>> .... >>> >>> >>> Note that local ./resources etc are at the beginning of the classpath >>> >>> ~/work/tmp810/xanadu > clj -Spath >>> *resources:target:src/clj:src/cljc:src/cljs:test/cljs:test-figwheel-main* >>> :/Users/alanthompson/.m2/repository/com/cognitect/transit-java/0.8.332/transit-java-0.8.332.jar:/Users/alanthompson/.m2/repository/com/google/elemental2/elemental2-core/1.0.0-RC1/elemental2-core-1.0.0-RC1.jar:/Users/alanthompson/.m2/repository/org/clojure/data.json/0.2.6/data.json-0.2.6.jar:/Users/alanthompson/.m2/repository/org/clojure/clojure/1.10.1/clojure-1.10.1.jar:/Users/alanthompson/.m2/repository/day8/re-frame/test/0.1.5/test-0.1.5.jar:/Users/alanthompson/.m2/repository/commons-codec/commons-codec/1.11/commons-codec-1.11.jar:/Users/alanthompson/.m2/repository/cljsjs/material-ui-currency-textfield/0.8.6-0/material-ui-currency-textfield-0.8.6-0.jar:/Users/alanthompson/.m2/repository/org/clojure/tools.analyzer/1.0.0/tools.analyzer-1.0.0.jar:/Users/alanthompson/.m2/repository/com/bhauman/cljs-test-display/0.1.1/cljs-test-display-0.1.1.jar:/Users/alanthompson/.m2/repository/org/eclipse/jetty/jetty-xml/9.4.28.v20200408/jetty-xml-9.4.28.v20200408.jar:/Users/alanthompson/.m2/repository/com/bhauman/figwheel-repl/0.2.11/figwheel-repl-0.2.11.jar:/Users/alanthompson/.m2/repository/org/eclipse/jetty/jetty-servlet/9.4.28.v20200408/jetty-servlet-9.4.28.v20200408.jar:/Users/alanthompson/.m2/repository/ring/ring-devel/1.8.1/ring-devel-1.8.1.jar:/Users/alanthompson/.m2/repository/com/google/errorprone/error_prone_annotations/2.3.1/error_prone_annotations-2.3.1.jar:/Users/alanthompson/.m2/repository/org/clojure/tools.logging/0.3.1/tools.logging-0.3.1.jar:/Users/alanthompson/.m2/repository/org/clojure/core.specs.alpha/0.2.44/core.specs.alpha-0.2.44.jar:/Users/alanthompson/.m2/repository/co/deps/ring-etag-middleware/0.2.0/ring-etag-middleware-0.2.0.jar:/Users/alanthompson/.m2/repository/expound/expound/0.7.2/expound-0.7.2.jar:/Users/alanthompson/.m2/repository/org/clojure/spec.alpha/0.2.176/spec.alpha-0.2.176.jar:/Users/alanthompson/.m2/repository/com/cemerick/url/0.1.1/url-0.1.1.jar: >>> >>> .....<snip>..... >>> >>> >>> However, my colleague had accidentally typed *`brew install clojure`. >>> *This >>> caused a mysterious failure: >>> >>> ------------------- >>> ~/work/tmp810/xanadu > clojure --help >>> Version: *1.10.1.645* >>> >>> You use the Clojure tools ('clj' or 'clojure') to run Clojure programs >>> on the JVM, e.g. to start a REPL or invoke a specific function with data. >>> .... >>> >>> and the classpath >>> >>> ----------------- >>> ~/work/tmp810/xanadu > clj -Spath >>> DEPRECATED: Libs must be qualified, change deps-ancient => >>> deps-ancient/deps-ancient (deps.edn) >>> DEPRECATED: Libs must be qualified, change reagent => reagent/reagent >>> (deps.edn) >>> DEPRECATED: Libs must be qualified, change ns-tracker => >>> ns-tracker/ns-tracker (deps.edn) >>> DEPRECATED: Libs must be qualified, change camel-snake-kebab => >>> camel-snake-kebab/camel-snake-kebab (deps.edn) >>> DEPRECATED: Libs must be qualified, change bidi => bidi/bidi (deps.edn) >>> DEPRECATED: Libs must be qualified, change orchestra => >>> orchestra/orchestra (deps.edn) >>> DEPRECATED: Libs must be qualified, change cljs-ajax => >>> cljs-ajax/cljs-ajax (deps.edn) >>> DEPRECATED: Libs must be qualified, change expound => expound/expound >>> (deps.edn) >>> DEPRECATED: Libs must be qualified, change re-frame => re-frame/re-frame >>> (deps.edn) >>> DEPRECATED: Libs must be qualified, change re-frame-utils => >>> re-frame-utils/re-frame-utils (deps.edn) >>> DEPRECATED: Libs must be qualified, change cljs-bean => >>> cljs-bean/cljs-bean (deps.edn) >>> >>> /Users/alanthompson/.m2/repository/alandipert/storage-atom/1.2.4/storage-atom-1.2.4.jar:/Users/alanthompson/.m2/repository/com/google/errorprone/error_prone_annotations/2.3.1/error_prone_annotations-2.3.1.jar:/Users/alanthompson/.m2/repository/org/clojure/core.cache/1.0.207/core.cache-1.0.207.jar:/Users/alanthompson/.m2/repository/com/google/jsinterop/jsinterop-annotations/1.0.2/jsinterop-annotations-1.0.2.jar:/Users/alanthompson/.m2/repository/compliment/compliment/0.3.6/compliment-0.3.6.jar:/Users/alanthompson/.m2/repository/ring/ring-headers/0.3.0/ring-headers-0.3.0.jar:/Users/alanthompson/.m2/repository/cljs-bean/cljs-bean/1.4.0/cljs-bean-1.4.0.jar:/Users/alanthompson/.m2/repository/hawk/hawk/0.2.11/hawk-0.2.11.jar:/Users/alanthompson/.m2/repository/binaryage/devtools/1.0.0/devtools-1.0.0.jar:/Users/alanthompson/.m2/repository/org/eclipse/jetty/websocket/websocket-api/9.4.28.v20200408/websocket-api-9.4.28.v20200408.jar:/Users/alanthompson/.m2/repository/org/apache/httpcomponents/httpasyncclient/4.1.3/httpasyncclient-4.1.3.jar:/Users/alanthompson/.m2/repository/org/checkerframework/checker-qual/2.0.0/checker-qual-2.0.0.jar:/Users/alanthompson/.m2/repository/ns-tracker/ns-tracker/0.3.1/ns-tracker-0.3.1.jar:/Users/alanthompson/.m2/repository/cljsjs/react-select/2.4.4-0/react-select-2.4.4-0.jar:/Users/alanthompson/.m2/repository/org/javassist/javassist/3.18.1-GA/javassist-3.18.1-GA.jar:/Users/alanthompson/.m2/repository/com/google/protobuf/protobuf-java/3.11.1/protobuf-java-3.11.1.jar:/Users/alanthompson/.m2/repository/org/fusesource/jansi/jansi/1.16/jansi-1.16.jar:/Users/alanthompson/.m2/repository/com/cognitect/transit-clj/0.8.309/transit-clj-0.8.309.jar:/Users/alanthompson/.m2/repository/org/codehaus/mojo/animal-sniffer-annotations/1.14/animal-sniffer-annotations-1.14.jar:/Users/alanthompson/.m2/repository/org/apache/httpcomponents/httpclient/4.5.3/httpclient-4.5.3.jar:test-figwheel-main:/Users/alanthompson/.m2/repository/com/cognitect/transit-cljs/0.8.256/transit-cljs-0.8.256.jar: >>> .....<snip>..... >>> :/Users/alanthompson/.m2/repository/zprint/zprint/0.5.1/zprint-0.5.1.jar: >>> *resources* >>> :/Users/alanthompson/.m2/repository/org/clojure/tools.analyzer/1.0.0/tools.analyzer-1.0.0.jar:/Users/alanthompson/.m2/repository/re-frame/re-frame/0.10.5/re-frame-0.10.5.jar:/Users/alanthompson/.m2/repository/rewrite-cljs/rewrite-cljs/0.4.4/rewrite-cljs-0.4.4.jar:/Users/alanthompson/.m2/repository/net/cgrand/macrovich/0.2.0/macrovich-0.2.0.jar:/Users/alanthompson/.m2/repository/org/clojure/clojurescript/1.10.764/clojurescript-1.10.764.jar:/Users/alanthompson/.m2/repository/com/google/elemental2/elemental2-core/1.0.0-RC1/elemental2-core-1.0.0-RC1.jar:/Users/alanthompson/.m2/repository/org/eclipse/jetty/jetty-client/9.4.28.v20200408/jetty-client-9.4.28.v20200408.jar >>> >>> >>> with `resources` nearly at the end! This breaks Figwheel.Main, which >>> cannot find `index.html` correctly and puts up a bogus webpage of 2 words: >>> >>> *Debux Test* >>> >>> >>> which I assume is due to finding some other `index.html` earlier on the >>> classpath. >>> >>> Questions: >>> >>> >>> 1. What is the difference between the brew targets `clojure` and >>> `clojure/tools/clojure`? Can these be unified somehow? It seems >>> error-prone as-is. >>> 2. I assume the classpath change in 1.10.1.645 is a bug that needs >>> to be corrected? >>> 3. Is it possible this is a Figwheel.Main problem instead? >>> >>> >>> Thanks, >>> Alan >>> >>> >>> >>> >>> >>> -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/clojure/bed1beb9-ea43-40e2-b663-8ab508104b9bn%40googlegroups.com.