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

Treat descendants of classpath dir as classpath #276

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

werenall
Copy link

@werenall werenall commented Dec 4, 2020

Hello!
Here in Magnet we noticed that figwheel complained about a path not being on classpath despite the that that it was held in resources/ that were added to resources path. Then we found the issue #221 that we believe is the same thing. We came up with this solution where we not only check for exact match in classpath but for any known classpath that is a (0, x) substring of the canonical path in question.

[Re #221]

@bhauman
Copy link
Owner

bhauman commented Feb 11, 2021

Sorry for not getting back sooner. I would need the specific complaint and situation. If its complaining about the target directory not being on the classpath. Then this solution won't work if you are using Figwheels server to serve your application. If you are using your own server then I would set :helpful-classpaths false so that these warnings will go away.

@bhauman
Copy link
Owner

bhauman commented Feb 11, 2021

You can use :helpful-classpaths false in your figwheel config to turn these helpers off.

@iarenaza
Copy link

iarenaza commented Jun 8, 2021

Hi @bhauman

thanks for looking into this. Unfortunately setting :helpful-classpaths to false turns the helpers off, but the warnings don't go away as you said.

Looking at https://github.com/bhauman/figwheel-main/blob/v0.213/src/figwheel/main.cljc#L2014-L2032 you can see that if the target directory is considered to be outside of the classpath and doesn't exist, then we get a warning whether :helpful-classpaths is true of false (a different warning in each case, but a warning nonetheless).

And looking at https://github.com/bhauman/figwheel-main/blob/v0.213/src/figwheel/main.cljc#L2035-L2046 something similar happens: either we get the warning from warn-that-dir-not-on-classpath if :helpful-classpaths is true, or we get the warning from lines 2041 to 2046.

@timothypratley
Copy link
Collaborator

@iarenaza where would you like to go with this PR?
It seems to me that the correct change is to suppress the warning when the flag is set to false?
If so would you mind updating the PR to reflect this?

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

Successfully merging this pull request may close these issues.

None yet

4 participants