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
scala-xml dependency should be provided #5689
Conversation
Nothing should transitively depend on the scala-xml module except for scaladoc and library-all. Compiler needs scala-xml as a build dependency, but not at runtime. The user is supposed to provide scala-xml as a dependency at runtime. This fixes an issue where the classpath in SBT shadows the scala-xml module, see scala/scala-module-dependency-sample#14. Unfortunately, scaladoc needs to be pulled out of the compiler. This is a first attempt at mangling the build so that scaladoc is a separate jar. Following on, SBT will need to know how to run scaladoc as a separate jar.
sbt's
Not sure if there's a way to make this work without requiring a new, patched version of sbt. |
Not in my opinion there isn't |
ee5f9fd
to
c9a2e5e
Compare
Thanks, @ashawley. Since this requires a coordinated effort with sbt, I'm closing this for now to keep our PR queue in shape. We keep track of the issue at scala/scala-dev#291. |
(unmanagedResourceDirectories in Compile in LocalProject("repl")).value | ||
base ** ((includeFilter in unmanagedResources in Compile).value || "*.scala" || "*.psd" || "*.ai" || "*.java") pair relativeTo(base) | ||
}, | ||
// Include the additional projects in the scaladoc JAR: | ||
// Include the additional projects in the compiler JAR: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was correct the way it was btw, it means the jar of scaladocs of the compiler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I see, now. You're right. I had misunderstood. Thanks for reviewing that.
I looked in to how sbt needed to be patched, but I didn't get far. First, I tried to provide the separate scaladoc dependency to sbt's compiler interface. It failed because sbt is still compiling itself with 2.10
My naive attempt is ashawley/sbt@255b228 So that suggests fixing the scala-xml dependency with scala-compiler-doc in 2.13 would actually require a new 2.10 release with a separate scala-compiler-doc jar just for sbt. sbt would use that release of Scala 2.10 and the separate jar going forward. In addition to making the separate jar, the new scala 2.10 release would still, for compatibility sake, provide a scala-compiler with the scala-compiler-doc code in it. Will there be another 2.10 release of Scala to include this kind of a build change? If there is, I can try to research making the 2.10 Ant build change and then look in to whether patching sbt is possible. |
I don't think there would be a need for a new release of 2.10/2.11. The compiler bridge is compiled at runtime of using sbt (you might've seen before "compiling the compiler-interface for scala 2.11.8..."). So the place to add scala-compiler-doc is somewhere in the vicinity of compile/ivy/src/main/scala/sbt/compiler/ComponentCompiler.scala. |
Nothing should transitively depend on the scala-xml module except for
scaladoc and library-all.
Compiler needs scala-xml as a build dependency, but not at runtime.
The user is supposed to provide scala-xml as a dependency at runtime.
This fixes an issue where the classpath in SBT shadows the scala-xml
module, see scala/scala-module-dependency-sample#14.
Unfortunately, scaladoc needs to be pulled out of the compiler. This
is a first attempt at mangling the build so that scaladoc is a
separate jar. Following on, SBT will need to know how to run scaladoc
as a separate jar.
Previously #5609 for 2.11. For 2.13 is tracked at scala/scala-dev#291