-
Notifications
You must be signed in to change notification settings - Fork 202
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
Relative path for compiler plugin while using sbt >= 1.4.0 breaks compilation. #1421
Comments
Thanks for finding this! I will need to take a look at this soon. |
Is this the reason for scalameta/metals#2279 ? |
I don't believe so. I still don't know what's going on there. When I compare the json files for 1.4.2 and 1.4.3 all of the sbt source jars are missing. However, when I checked they were published, so I have no idea why as of 1.4.3 the sources aren't getting included. |
So it looks like this may be wart remover specific. This commit is the one that seems to have caused it wartremover/wartremover@fadeadc since they needed to go away from the absolute path in relation to this sbt/sbt#6027. |
Is that relative path relative to the workspace? Maybe we could detect if a path is relative and try to do |
We already do something similar here: https://github.com/scalacenter/bloop/blob/master/integrations/sbt-bloop/src/main/scala/bloop/integrations/sbt/SbtBloop.scala#L616 We could see if an option starts with |
Because of Windows and its |
Right, thanks @sjrd ! As always I forgot about windows 😓 |
Otherwise this doesn't work, looks like Bloop and sbt's working dir have a mismatch? Fixes scalacenter#1421 finally
Otherwise this doesn't work, looks like Bloop and sbt's working dir have a mismatch? Fixes scalacenter#1421 finally
I do that 4x a day. |
I've noticed that when using sbt >= 1.4.0 and
sbt-bloop
, there is a difference in how a compiler plugin is listed underproject.scala.options
in the bloop json file. We'll use wart remover as an example. When using sbt 1.3.13 and wart remover the path to the plugin is absolute and pointing towards my coursier cache. However, in sbt >= 1.4.0 it's a relative path to/target/compiler_plugins/<plugin>
. For example using 1.3.13Using >= 1.4.0
This causes issues when compiling:
If the path is changed to an absolute path pointing in the target directory, then there is no problem. I'm unsure if that path is given from sbt in this manner, if Bloop is in charge of getting it from sbt and making sure it's absolute, or even something else.
You can reproduce this by the following steps
g8 scala/hello-world.g8
addSbtPlugin("org.wartremover" % "sbt-wartremover" % "2.4.13")
addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.4.5-8-6cc6911d")
sbt bloopInstall
bloop compile $(bloop projects)
The text was updated successfully, but these errors were encountered: