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
"cljsjs/openlayers/development/"
cljs.closure=> *p
"/codebuild/output/src923210442/src/github.com/solita/mnt-teet/app/frontend/target/public/cljs-out/tests/l/events/eventtype.js"
cljs.closure=> (subs *p (+ (inc (.lastIndexOf *p *lp)) (.length *lp)))
"/src/github.com/solita/mnt-teet/app/frontend/target/public/cljs-out/tests/l/events/eventtype.js"

What eventually throws the exception is the (io/file out-dir out-name) call here:
https://github.com/clojure/clojurescript/blob/r1.10.520/src/main/clojure/cljs/closure.clj#L2023

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
by

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

by
Hello!

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.
ago by
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.
...