print a warning when :externs file paths can't be found.

Description

clojurescript silently ignores missing externs files possibly leading a developer to chase their tail.

Presently it can be very confusing using advanced compilation if you have made a mistake in the path name of one of your :externs files. This patch makes the compiler print a warning on stderr so you can quickly determine the cause of the broken advanced compilation output.

As a side effect, when doing a basic lein-cljsbuild a warning is always printed:

```
WARNING: js resource path closure-js/externs does not exist
```

This is because lein-cljsbuild quietly adds this extra path to your :externs listing without you knowing.

Environment

Linux 64bit

java version "1.7.0_65"
OpenJDK Runtime Environment (IcedTea 2.5.3) (7u71-2.5.3-0ubuntu0.14.04.1)
OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode)

Activity

Show:
David Nolen
March 13, 2015, 1:33 PM
David Nolen
March 14, 2015, 11:55 AM

The solution does not work for cljsbuild. It's unclear why there so much machinery in place over the approach taken for deps.clj.

David Nolen
March 15, 2015, 4:37 PM
import
March 23, 2015, 8:50 AM

Comment made by: retrogradeorbit

This lein-cljsbuild issue is what made me make it just a warning initially, and not a hard error like raising IllegalArgumentException does. Though I agree it should be a hard error. If we start with a warning, it enables the immediate problem for the developer to be resolved, and leaves a wart that the cljs-build project can then see that need fixing on their end. Then when that end is fixed it could be made a hard error. If cljsbuild is fixed fairly soon then all is well, but if it takes a long time, a warning might be a good first step.

Mike Fikes
November 20, 2017, 2:06 AM

Patch no longer applies. (Also it doesn't work with {{git am}}—see https://clojurescript.org/community/patches.)

Assignee

David Nolen

Reporter

import

Approval

None

Patch

Code

Fix versions

Affects versions

Priority

Minor