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

explore the possibility of supporting Dotty #927

Open
SethTisue opened this issue Jun 20, 2019 · 8 comments
Labels

Comments

@SethTisue
Copy link
Member

@SethTisue SethTisue commented Jun 20, 2019

this is only one possible path forward for building community projects on Dotty; the overarching ticket is lampepfl/dotty#6708

I'm hoping that we can adjust the "scala" section of the config file to pull Dotty JARs using either, set the Scala version to 0.16.0-RC3 or what have you, and go. maybe dbuild will blow up. if that happens @cunei can advise us on whether we're stymied, or what.

@SethTisue

This comment has been minimized.

Copy link
Member Author

@SethTisue SethTisue commented Jun 20, 2019

one obstacle I already see coming is that we need the included projects to have sbt-dotty plugin.

we have not previously attempted to inject an sbt plugin into every build. there's a ticket on that at #553. Toni has specific advice on what to try at #553 (comment)

fortunately, automatically injecting the sbt-dotty plugin isn't a hard requirement for getting started. we can PR the addition of the plugin to repos we care about, and/or just do the addition in our own forks (in our personal forks when experimenting is fine; under the scalacommunitybuild organization is better for anything that we expect to keep) and point the config file here to those forks.

scala-xml and ScalaTest are two repos I know of that already have Dotty in their cross-builds; we could start with those. (@liufengyun what ScalaTest branch would we use and where does it live?)

@SethTisue SethTisue referenced this issue Jun 20, 2019
0 of 15 tasks complete
@liufengyun

This comment has been minimized.

Copy link

@liufengyun liufengyun commented Jun 20, 2019

@SethTisue The branch 3.1.x https://github.com/scalatest/scalatest/tree/3.1.x has Dotty support.

We run the following SBT commands to run the test set of ScalaTest:

scalacticTestDotty/test;scalatestTestDotty/test
@SethTisue

This comment has been minimized.

Copy link
Member Author

@SethTisue SethTisue commented Jun 20, 2019

progress so far: to set the Scala version for all projects, in the community build we normal use dbuild's assemble build system, which has hardcoded expectations about scala-library.jar

our choices here:

  • patch dbuild to allow dotty-library instead?
  • figure out how to do without the scala build system

it seems to me that we shouldn't need assemble to assemble a scala for us, that was mainly used historically when Scala 2 still had its own dependencies (scala-xml, scala-parser-combinators). let's try just controlling it with extra.settings: ["scalaVersion := ..."]` or some such.

@liufengyun

This comment has been minimized.

Copy link

@liufengyun liufengyun commented Jun 20, 2019

@SethTisue we have a version of scala-library, which seems can be used for the purpose:

  // Depend on dotty-library so that sbt projects using dotty automatically
  // depend on the dotty-library
  lazy val `scala-library` = project.
    dependsOn(`dotty-library-bootstrapped`).
    settings(commonDummySettings).
    settings(
      // Need a direct dependency on the real scala-library even though we indirectly
      // depend on it via dotty-library, because sbt may rewrite dependencies
      // (see https://github.com/sbt/sbt/pull/2634), but won't rewrite the direct
      // dependencies of scala-library (see https://github.com/sbt/sbt/pull/2897)
      libraryDependencies += "org.scala-lang" % "scala-library" % scalacVersion
    )

https://github.com/lampepfl/dotty/blob/0a67182e84c577575a181af95732e970054fc9a9/project/Build.scala#L979-L990

@SethTisue

This comment has been minimized.

Copy link
Member Author

@SethTisue SethTisue commented Jun 20, 2019

the scala-library check in dbuild hardcodes l.info.organization == "org.scala-lang", but of course that would be easy to patch

but we can disable the check with cross-version: disabled, but I'm not sure what the implications of that are in this case. I'll keep experimenting

@SethTisue

This comment has been minimized.

Copy link
Member Author

@SethTisue SethTisue commented Jun 20, 2019

(I'm out of time to mess with this any further until July)

@liufengyun

This comment has been minimized.

Copy link

@liufengyun liufengyun commented Jun 20, 2019

Thanks a lot @SethTisue 👍 I'll spend some time to get familiar with the relevant tools and think about the alternatives too.

Have a nice holiday !

@SethTisue

This comment has been minimized.

Copy link
Member Author

@SethTisue SethTisue commented Jun 20, 2019

oh, I forgot to say: I had a local run that actually built scala-xml, generated doc, and ran the tests. I thought that I'd pushed that config to GitHub, but it seems not because the same thing didn't happen in the Jenkins run. oh well, I'll get back to it...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.