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

SBT project structure and Scala 3 #1082

Open
ruippeixotog opened this issue Jun 20, 2021 · 1 comment
Open

SBT project structure and Scala 3 #1082

ruippeixotog opened this issue Jun 20, 2021 · 1 comment

Comments

@ruippeixotog
Copy link
Member

In addition to the issues identified in #595, Our build needs a significant refactoring before we can further adopt Scala 3:

  • We currently have a hard dependency on project generic on all modules, both for testing and for documentation. Shapeless 3 is already available, but it's a completely different implementation and having both in the same generic project under different source folders would be considerably difficult to maintain (besides being confusing for users). On some projects we additionally use scalacheck-shapeless for testing, which obviously isn't available on Scala 3.0 either.

  • The mechanism for cross-compiling against different Scala versions has its limitations. We need to have a "main" scalaVersion to be used when we do e.g. compile and and additional crossScalaVersions when we do +compile. Right now, SBT doesn't allow us to have a Scala 3 only module (with scalaVersion := "3.0.0") because the main version in core is currently set to Scala 2.12. compile fails in that case, even though +compile or ++3.0.0 compile still works. Moreover, we cannot set projects with conditional subproject dependencies - we can't say "bundle depends on generic on Scala 2.x but not on 3.0" or "bundle depends on generic on Scala 2.x and on shapeless3 on 3.0" because dependsOn works at the project definition level, not as an SBT setting.

I think we need to work on 1) removing the special status of generic and shapeless as much as we possibly can and 2) try alternative approaches to handling different Scala versions. I've been exploring https://github.com/sbt/sbt-projectmatrix and opened a few issues there and I'll start by removing
scalacheck-shapeless and trying to create a shapeless3 version of generic.

@TimoMeijer
Copy link

@ruippeixotog I would like to help out and contribute, is there anything I could do that would be helpful to work towards further Scala 3 compatibility?

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

No branches or pull requests

2 participants