-
Notifications
You must be signed in to change notification settings - Fork 50
Cross-building with Scala 3 #443
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
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
6f36a95
adapt the build to crosscompile to scala3
benderpremier cd951f6
explicitely use Any and adapt for comprehension without better monadi…
benderpremier 83fde52
Syntax Migration Warning method unsafeToFuture must be called with ()…
benderpremier be4763c
scala 3 on fetch-debug
benderpremier cf80aa6
change clashing symbol :: to :-:
benderpremier b79c92c
adapt fetch-example for available libraries
benderpremier 9308a4a
scalafmt
benderpremier d3e1c45
move versions
benderpremier 0b723c4
deactivate example while waiting for deps to be published
benderpremier c2fcfa9
use 2.13 as base version
benderpremier badd0c9
remove global cross versions
bdbdd34
remove code coverage
af457c8
test cross versions
692541d
remove remnant url
ad6708a
uncomment the tests
ffa1c5a
Merge branch 'master' into ISSUE-439-build-with-scala3
juanpedromoreno 2abeab0
merge master
13942f1
update to RC2
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,39 +1,53 @@ | ||
| ThisBuild / scalaVersion := "2.13.2" | ||
| ThisBuild / crossScalaVersions := Seq("2.12.11", "2.13.2") | ||
| ThisBuild / scalaVersion := scala213 | ||
| ThisBuild / organization := "com.47deg" | ||
|
|
||
| addCommandAlias("ci-test", "scalafmtCheckAll; scalafmtSbtCheck; mdoc; testCovered") | ||
| addCommandAlias("ci-test", "scalafmtCheckAll; scalafmtSbtCheck; mdoc; ++test") | ||
| addCommandAlias("ci-docs", "github; mdoc; headerCreateAll; publishMicrosite") | ||
| addCommandAlias("ci-publish", "github; ci-release") | ||
|
|
||
| lazy val scala212 = "2.12.12" | ||
| lazy val scala213 = "2.13.5" | ||
| lazy val scala3Version = "3.0.0-RC2" | ||
| lazy val scala2Versions = Seq(scala212, scala213) | ||
| lazy val allScalaVersions = scala2Versions :+ scala3Version | ||
|
|
||
| skip in publish := true | ||
|
|
||
| lazy val fetch = crossProject(JSPlatform, JVMPlatform) | ||
| .crossType(CrossType.Pure) | ||
| .settings(commonCrossDependencies) | ||
| .settings(crossScalaVersions := allScalaVersions) | ||
|
|
||
| lazy val fetchJVM = fetch.jvm | ||
| lazy val fetchJS = fetch.js.disablePlugins(ScoverageSbtPlugin) | ||
| lazy val fetchJS = fetch.js | ||
| .settings(crossScalaVersions := scala2Versions) | ||
|
|
||
| lazy val `fetch-debug` = crossProject(JSPlatform, JVMPlatform) | ||
| .crossType(CrossType.Pure) | ||
| .dependsOn(fetch) | ||
| .settings(commonCrossDependencies) | ||
| .settings(crossScalaVersions := allScalaVersions) | ||
|
|
||
| lazy val debugJVM = `fetch-debug`.jvm | ||
| lazy val debugJS = `fetch-debug`.js.disablePlugins(ScoverageSbtPlugin) | ||
| lazy val debugJS = `fetch-debug`.js | ||
| .settings(crossScalaVersions := scala2Versions) | ||
|
|
||
| lazy val `fetch-examples` = project | ||
| .dependsOn(fetchJVM, debugJVM) | ||
| .settings(skip in publish := true) | ||
| .settings(examplesSettings: _*) | ||
| .settings(crossScalaVersions := scala2Versions) | ||
|
|
||
| lazy val microsite = project | ||
| .dependsOn(fetchJVM, debugJVM) | ||
| .settings(docsSettings: _*) | ||
| .settings(skip in publish := true) | ||
| .enablePlugins(MicrositesPlugin, MdocPlugin) | ||
| .settings(crossScalaVersions := scala2Versions) | ||
|
|
||
| lazy val documentation = project | ||
| .dependsOn(fetchJVM) | ||
| .settings(skip in publish := true) | ||
| .settings(mdocOut := file(".")) | ||
| .enablePlugins(MdocPlugin) | ||
| .settings(crossScalaVersions := scala2Versions) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit unfortunate. I can't claim to fully understand all this code, but as far as I can tell, it was taking advantage of bugs in the Scala compiler's GADT support in order to compile?
I had a quick look but I have a feeling that any attempt to address this properly would become a rewrite of most of the library. We could at least try to suppress the erasure warnings?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something we can try if the
@operator doesn't work is to rewrap the pattern again if needed?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried that but I am getting the same compilation error:
The compiler wants to prove that the type parameters of
FetchOnea and b are the same but it can't. We lose those parameters when we use FetchRequest.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll try to see if we can keep track of the
IandAtype params along the way. I gave it a quick go now and it doesn't seem so straightforward.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I spent some time this afternoon trying to keep track of the
Iand avoid theFetchOne[Any, Any]. However, I end up bubbling that type parameter all the way up in the API (in the pure and apply method of theFetchobject) which I don't think we want to do.I am not sure there is a way around using
Anyhere. If you look at how theFetchare created, we widen toAnyin the fetch constructor methods (apply,optional) and then cast withasInstanceOf[A]. Looks like this is where we loose theIwe would need here.Also the monad instance for fetch,
implicit def fetchM[F[_]: Monad]: Monad[Fetch[F, *]]would have to be reworked if we push theIall the way up which seems complicated.