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

git/directory dependencies don't work #12

Open
SevereOverfl0w opened this issue Jul 7, 2019 · 3 comments
Open

git/directory dependencies don't work #12

SevereOverfl0w opened this issue Jul 7, 2019 · 3 comments

Comments

@SevereOverfl0w
Copy link

For some reason the loader can't find these while loading the clojure sources, but io/resource works. So I think it's either ShimDandy's loading strategy or the fact that clojure.lang.Compiler/LOADER is bound to an incorrect classloader.

@SevereOverfl0w
Copy link
Author

A bit more research has yielded that clojure.lang.Compiler/LOADER is a DynamicClassLoader that derives from the correct JCL. Calling (.getResource (var-get clojure.lang.Compiler/LOADER) "cognitect/test_runner.clj") yields a result.

This leaves me quite confused as to why require doesn't work!

@SevereOverfl0w
Copy link
Author

SevereOverfl0w commented Jul 8, 2019

Clojure uses a stream for loading: https://github.com/clojure/clojure/blob/28b87d53909774af28f9f9ba6dfa2d4b94194a57/src/jvm/clojure/lang/RT.java#L378 not .getResource. This implies there's a bug in JCL for .getResourceAsStream for on-disk files.

user=> (with-runtime r (.getResourceAsStream (clojure.lang.RT/baseLoader) "cognitect/test_runner.clj"))
nil
user=> (with-runtime r (.getResource (clojure.lang.RT/baseLoader) "cognitect/test_runner.clj"))
#object[java.net.URL 0x715d6168 "file:/home/dominic/.gitlibs/libs/com.cognitect/test-runner/209b64504cb3bd3b99ecfec7937b358a879f55c1/src/cognitect/cognitect/test_runner.clj"]

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