Skip to content
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

WIP cross-build to sbt 2.x #440

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

WIP cross-build to sbt 2.x #440

wants to merge 1 commit into from

Conversation

bjaglin
Copy link
Collaborator

@bjaglin bjaglin commented Oct 5, 2024

https://www.scala-sbt.org/2.x/docs/en/changes/migrating-from-sbt-1.x.html
https://github.com/sbt/sbt/wiki/sbt-2.x-plugin-migration

  • [2.x] Missing implementation of Def.inputTaskDyn sbt/sbt#7707
    [error] -- [E008] Not Found Error: /home/brice/git/scala/sbt-scalafix/src/main/scala/scalafix/sbt/ScalafixPlugin.scala:380:34 
    [error] 380 |    InputTask.createDyn(InputTask.initParserAsInput(scalafixParser))(
    [error]     |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    [error]     |       value initParserAsInput is not a member of object sbt.InputTask
  • [error] -- [E189] Not Found Error: /home/brice/git/scala/sbt-scalafix/src/main/scala/scalafix/sbt/ScalafixPlugin.scala:246:13 
    [error] 246 |        case Value(v: UpdateReport) => v
    [error]     |             ^^^^^
    [error]     |             no pattern match extractor named Value was found
    [error]     |
    [error]     | longer explanation available when compiling with `-explain`
  • [error] -- [E007] Type Mismatch Error: /home/brice/git/scala/sbt-scalafix/src/main/scala/scalafix/sbt/ScalafixPlugin.scala:439:34 
    [error] 439 |          .flatMap(_.get(moduleID.key))
    [error]     |                         ^^^^^^^^^^^^
    [error]     |     Found:    (sbt.Keys.moduleID.key :
    [error]     |       sbt.internal.util.AttributeKey[sbt.librarymanagement.ModuleID])
    [error]     |     Required: sbt.internal.util.StringAttributeKey
    [error]     |
    [error]     | longer explanation available when compiling with `-explain`
  • [error] -- [E007] Type Mismatch Error: /home/brice/git/scala/sbt-scalafix/src/main/scala/scalafix/sbt/ScalafixPlugin.scala:445:8 
    [error] 445 |        projectDepsExternal,
    [error]     |        ^^^^^^^^^^^^^^^^^^^
    [error]     |        Found:    (projectDepsExternal : Seq[String])
    [error]     |        Required: Seq[sbt.ModuleID]
    [error]     |
    [error]     | longer explanation available when compiling with `-explain`
  • [error] -- [E007] Type Mismatch Error: /home/brice/git/scala/sbt-scalafix/src/main/scala/scalafix/sbt/ScalafixPlugin.scala:446:8 
    [error] 446 |        projectDepsInternal,
    [error]     |        ^^^^^^^^^^^^^^^^^^^
    [error]     |Found:    (projectDepsInternal : Seq[java.io.File | xsbti.HashedVirtualFileRef])
    [error]     |Required: Seq[sbt.File]
    [error]     |
    [error]     | longer explanation available when compiling with `-explain`
  • [error] -- [E008] Not Found Error: /home/brice/git/scala/sbt-scalafix/src/main/scala/scalafix/sbt/ScalafixPlugin.scala:519:60 
    [error] 519 |            (config / dependencyClasspath).value.map(_.data.toPath) :+
    [error]     |                                                     ^^^^^^^^^^^^^
    [error]     |            value toPath is not a member of xsbti.HashedVirtualFileRef
  • [error] -- [E049] Reference Error: /home/brice/git/scala/sbt-scalafix/src/main/scala/scalafix/sbt/ScalafixPlugin.scala:654:31 
    [error] 654 |      implicit val argFormat = liftFormat(argWriter)
    [error]     |                               ^^^^^^^^^^
    [error]     |      Reference to liftFormat is ambiguous.
    [error]     |      It is both imported by import sjsonnew._
    [error]     |      and imported subsequently by import sjsonnew.BasicJsonProtocol._
    [error]     |
    [error]     | longer explanation available when compiling with `-explain`
  • [error] -- [E045] Cyclic Error: /home/brice/git/scala/sbt-scalafix/src/main/scala/scalafix/sbt/ScalafixPlugin.scala:654:42 
    [error] 654 |      implicit val argFormat = liftFormat(argWriter)
    [error]     |                                          ^
    [error]     |                           Recursive value argWriter needs type
    [error]     |
    [error]     |                            Run with -explain-cyclic for more details.
    [error]     |
    [error]     | longer explanation available when compiling with `-explain`
  • [error] -- [E007] Type Mismatch Error: /home/brice/git/scala/sbt-scalafix/src/main/scala/scalafix/sbt/ScalafixTestkitPlugin.scala:51:54 
    [error] 51 |            scalafixTestkitInputClasspath.value.map(_.data),
    [error]    |                                                    ^^^^^^
    [error]    |                       Found:    (_$1.data : xsbti.HashedVirtualFileRef)
    [error]    |                       Required: java.io.File
    [error]    |
    [error]    | longer explanation available when compiling with `-explain`

@bjaglin bjaglin force-pushed the sbt2 branch 3 times, most recently from c9451e2 to 42e7e69 Compare October 5, 2024 22:05
@bjaglin bjaglin changed the title sbt 2.x cross-build to sbt 2.x Oct 5, 2024
@@ -155,21 +155,21 @@ object ScalafixEnable {
} else {
val latestAvailable =
tail.lastOption.getOrElse(earliestAvailable)
Seq(
Copy link
Collaborator Author

@bjaglin bjaglin Oct 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was picked as significant indentation by the compiler (and has been also all along by scalafmt, as scala3 is aggressively/incorrectly used on all files as dialect), which was causing latestAvailable's type to be recursive ...

@bjaglin bjaglin force-pushed the sbt2 branch 2 times, most recently from 0bc3b43 to 50acf94 Compare October 5, 2024 22:19
@bjaglin bjaglin changed the title cross-build to sbt 2.x WIP cross-build to sbt 2.x Feb 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant