-
Notifications
You must be signed in to change notification settings - Fork 161
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
Automatic source discovery fails if script contains //DEPS #1502
Comments
Wow, that's definitely a nasty regression. Thanks for reporting that. |
Hmm actually, this is not a regression, it seems it was always like this. It's a behavior of the So when there's only a a But the moment you add a dependency the compiler invocation turns into this: If I manually add What's the behavior that we want here @maxandersen ? Should we allow auto-pickup of local sources or should we require explicit |
Autopickup sources is the path to least surprises. |
nice analysis! Basically what you are saying is that it works like javac was designed ...that default classpath is current directory... But adding . on every classpath feels wrong too. |
What is probably more right is to explore using i.e. add a WDYT? |
Parent directories for sources are now added to the compiler's source path so any types referenced in them that are available in the same directories can be found even when they are not explicitely mentioned in any `//SOURCES` lines. This also fixes the problem where adding a `//DEPS` line would cause the compiler to be unable to find those same types. Fixes jbangdev#1502
Parent directories for sources are now added to the compiler's source path so any types referenced in them that are available in the same directories can be found even when they are not explicitely mentioned in any `//SOURCES` lines. This also fixes the problem where adding a `//DEPS` line would cause the compiler to be unable to find those same types. Fixes jbangdev#1502
Btw, this problem is actually not related to |
So there's two additional issues here @maxandersen :
Seems to me then that we'd have to treat local source files differently than remote ones: we'd do the |
Parent directories for sources are now added to the compiler's source path so any types referenced in them that are available in the same directories can be found even when they are not explicitely mentioned in any `//SOURCES` lines. This also fixes the problem where adding a `//DEPS` line would cause the compiler to be unable to find those same types. Fixes jbangdev#1502
Parent directories for sources are now added to the compiler's source path so any types referenced in them that are available in the same directories can be found even when they are not explicitely mentioned in any `//SOURCES` lines. This also fixes the problem where adding a `//DEPS` line would cause the compiler to be unable to find those same types. Fixes jbangdev#1502
Parent directories for sources are now added to the compiler's source path so any types referenced in them that are available in the same directories can be found even when they are not explicitely mentioned in any `//SOURCES` lines. This also fixes the problem where adding a `//DEPS` line would cause the compiler to be unable to find those same types. Fixes jbangdev#1502
Describe the bug
Given a Foo.java script and a companion Bar.java at the same level and no explicit
//SOURCES Bar.java
directive in Foo.java, runningjbang Foo.java
will yield different results depending on the presence of//DEPS
directive or no.To Reproduce
Steps to reproduce the behavior:
jbang Foo.java
yields://DEPS
directive to Foo.java, like:jbang Foo.java
now yields:Expected behavior
JBang should be able to compile the same file, regardless whether
//DEPS
directives are present or not.JBang version
Additional context
Adding
//SOURCES Bar.java
prevents compilation failures when//DEPS
is presentThe text was updated successfully, but these errors were encountered: