Skip to content

Remove sbt-dotty #12259

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 4 commits into from
May 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
69 changes: 8 additions & 61 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ jobs:
- ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
- ${{ github.workspace }}/../../cache/general:/root/.cache
if: "github.event_name == 'schedule' && github.repository == 'lampepfl/dotty'
|| (
github.event_name == 'push'
&& !startsWith(github.event.ref, 'refs/tags/sbt-dotty-')
)
|| github.event_name == 'push'
|| (
github.event_name == 'pull_request'
&& !contains(github.event.pull_request.body, '[skip ci]')
Expand Down Expand Up @@ -82,10 +79,7 @@ jobs:
- ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
- ${{ github.workspace }}/../../cache/general:/root/.cache
if: "github.event_name == 'schedule' && github.repository == 'lampepfl/dotty'
|| (
github.event_name == 'push'
&& !startsWith(github.event.ref, 'refs/tags/sbt-dotty-')
)
|| github.event_name == 'push'
|| (
github.event_name == 'pull_request'
&& !contains(github.event.pull_request.body, '[skip ci]')
Expand Down Expand Up @@ -117,15 +111,14 @@ jobs:

- name: Cmd Tests
run: |
./project/scripts/sbt ";scala3-bootstrapped/compile ;scala3-bootstrapped/test;sjsSandbox/run;sjsSandbox/test;sjsJUnitTests/test;sjsCompilerTests/test ;sbt-dotty/scripted scala2-compat/* ;configureIDE ;stdlib-bootstrapped/test:run ;stdlib-bootstrapped-tasty-tests/test"
./project/scripts/sbt ";scala3-bootstrapped/compile ;scala3-bootstrapped/test;sjsSandbox/run;sjsSandbox/test;sjsJUnitTests/test;sjsCompilerTests/test ;sbt-test/scripted scala2-compat/* ;configureIDE ;stdlib-bootstrapped/test:run ;stdlib-bootstrapped-tasty-tests/test"
./project/scripts/bootstrapCmdTests

test_windows_fast:
runs-on: [self-hosted, Windows]
if: "(
github.event_name == 'push'
&& github.ref != 'refs/heads/master'
&& !startsWith(github.event.ref, 'refs/tags/sbt-dotty-')
)
|| (
github.event_name == 'pull_request'
Expand Down Expand Up @@ -168,10 +161,7 @@ jobs:
test_windows_full:
runs-on: [self-hosted, Windows]
if: "github.event_name == 'schedule' && github.repository == 'lampepfl/dotty'
|| (
github.event_name == 'push'
&& !startsWith(github.event.ref, 'refs/tags/sbt-dotty-')
)
|| github.event_name == 'push'
|| (
github.event_name == 'pull_request'
&& !contains(github.event.pull_request.body, '[skip ci]')
Expand Down Expand Up @@ -361,7 +351,7 @@ jobs:
run: cp -vf .github/workflows/repositories /root/.sbt/ ; true

- name: Test sbt
run: ./project/scripts/sbt "sbt-dotty/scripted; sbt-community-build/scripted"
run: ./project/scripts/sbt "sbt-test/scripted; sbt-community-build/scripted"

test_java8:
runs-on: [self-hosted, Linux]
Expand All @@ -377,7 +367,6 @@ jobs:
|| (
github.event_name == 'push'
&& startsWith(github.event.ref, 'refs/tags/')
&& !startsWith(github.event.ref, 'refs/tags/sbt-dotty-')
)
|| (
github.event_name == 'pull_request'
Expand Down Expand Up @@ -410,7 +399,7 @@ jobs:

- name: Test
run: |
./project/scripts/sbt ";scala3-bootstrapped/compile ;scala3-bootstrapped/test;sjsSandbox/run;sjsSandbox/test;sjsJUnitTests/test;sjsCompilerTests/test ;sbt-dotty/scripted scala2-compat/* ;configureIDE ;stdlib-bootstrapped/test:run ;stdlib-bootstrapped-tasty-tests/test"
./project/scripts/sbt ";scala3-bootstrapped/compile ;scala3-bootstrapped/test;sjsSandbox/run;sjsSandbox/test;sjsJUnitTests/test;sjsCompilerTests/test ;sbt-test/scripted scala2-compat/* ;configureIDE ;stdlib-bootstrapped/test:run ;stdlib-bootstrapped-tasty-tests/test"
./project/scripts/bootstrapCmdTests

publish_nightly:
Expand Down Expand Up @@ -520,8 +509,7 @@ jobs:
- ${{ github.workspace }}/../../cache/general:/root/.cache
needs: [test_non_bootstrapped, test, community_build_a, community_build_b, community_build_c, test_sbt, test_java8]
if: "github.event_name == 'push'
&& startsWith(github.event.ref, 'refs/tags/')
&& !startsWith(github.event.ref, 'refs/tags/sbt-dotty-')"
&& startsWith(github.event.ref, 'refs/tags/')"

env:
RELEASEBUILD: yes
Expand Down Expand Up @@ -606,8 +594,7 @@ jobs:
- ${{ github.workspace }}/../../cache/general:/root/.cache
needs: [publish_release]
if: "github.event_name == 'push'
&& startsWith(github.event.ref, 'refs/tags/')
&& !startsWith(github.event.ref, 'refs/tags/sbt-dotty-')"
&& startsWith(github.event.ref, 'refs/tags/')"

env:
RELEASEBUILD: yes
Expand Down Expand Up @@ -643,46 +630,6 @@ jobs:
external_repository: lampepfl/dotty-website
publish_branch: gh-pages

publish_sbt_release:
runs-on: [self-hosted, Linux]
container:
image: lampepfl/dotty:2021-03-22
options: --cpu-shares 4096
volumes:
- ${{ github.workspace }}/../../cache/sbt:/root/.sbt
- ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
- ${{ github.workspace }}/../../cache/general:/root/.cache
needs: [community_build_a, community_build_b, community_build_c, test_sbt]
if: "github.event_name == 'push'
&& startsWith(github.event.ref, 'refs/tags/sbt-dotty-')"

env:
RELEASEBUILD: yes
PGP_PW: ${{ secrets.PGP_PW }} # PGP passphrase
PGP_SECRET: ${{ secrets.PGP_SECRET }} # Export your private and public PGP key to an *.asc file, take the file's contents as a string
SONATYPE_PW: ${{ secrets.SONATYPE_PW }}
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}

steps:
- name: Reset existing repo
run: git -c "http.https://github.com/.extraheader=" fetch --recurse-submodules=no "https://github.com/lampepfl/dotty" && git reset --hard FETCH_HEAD || true

- name: Checkout cleanup script
uses: actions/checkout@v2

- name: Cleanup
run: .github/workflows/cleanup.sh

- name: Git Checkout
uses: actions/checkout@v2

- name: Add SBT proxy repositories
run: cp -vf .github/workflows/repositories /root/.sbt/ ; true

- name: Publish Dotty SBT Plugin Release
run: |
./project/scripts/sbtPublish ";project sbt-dotty ;publishSigned ;sonatypeBundleRelease"

open_issue_on_failure:
runs-on: [self-hosted, Linux]
container:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scaladoc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
run: ./project/scripts/sbt scaladoc/generateScalaDocumentation

- name: Generate documentation for example project using dotty-sbt
run: ./project/scripts/sbt "sbt-dotty/scripted sbt-dotty/scaladoc"
run: ./project/scripts/sbt "sbt-test/scripted sbt-dotty/scaladoc"

- name: Generate index file
run: scaladoc/scripts/mk-index.sh scaladoc/output > scaladoc/output/index.html
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ val sjsSandbox = Build.sjsSandbox
val sjsJUnitTests = Build.sjsJUnitTests
val sjsCompilerTests = Build.sjsCompilerTests

val `sbt-dotty` = Build.`sbt-dotty`
val `sbt-test` = Build.`sbt-test`
val `vscode-dotty` = Build.`vscode-dotty`

inThisBuild(Build.thisBuildSettings)
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/core/TypeErasure.scala
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ class TypeErasure(sourceLanguage: SourceLanguage, semiEraseVCs: Boolean, isConst
// erased like `Array[A]` as seen from its definition site, no matter
// the `X` (same if `A` is bounded).
//
// The binary compatibility is checked by sbt-dotty/sbt-test/scala2-compat/i8001
// The binary compatibility is checked by sbt-test/scala2-compat/i8001
val erasedValueClass =
if erasedUnderlying.isPrimitiveValueType && !genericUnderlying.isPrimitiveValueType then
defn.boxedType(erasedUnderlying)
Expand Down
4 changes: 2 additions & 2 deletions compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1199,8 +1199,8 @@ class TreeUnpickler(reader: TastyReader,
* or an override has been removed.
*
* This is tested in
* - sbt-dotty/sbt-test/tasty-compat/remove-override
* - sbt-dotty/sbt-test/tasty-compat/move-method
* - sbt-test/tasty-compat/remove-override
* - sbt-test/tasty-compat/move-method
*/
def lookupInSuper =
val cls = ownerTpe.classSymbol
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ object Scala2Erasure:
* these issues because they get flattened into a single RefinedType with
* three parents, cf `flattenedParents`.
*
* See sbt-dotty/sbt-test/scala2-compat/erasure/changes/Main.scala for examples.
* See sbt-test/scala2-compat/erasure/changes/Main.scala for examples.
*
* @throws TypeError if this type is unsupported.
*/
Expand Down Expand Up @@ -215,7 +215,7 @@ object Scala2Erasure:
* is only specified for class symbols. Therefore, the accuracy of this
* method cannot be guaranteed, the best we can do is make sure it works on
* as many test cases as possible which can be run from sbt using:
* > sbt-dotty/scripted scala2-compat/erasure
* > sbt-test/scripted scala2-compat/erasure
*
* The body of this method is made to look as much as the Scala 2 version as
* possible to make them easier to compare, cf:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ class DottyLanguageServer extends LanguageServer
}

object DottyLanguageServer {
/** Configuration file normally generated by sbt-dotty */
/** Configuration file normally generated by the DottyIDEPlugin */
final val IDE_CONFIG_FILE = ".dotty-ide.json"

final val RENAME_OVERRIDDEN_QUESTION = "Do you want to rename the base member, or only this member?"
Expand Down
2 changes: 1 addition & 1 deletion language-server/src/dotty/tools/languageserver/Main.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import org.eclipse.lsp4j.jsonrpc.Launcher
* coursier launch $artifact -M dotty.tools.languageserver.Main -- -stdio
*
* Where $artifact comes from the `.dotty-ide-artifact` file in the current project, this file
* can be created by the sbt-dotty plugin by running `sbt configureIDE`.
* can be created by the DottyIDEPlugin by running `sbt configureIDE`.
*
* See vscode-dotty/ for an example integration of the Dotty Language Server into Visual Studio Code.
*/
Expand Down
34 changes: 34 additions & 0 deletions project/Bootstrap.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package sbt
Copy link
Member

Choose a reason for hiding this comment

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

I still don't understand why this is needed.

Copy link
Member Author

Choose a reason for hiding this comment

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

It is explained in the comments below

Copy link
Member Author

Choose a reason for hiding this comment

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

// `extendedClassLoaderCache` is package private in package sbt
val cache = state.extendedClassLoaderCache

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree now that it would be easier if makeScalaInstance is public in sbt...

Copy link
Member

Choose a reason for hiding this comment

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

Ah I missed that, so can we make this method public in sbt? It seems like the only way to properly use ScalaInstance which is public. Otherwise our build could break at any update of sbt.

Copy link
Member Author

Choose a reason for hiding this comment

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


import sbt.internal.classpath.ClassLoaderCache
import sbt.internal.inc.ScalaInstance

// This class needs to be in package sbt to access the ClassLoaderCache
object Bootstrap {
def makeScalaInstance(
state: State,
version: String,
libraryJars: Array[File],
compilerJars: Array[File],
docJars: Array[File],
topLoader: ClassLoader
): ScalaInstance = {
// `extendedClassLoaderCache` is package private in package sbt
val cache = state.extendedClassLoaderCache

val libraryLoader = cache(libraryJars.toList, topLoader)
val compilerLoader = cache(compilerJars.toList, libraryLoader)
val fullLoader = cache(docJars.toList, compilerLoader)

new ScalaInstance(
version = version,
loader = fullLoader,
loaderCompilerOnly = compilerLoader,
loaderLibraryOnly = libraryLoader,
libraryJars = libraryJars,
compilerJars = compilerJars,
allJars = libraryJars ++ compilerJars ++ docJars,
explicitActual = Some(version)
)
}
}
Loading