-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[POC] sbt 1.5.0 validation #11568
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
[POC] sbt 1.5.0 validation #11568
Conversation
23516f7
to
a3dcb26
Compare
18076dc
to
f5fa041
Compare
e5b932f
to
b9692b0
Compare
36d29d9
to
460556c
Compare
import sbt.internal.inc.ScalaInstance | ||
|
||
object Bootstrap { | ||
// copied from https://github.com/sbt/sbt/blob/33e2bfe2810246c8e4e1b37ec110d15e588a4fce/main/src/main/scala/sbt/Defaults.scala#L1120-L1165 |
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.
Could this method be made public upstream?
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.
Don't think that's worth it. It's only useful for works on the Scala compilers and we probably don't want to maintain compatibility just in case other people use it.
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.
Your call, but It seems better than having to deal with the complicated classloader caching logic API directly. And does this need to be in package sbt
?
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.
It does because the ScalaInstance
constructor is package private. But we could as well create our own ScalaInstance
implementation.
This code is a quick and dirty copy-paste, it can be made simpler.
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.
It does because the ScalaInstance constructor is package private.
It looks public to me (https://github.com/sbt/zinc/blob/13ddb10938237263f706174439d8ed055e8e4ac2/internal/zinc-classpath/src/main/scala/sbt/internal/inc/ScalaInstance.scala#L34-L43), and weren't we already using it before this PR?
041207a
to
0bc5818
Compare
This PR has a commit which adds the pdbp submodule directory (which was removed from the dotty repo in a previous PR) without adding it to .gitmodules, the result is that git explodes with "fatal: No url found for submodule path 'community-build/community-projects/pdbp' in .gitmodules" and because 1) the git repo is not cleaned up afterwards and 2) the git checkout action runs "git submodule foreach ..." before it pulls the current git branch, this affected other PRs hence why the CI exploded: https://github.com/lampepfl/dotty/commits/master The pdbp submodule has been restored on master so if you rebase things should work out. |
These projects depends on the SpiewakPlugin plugin which transitively depends on DottyPlugin. Removing DottyPlugin from these projects would require altering SpiewakPlugin, wich is out of scope here. Alternatively we force the version of sbt-dotty to be 0.5.3, checking that sbt 1.5.0 will be compatible with sbt-dotty.
The purpose of this PR is not to be merged. It is a peek in the future to check that sbt 1.5 will be able to replace sbt-dotty.
sbt/sbt#6342 (comment)
For this purpose:
1.5.0-bin-20210302T081602
Including the scripted tests of the sbt-dotty project itself to show that sbt-dotty is not needed anymore. All the tests passed with no trouble.
These projects use the
SpiewakPlugin
which requires theDottyPlugin
(see here) and it was too much of a hassle for me to make things work without theSpiewakPlugin
.As an alternative, I bumped the version of sbt-dotty to
0.5.3
explicity in each one of them. So it shows that sbt-dotty is still compatible with sbt 1.5 when it comes to compiling, running and testing. However it appears thatsbt-dotty
doc task is not compatible with sbt 1.5.I temporarily removed the doc checking of
cats-effect
s andscodec
s projects.What I have learned during the process:
Most often than not, removing sbt-dotty is straightforward:
isDotty.value
with one of the alternatives.withDottyCompat(scalaVersion.value)
with.cross(CrossVersion.for3Use2_13)
useScaladoc := true
There are 2 small difficulties:
1. libraryDependencies.map(_.withDottyCompat(scalaVersion.value))
This pattern cannot be naively rewritten into
libraryDependencies.map(_.cross(CrossVersion.for3Use2_13))
because:
scala3-library
to thelibraryDependencies
CrossVersion.for3Use2_13
cannot be used on java dependencies:One general solution is
2. dottyLatestNightlyBuild
The code is here.
This feature is obviously not supported by sbt 1.5. It may deserve to be published as an independent library.