Welcome! Please see the About page for a little more info on how this works.

0 votes
in Clojure by
edited by

The 'read-cp' function in clojure.tools.deps.alpha.libmap.clj fails when attempting to split the path-in-repo string value with a regex pattern of File/separator. This is on line 41.

(str/split path-in-repo (re-pattern File/separator))

The File/separator evaluates to \\ on Windows, but for a regex pattern it needs to be \\\\

This works fine on Linux and Mac OS

1 Answer

0 votes
selected by
Best answer

I am sure Alex Miller, who I would guess is the most likely person authorized to make such a change, already knows this very well, but calling (re-pattern (str/re-quote-replacement File/separator)) where str is the typical alias to the clojure.string namespace is one fix.

Yeah, this is the right fix. Unfortunately, the add-lib branch is in a pretty weird spot right now as I am actively working on it. In particular there is some new (unreleased) code in master, and I've merged that into add-lib, so the tip of add-lib I think won't actually work with any released clj at the moment.
Actually this code is totally going away anyways and add-lib is not going to support building the lib map from java classpath going forward.
@alexmiller if you don't mind, what's the status of add-lib based on the recent clojure tooling changes? Is this functionality (which is very clearly not promising anything, being an experimental branch of an alpha library) something that you plan to discard? Or is there still somewhere on the roadmap the plan to be able to load libs from the REPL?