boot-clj / boot-clj/boot-cljs

ClojureScript expects populated java.class.path on Java 9 and newer in order to use externs

Open
#197 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Clojure
Stars
176
Forks
40
PR merge metrics
No merged PRs in 30d

Description

This is essentially the issue that was reported on clojurescript itself as CLJS-2529: https://clojure.atlassian.net/projects/CLJS/issues/CLJS-2529
And subsequently fixed in clojure/clojurescript@8670cc40cf09f90f1d36cb4bf0a2c68713fb1d68

However, that fix expects `java.class.path` to contain all relevant resources including extern JS files (when on Java 9+). That's not true for boot, where it only contains the boot executable. As a result externs remain ignored on Java 9+ when compiling as part of a boot build.

I'm not entirely sure how to best fix this. I've experimented with a hack that comes down to doing `(System/setProperty "java.class.path" (get-env :fake-class-path))` before running the `cljs` task. This appears to work (externs are used etc) but I'm not sure what side effects it might have on other consumers of that classpath property. If this step was performed inside boot-cljs its scope could be restricted to the cljs build more easily.

Contributor guide

Open the contributing guide

Research direction

Start with the upstream ClojureScript fix for CLJS-2529 and trace the boot-cljs cljs task, including how fake-class-path and java.class.path are populated. Determine a scoped approach that preserves relevant extern JS resources on Java 9 and newer, then verify that externs are used during a boot ClojureScript build without changing unrelated classpath consumers.

Written by the indexing model from the issue text.

Assessment

Tech stack
clojure, javascript
Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.