Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get rid of shared classpath indexing #584

Closed
thheller opened this issue Oct 29, 2019 · 2 comments
Closed

Get rid of shared classpath indexing #584

thheller opened this issue Oct 29, 2019 · 2 comments

Comments

@thheller
Copy link
Owner

The classpath indexer checks all classpath entries and looks for CLJS/JS source files and keeps a central index. This is shared among all builds. I added this because I wanted to "query" the classpath to search for specific things (eg. find all namespaces using cljs.pprint) and a few other things.

This however is pointless for builds themselves since they only look up things by name and don't generally need to "search". The test targets search but that should be an independent function and not something done by default.

The indexing is a problem because lots of libraries include a bunch of files they shouldn't include. Often that includes a full set of :none optimized CLJS build output which then confuses the indexer and leads to annoying startup warnings

[2019-10-29 12:04:18.093 - WARNING] provide conflict for #{cljs.reader} provided by cljs/reader.cljs and {"/private/js/out/cljs/reader.js" #{cljs.reader}}
[2019-10-29 12:04:18.094 - WARNING] provide conflict for #{cljs.pprint} provided by cljs/pprint.cljs and {"/private/js/out/cljs/pprint.js" #{cljs.pprint}}
[2019-10-29 12:04:18.095 - WARNING] provide conflict for #{cljs.pprint} provided by cljs/pprint.cljc and {"/private/js/out/cljs/pprint.js" #{cljs.pprint}}

There still seem to be cases where the "bad" compiled files are picked over the actual sources.

Indexing is also a pretty wasteful on projects with large amount of dependencies. In general the indexing of .jar files is a bad idea and should not be done for builds. Just direct lookups by name as the default impls do.

@thheller
Copy link
Owner Author

thheller commented Nov 3, 2019

Just so I don't forget myself.

The classpath indexing is mostly done because of Closure JS code where any given name may not match to a specific filename. Multiple names may be defined in one file. There is also no sort real naming convention.

Could just index .js files and skip others or just load goog/deps.js like CLJS does and enforce strict naming rules otherwise.

@thheller
Copy link
Owner Author

Got rid of it in 2.9.0. The classpath is still indexed looking for .js files only though. Will get rid of that separately at some point too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant