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

+1 vote
in ClojureScript by

There's an old bug that got reports of other people seeing too, that I now hit again, this time with a deps.edn project and in a CI setup. The old bug: https://github.com/emezeske/lein-cljsbuild/issues/490 - note the other people reporting that renaming the source directory or cloning toa differently named directory was a work-around.

Here's a rerun of the code at https://github.com/clojure/clojurescript/blob/r1.10.520/src/main/clojure/cljs/closure.clj#L1851 with the actual values replaced in:

cljs.closure=> *lp
cljs.closure=> *p
cljs.closure=> (subs *p (+ (inc (.lastIndexOf *p *lp)) (.length *lp)))

What eventually throws the exception is the (io/file out-dir out-name) call here:

because it's getting a path as the second argument beginning with "/" in out-name, returned by the rel-output-path call.

The openlayers dependency came from this line in deps.edn:

cljsjs/openlayers {:mvn/version "4.4.1-1"}

1 Answer

0 votes

Is there a corresponding JIRA ticket open for this issue? Patch also welcome if you've gotten to the bottom of it.


Thanks a lot for the response!

No JIRA ticket yet, I got referred here by folks on #clojurescript in Clojurians to triage the issue, and then someone in the know would open the JIRA issue if warranted.

IIRC it wasn't immediately obvious to me what relative part of the subpath the code was trying to get in that subs expression, and what significance the used path would have, so I didn't get as far as a fix.
I've started looking at this but the above not really a full repro case. Clearly we're getting unexpected values passed to `lib-rel-path`, we need to understand how that's happening. Can you reproduce this outside of CI? Thanks.
Hello again,

Thanks for looking at the bug. I made this repro that works in Docker so should be environment independent:

To use, do

0. paste the above gist to a file called Dockerfile

1. docker build -t cljs-bug-repro .

2. docker run -it cljs-bug-repro

3. bash repro.sh

It might also reproduce on your dev environment outside docker if you recreate the same nested subdirectory for the build dir and do the git checkout and run clojure -A:test like in the Dockerfile.