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: Scala3 migration #728

Closed
wants to merge 6 commits into from
Closed

Conversation

PeuTit
Copy link

@PeuTit PeuTit commented Mar 15, 2023

Cross compiling to 2.13 & 3.
Fixed some issues regarding syntax and library not supported in Scala3.

build.sbt Outdated
)
case Some((3, _)) =>
Seq(
"com.typesafe.slick" %% "slick" % "3.4.0-SNAPSHOT",
Copy link
Author

Choose a reason for hiding this comment

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

This is using a locally published version of Slick with the Scala3 Pull Request. You can find it here: slick/slick#2187

project/Dependencies.scala Outdated Show resolved Hide resolved
@@ -158,7 +158,7 @@ trait HasDatabaseConfig[P <: BasicProfile] {
@deprecated("Use `profile` instead of `driver`", "2.1")
protected final lazy val driver: P = dbConfig.profile // field is lazy to avoid early initializer problems.
/** The Slick database extracted from `dbConfig`. */
protected final def db: P#Backend#Database = dbConfig.db
Copy link
Author

Choose a reason for hiding this comment

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

I understood that this is Path Dependent Types but I didn't find a way to make it work. Any insight here would be much appreciated!

@PeuTit
Copy link
Author

PeuTit commented Mar 16, 2023

Running +mimaReportBinaryIssues yields some error.

[info] play-slick-root: mimaPreviousArtifacts not set, not analyzing binary compatibility
[error] play-slick: Failed binary compatibility check against com.typesafe.play:play-slick_2.13:5.0.2! Found 2 potential problems
[error]  * method dbConfig()slick.basic.DatabaseConfig in interface play.api.db.slick.HasDatabaseConfigProvider does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("play.api.db.slick.HasDatabaseConfigProvider.dbConfig")
[error]  * abstract synthetic method play$api$db$slick$HasDatabaseConfigProvider$_setter_$dbConfig_=(slick.basic.DatabaseConfig)Unit in interface play.api.db.slick.HasDatabaseConfigProvider is present only in current version
[error]    filter with: ProblemFilters.exclude[ReversedMissingMethodProblem]("play.api.db.slick.HasDatabaseConfigProvider.play$api$db$slick$HasDatabaseConfigProvider$_setter_$dbConfig_=")
[error] stack trace is suppressed; run last play-slick / mimaReportBinaryIssues for the full output
[error] (play-slick / mimaReportBinaryIssues) Failed binary compatibility check against com.typesafe.play:play-slick_2.13:5.0.2! Found 2 potential problems
[error] Total time: 9 s, completed Mar 16, 2023, 10:30:01 AM

PeuTit added 2 commits April 4, 2023 11:21
- Compiling on Scala3 & Scala2.13
- Avoid code duplication and improve readability by moving library imports into `Dependencies.scala`.
- Make Scala 2.13 default scala version.
- Add scala3 to github action workflow
@PeuTit PeuTit force-pushed the scala3-migration branch from ab74ff3 to 5532df8 Compare April 4, 2023 12:39
project/Dependencies.scala Outdated Show resolved Hide resolved
@nafg
Copy link

nafg commented Jul 10, 2023

Slick 3.5.0-M4 is out for Scala 3 (and 2.12 and 2.13)

@xuwei-k
Copy link
Contributor

xuwei-k commented Jul 10, 2023

@mkurz
Copy link
Member

mkurz commented Jul 15, 2023

Superseded by #751

@mkurz mkurz closed this Jul 15, 2023
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.

4 participants