-
Notifications
You must be signed in to change notification settings - Fork 928
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
sbt 1.0.4 puts the -sources.jar
and -docs.jar
in the compile
config in ivy.xml
#3784
Comments
This is a blocker for us to migrate the build of Scala.js to sbt 1. Currently our CI fails because of this issue, as can be seen in the PR scala-js/scala-js#3200. |
source and docs going into If this is causing interference with compiler plugin detection, that might be the buggy code. |
IIRC, the compiler plugin issue happened when
I think there was no issue when using the compiler plugin from a project using sbt 1.x itself. So if the changes in sbt/librarymanagement#25 were indeed correct, it seems that something needs to be fixed in 0.13.x for it to be able to correctly resolve artifacts published by sbt 1.x. |
Fixes sbt#3784 For Ivy repos, sbt 1.x publishes source and scaladoc JARs under `compile` configuration with types `src` and `doc` respectively. The current 0.13 implementation of `autoPlugins(...)` is not filtering them out correctly, and ends up including a source JAR as a compiler plugin.
Fixes sbt#3784 For Ivy repos, sbt 1.x publishes source and scaladoc JARs under `compile` configuration with types `src` and `doc` respectively. The current 0.13 implementation of `autoPlugins(...)` is not filtering them out correctly, and ends up including a source JAR as a compiler plugin.
Fixed in (upcoming - currently RC1) 0.13.17, with #3855 merged. |
To test with the fix for sbt/sbt#3784.
steps
Using the following
build.sbt
:Results in this gist: https://gist.github.com/sjrd/39b487f3f1f3abb4a5910f583e6d0e9a
problem
The ivy.xml published by sbt 1.0.4 declares the
src
anddoc
artifacts in thecompile
conf, instead ofsources
/docs
as it should.Concretely, this means that when one depends on such a project, the
-sources.jar
and-docs.jar
are downloaded and added to the compile-time and run-time classpaths!In the particular case of a scalac compiler plugin, since the
-sources.jar
also contains thescalac-plugin.xml
identifying the jar as a compiler plugin, depending on it with% "plugin"
causes two-Xplugin:
options to be passed to scalac: one forfoo.jar
and one forfoo-sources.jar
. Depending on which one comes first (which I have experienced is non-deterministic), scalac will succeed or fail to load the plugin.expectation
I expect the same behavior as sbt 0.13, which is also documented as an example of the Ivy documentation for
<artifact>
: thesrc
artifact should haveconf="sources"
and thedoc
artifact should haveconf="docs"
.notes
In addition to the really serious issue above, sbt 1.0.4 also exposes private configurations used by sbt in the ivy.xml, such as
compile-internal
.sbt version: 1.0.4
The text was updated successfully, but these errors were encountered: