Skip to content

Add scala scala submodule. #2323

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 8 commits into from
May 5, 2017
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ pipeline:
image: lampepfl/dotty:24-04-2017
pull: true
commands:
- ln -s /var/cache/drone/scala-scala scala-scala
- ln -s /var/cache/drone/ivy2 "$HOME/.ivy2"
- ./project/scripts/updateScalaLibrary
- sbt -J-Xmx4096m -J-XX:ReservedCodeCacheSize=512m -J-XX:MaxMetaspaceSize=1024m -Ddotty.drone.mem=4096m "${CI_TEST}"
when:
branch:
Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ tests/partest-generated/
tests/locks/
/test-classes/

# Used in tests
scala-scala

# Ignore output files but keep the directory
out/
build/
Expand Down
8 changes: 8 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,11 @@
path = scala-backend
url = https://github.com/lampepfl/scala.git
branch = sharing-backend
[submodule "scala2-library"]
path = scala2-library
url = https://github.com/lampepfl/scala.git
branch = dotty-library
[submodule "collection-strawman"]
path = collection-strawman
url = https://github.com/scala/collection-strawman.git
branch = master
1 change: 1 addition & 0 deletions collection-strawman
Submodule collection-strawman added at 3dd7d3
22 changes: 11 additions & 11 deletions compiler/test/dotc/tests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -215,18 +215,18 @@ class tests extends CompilerTest {

@Test def compileMixed = compileLine(
"""../tests/pos/B.scala
|../scala-scala/src/library/scala/collection/immutable/Seq.scala
|../scala-scala/src/library/scala/collection/parallel/ParSeq.scala
|../scala-scala/src/library/scala/package.scala
|../scala-scala/src/library/scala/collection/GenSeqLike.scala
|../scala-scala/src/library/scala/collection/SeqLike.scala
|../scala-scala/src/library/scala/collection/generic/GenSeqFactory.scala""".stripMargin)
@Test def compileIndexedSeq = compileLine("../scala-scala/src/library/scala/collection/immutable/IndexedSeq.scala")
@Test def compileParSetLike = compileLine("../scala-scala/src/library/scala/collection/parallel/mutable/ParSetLike.scala")
|../scala2-library/src/library/scala/collection/immutable/Seq.scala
|../scala2-library/src/library/scala/collection/parallel/ParSeq.scala
|../scala2-library/src/library/scala/package.scala
|../scala2-library/src/library/scala/collection/GenSeqLike.scala
|../scala2-library/src/library/scala/collection/SeqLike.scala
|../scala2-library/src/library/scala/collection/generic/GenSeqFactory.scala""".stripMargin)
@Test def compileIndexedSeq = compileLine("../scala2-library/src/library/scala/collection/immutable/IndexedSeq.scala")
@Test def compileParSetLike = compileLine("../scala2-library/src/library/scala/collection/parallel/mutable/ParSetLike.scala")
@Test def compileParSetSubset = compileLine(
"""../scala-scala/src/library/scala/collection/parallel/mutable/ParSetLike.scala
|../scala-scala/src/library/scala/collection/parallel/mutable/ParSet.scala
|../scala-scala/src/library/scala/collection/mutable/SetLike.scala""".stripMargin)(scala2mode ++ defaultOptions)
"""../scala2-library/src/library/scala/collection/parallel/mutable/ParSetLike.scala
|../scala2-library/src/library/scala/collection/parallel/mutable/ParSet.scala
|../scala2-library/src/library/scala/collection/mutable/SetLike.scala""".stripMargin)(scala2mode ++ defaultOptions)

@Test def dottyBooted = {
dottyBootedLib
Expand Down
2 changes: 1 addition & 1 deletion compiler/test/dotty/tools/StdLibSources.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ object StdLibSources {
/* For debug only */
private val useExplicitWhiteList = false

private final val stdLibPath = "../scala-scala/src/library/"
private final val stdLibPath = "../scala2-library/src/library/"

def blacklistFile: String = "../compiler/test/dotc/scala-collections.blacklist"
private def whitelistFile: String = "../compiler/test/dotc/scala-collections.whitelist"
Expand Down
23 changes: 12 additions & 11 deletions compiler/test/dotty/tools/dotc/CompilationTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class CompilationTests extends ParallelTesting {

@Test def compilePos: Unit = {
compileList("compileStdLib", StdLibSources.whitelisted, scala2Mode.and("-migration", "-Yno-inline")) +
compileDir("../collection-strawman/src/main", defaultOptions) +
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe make it a separate test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We would loose the parallelism.

compileDir("../compiler/src/dotty/tools/dotc/ast", defaultOptions) +
compileDir("../compiler/src/dotty/tools/dotc/config", defaultOptions) +
compileDir("../compiler/src/dotty/tools/dotc/core", allowDeepSubtypes) +
Expand All @@ -49,24 +50,24 @@ class CompilationTests extends ParallelTesting {
"compileMixed",
List(
"../tests/pos/B.scala",
"../scala-scala/src/library/scala/collection/immutable/Seq.scala",
"../scala-scala/src/library/scala/collection/parallel/ParSeq.scala",
"../scala-scala/src/library/scala/package.scala",
"../scala-scala/src/library/scala/collection/GenSeqLike.scala",
"../scala-scala/src/library/scala/collection/SeqLike.scala",
"../scala-scala/src/library/scala/collection/generic/GenSeqFactory.scala"
"../scala2-library/src/library/scala/collection/immutable/Seq.scala",
"../scala2-library/src/library/scala/collection/parallel/ParSeq.scala",
"../scala2-library/src/library/scala/package.scala",
"../scala2-library/src/library/scala/collection/GenSeqLike.scala",
"../scala2-library/src/library/scala/collection/SeqLike.scala",
"../scala2-library/src/library/scala/collection/generic/GenSeqFactory.scala"
),
defaultOptions
) +
compileFilesInDir("../tests/pos-special/spec-t5545", defaultOptions) +
compileFile("../scala-scala/src/library/scala/collection/immutable/IndexedSeq.scala", defaultOptions) +
compileFile("../scala-scala/src/library/scala/collection/parallel/mutable/ParSetLike.scala", defaultOptions) +
compileFile("../scala2-library/src/library/scala/collection/immutable/IndexedSeq.scala", defaultOptions) +
compileFile("../scala2-library/src/library/scala/collection/parallel/mutable/ParSetLike.scala", defaultOptions) +
compileList(
"parSetSubset",
List(
"../scala-scala/src/library/scala/collection/parallel/mutable/ParSetLike.scala",
"../scala-scala/src/library/scala/collection/parallel/mutable/ParSet.scala",
"../scala-scala/src/library/scala/collection/mutable/SetLike.scala"
"../scala2-library/src/library/scala/collection/parallel/mutable/ParSetLike.scala",
"../scala2-library/src/library/scala/collection/parallel/mutable/ParSet.scala",
"../scala2-library/src/library/scala/collection/mutable/SetLike.scala"
),
scala2Mode
) +
Expand Down
2 changes: 1 addition & 1 deletion compiler/test/dotty/tools/dotc/parsing/ScannerTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@ class ScannerTest extends DottyTest {

@Test
def scanScala() = {
scanDir("../scala-scala/src")
scanDir("../scala2-library/src")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ object desugarPackage extends DeSugarTest {
val start = System.nanoTime()
val startNodes = Trees.ntrees
parseDir("./src")
parseDir("./scala-scala/src")
parseDir("./scala2-library/src")
val ms1 = (System.nanoTime() - start)/1000000
val nodes = Trees.ntrees
val buf = parsedTrees map desugarTree
Expand Down
2 changes: 1 addition & 1 deletion compiler/test/dotty/tools/dotc/parsing/parsePackage.scala
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ object parsePackage extends ParserTest {
nodes = 0
val start = System.nanoTime()
parseDir("./src")
parseDir("./scala-scala/src")
parseDir("./scala2-library/src")
val ms1 = (System.nanoTime() - start)/1000000
val buf = parsedTrees map transformer.transform
val ms2 = (System.nanoTime() - start)/1000000
Expand Down
4 changes: 2 additions & 2 deletions doc-tool/test/UsecaseTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -223,12 +223,12 @@ class UsecaseTest extends DottyDocTest {
}

@Test def checkIterator =
checkFiles("../scala-scala/src/library/scala/collection/Iterator.scala" :: Nil) { _ =>
checkFiles("../scala2-library/src/library/scala/collection/Iterator.scala" :: Nil) { _ =>
// success if typer throws no errors! :)
}

@Test def checkIterableLike =
checkFiles("../scala-scala/src/library/scala/collection/IterableLike.scala" :: Nil) { _ =>
checkFiles("../scala2-library/src/library/scala/collection/IterableLike.scala" :: Nil) { _ =>
// success if typer throws no errors! :)
}
}
2 changes: 0 additions & 2 deletions docs/docs/contributing/workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ This document details common workflow patterns when working with Dotty.
# Start by cloning the repository:
git clone --recursive https://github.com/lampepfl/dotty.git
cd dotty
# Clone dotty-compatible stdlib. Needed for running the test suite.
git clone -b dotty-library https://github.com/DarkDimius/scala.git scala-scala
```

## Compiling files with dotc ##
Expand Down
21 changes: 10 additions & 11 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ object ExposedValues extends AutoPlugin {

object Build {

projectChecks()

val scalacVersion = "2.11.11" // Do not rename, this is grepped in bin/common.

val dottyOrganization = "ch.epfl.lamp"
Expand Down Expand Up @@ -152,7 +150,7 @@ object Build {
scalacOptions ++= Seq("-bootclasspath", sys.props("sun.boot.class.path")),

// sbt gets very unhappy if two projects use the same target
target := baseDirectory.value / ".." / "out" / name.value,
target := baseDirectory.value / ".." / "out" / "bootstrap" / name.value,

// The non-bootstrapped dotty-library is not necessary when bootstrapping dotty
autoScalaLibrary := false,
Expand Down Expand Up @@ -234,7 +232,7 @@ object Build {
settings(commonNonBootstrappedSettings).
settings(
triggeredMessage in ThisBuild := Watched.clearWhenTriggered,

submoduleChecks,
addCommandAlias("run", "dotty-compiler/run") ++
addCommandAlias("legacyTests", "dotty-compiler/testOnly dotc.tests")
)
Expand Down Expand Up @@ -995,14 +993,15 @@ object DottyInjectedPlugin extends AutoPlugin {
))
}

private def projectChecks(): Unit = {
val scalaScala = new File("scala-scala")
if (!scalaScala.exists()) {
println(
s"""[WARNING] Missing `dotty/scala-scala` library
|You can clone the library with:
| > git clone -b dotty-library https://github.com/DarkDimius/scala.git ${scalaScala.getAbsolutePath}
lazy val submoduleChecks = onLoad in Global := (onLoad in Global).value andThen { state =>
val submodules = List(new File("scala-backend"), new File("scala2-library"), new File("collection-strawman"))
if (!submodules.forall(f => f.exists && f.listFiles().nonEmpty)) {
sLog.value.log(Level.Error,
s"""Missing some of the submodules
|You can initialize the modules with:
| > git submodule update --init
""".stripMargin)
}
state
}
}
23 changes: 0 additions & 23 deletions project/scripts/updateScalaLibrary

This file was deleted.

1 change: 1 addition & 0 deletions scala2-library
Submodule scala2-library added at c14809