-
Notifications
You must be signed in to change notification settings - Fork 185
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
"Unable to find scalahost compiler plugin jar" error if remove explicit root project #200
Comments
Thank you for reporting! This is not great at all. I will investigate. |
This error was caused by a bad interplay between sbt-scalahost and sbt-scalafix. - sbt-scalahost inject stuff into scalacOptions and libraryDependencies. In scalacOptions, we call update.value, which relies on dependencies in libraryDependencies. - sbt-scalafix creates a a synthetic project "scalafix-stub" to fetch jars for scalafix-cli and sets the libraryDependencies to empty list but leaves scalacOptions unchanged. scalafix-stub/compile triggers scalafix-stub/scalacOptions which triggers update.value in sbt-scalahost. This commit sets scalacOptions of scalafix-sbt to empty list, avoiding the failed dependency resolution caused by sbt-scalahost.
This error was caused by a bad interplay between sbt-scalahost and sbt-scalafix. - sbt-scalahost injects stuff into both scalacOptions and libraryDependencies. In scalacOptions, we call update.value, which relies on the existence of dependencies in libraryDependencies. - sbt-scalafix creates a a synthetic project "scalafix-stub" to fetch jars for scalafix-cli and sets the libraryDependencies to empty list but leaves scalacOptions unchanged. scalafix-stub/compile triggers scalafix-stub/scalacOptions which triggers update.value to return an empty list. This commit sets scalacOptions of scalafix-sbt to empty list, overriding the injected scalacOptions by sbt-scalahost.
I was able to reproduce and tracked the root cause to an unexpected interplay between sbt-scalahost and sbt-scalafix (both plugins written by myself 😅 ). Fix pending in #202, I'll try to cut a release asap. I really wish sbt made it easier to fetch jars for outside of projects, see sbt/sbt#2879. |
Fix #200, override injected scalacOptions.
I just released 0.4.2 with the fix for this issue, https://github.com/scalacenter/scalafix/pull/206/files#diff-6625931ce372f9f63b809c6192860c07R5 |
step
xuwei-k@a18c180
remove explicit root project from
scalafix-sbt/src/sbt-test/sbt-scalafix/cross-build/build.sbt
and then testproblem
https://travis-ci.org/xuwei-k/scalafix/jobs/240723037#L2395
edit: I'm not sure this is scalafix issue or scalameta issue.
The text was updated successfully, but these errors were encountered: