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: Add Dotty build for kernel only #2629

Closed
wants to merge 1 commit into from

Conversation

Alistair-Johnson
Copy link
Contributor

resolves #2356

@kailuowang
Copy link
Contributor

We probably need to change sbt release steps to accommodate this change (different crossScalaVersions for different modules). Basically, we need to do this

    releaseCrossBuild := false,
    releaseProcess := Seq[ReleaseStep](
      checkSnapshotDependencies,
      inquireVersions,
      releaseStepCommandAndRemaining("+clean"),
      releaseStepCommandAndRemaining("+test"),
      setReleaseVersion,
      commitReleaseVersion,
      tagRelease,
      releaseStepCommandAndRemaining("+publishSigned"),
      setNextVersion,
      commitNextVersion,
      releaseStepCommand("sonatypeReleaseAll"),
      pushChanges)
    

also set crossScalaVersions at root to Nil

@Alistair-Johnson
Copy link
Contributor Author

re the release, it's currently worse than that.

In sbt shell, ++0.10.0-RC1 and then compile will start compiling all the projects under cats, even though 0.10.0-RC1 is only set in kernelJVM. So naturally, +compile won't work either.

Additionally, there are no tests in kernelJVM.

The publish_cmd in travis-publish.sh will go wrong for the same reasons.

So...I think next step is to fix the build in interactive sbt so it works cleanly, otherwise I'm not sure we will have much fun moving forward.

@Alistair-Johnson
Copy link
Contributor Author

@smarter

The build issues I can/will look at, but I was expecting the compat files of TraversableOnce and WrappedMutableMapBase to be the same as for the 2.13 build. In fact, it looks like the dotty version is a mix of 2.12 and 2.13

It's not a big deal for cats, but I would just to point these out to you in case there is indeed an issue with dotty here.

@smarter
Copy link
Contributor

smarter commented Nov 21, 2018

In fact, it looks like the dotty version is a mix of 2.12 and 2.13

No. Dotty right now only uses the Scala 2.12 standard library (so that you can depend on Scala 2.12 projects in your Dotty build). We'll switch to 2.13 once it's released.

@Alistair-Johnson
Copy link
Contributor Author

Thanks...I'll change that back to 2,12 👍

.jvmSettings(commonJvmSettings ++ mimaSettings("cats-kernel"))
.settings(libraryDependencies += "org.scalacheck" %%% "scalacheck" % scalaCheckVersion(scalaVersion.value) % "test")
Copy link
Contributor

Choose a reason for hiding this comment

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

If you add .withDottyCompat(scalaVersion.value) you should be able to keep this dependency when compiling with Dotty too (https://github.com/lampepfl/dotty-example-project#getting-your-project-to-compile-with-dotty)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh...I missed that!! Cool

@@ -878,7 +907,8 @@ lazy val warnUnusedImport = Seq(
Seq("-Ywarn-unused-import")
case Some((2, n)) if n >= 12 =>
Seq("-Ywarn-unused:imports")

case Some((0, 10)) =>
Seq("-Ywarn-unused:imports")
Copy link
Contributor

Choose a reason for hiding this comment

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

That setting doesn't exist in Dotty currently

@@ -906,6 +936,7 @@ lazy val xlint = Seq(
scalacOptions += {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, scalaMajor)) if scalaMajor >= 12 => "-Xlint:-unused,_"
case Some((0, 10)) => "-Xlint:-unused,_"
Copy link
Contributor

Choose a reason for hiding this comment

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

There's no -Xlint in Dotty currently (and I hope scalafix can completely replace -Xlint)

@@ -19,3 +19,4 @@ addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.25")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.3.8")
addSbtPlugin("com.geirsson" % "sbt-scalafmt" % "1.5.1")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.9.0")
addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.2.4")
Copy link
Contributor

Choose a reason for hiding this comment

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

Latest is 0.2.6 (looks like we forgot to update the example projects)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed... my proof that I did Read The Fantastic Manual, but missed the important bit.

@diesalbla
Copy link
Contributor

diesalbla commented Mar 8, 2020

Since @travisbrown is already working on a Scala 3 / Dotty migration branch, perhaps this one is no longer needed. #3269

@larsrh
Copy link
Contributor

larsrh commented Mar 22, 2020

Thanks for the notice, @diesalbla. Closing this one in favour of #3269.

@larsrh larsrh closed this Mar 22, 2020
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.

Add dotty build for kernel
5 participants