-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Separate project for java sources in library #6085
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
Conversation
|
WIP, mostly submitted to enable running the benchmarks |
|
Benchmarks are flat except for "scala", which seems to get a ~2% speedup. I'd like to hear opinions how / if to move this forward. The change as proposed uglifies the build. It will also require a few fixes, as the "quick" classfiles of the library are now split up in |
I thnk we're seeing some jitter in that, we probably need more forks :( |
Another approach would be to define We could them revert to |
|
Nice idea! I was trying to come up with something along these lines. There are two other files that currently require mixed compilation (
I'll keep an eye on that and experiment a bit |
6d96f13 to
8622cff
Compare
|
Pushed a WIP with shims. It works when I do it on the command line but sbt crashes because of the missing classfiles for the shims @dwijnand ideas? Can we disable dependency analysis for these classes? |
|
(It works if I remove the |
I had a look and couldn't find any way..
If the compilation is JavaThenScala then isn't this safe? |
|
Thank you for checking, Dale! I guess it's safe to rely on overwriting the classfiles. In case it doesn't happen for some reason and we end up running with the stubs, things should immediately crash at run / test time. |
|
This works, but leaves some new warnings in the sbt log. It's because sources are pulled in with javac's Is there a way to add sources to |
|
From my reading in so just move them into |
|
Having them in src/library would give double def errors for people doing |
|
Personally I've not done that, but I'm equally fine with any solution. |
|
@lrytz Finally getting back to this one. How about we just cut the compile time dependency from Java sources to Scala sources? I've implemented Doing this work on 2.13 will make life easier, as we can move things around without binary compat breakages. |
I've added some commits to this end. We can actually define the bootstrap methods in Scala if we rely on the static forwarders. |
|
Thanks @retronym, that looks like a better way forward. |
Split java sources from the library into a separate sbt
project to avoid mixed compilation. This enables inlining
code that uses types defined in these classes, which is
quite common.
See scala/scala-dev#428
Certain Java sources cannot be moved (
JFunctionN$mc...)as they depend on Scala sources in the library, so we have
to keep mixed compilation for the library project itself.