Skip to content

Commit

Permalink
Merge branch 'idempotency-on-boot' of https://github.com/dotty-stagin…
Browse files Browse the repository at this point in the history
…g/dotty into idempotency-on-boot
  • Loading branch information
nicolasstucki committed Jun 19, 2017
2 parents 711e6f7 + b1487a2 commit 5b1d7f2
Show file tree
Hide file tree
Showing 14 changed files with 92 additions and 21 deletions.
6 changes: 4 additions & 2 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# After updating this file, you need to re-sign it:
#
# - Install [drone-cli](http://readme.drone.io/usage/getting-started-cli/)
# - Copy your token from http://dotty-ci.epfl.ch/account (Click SHOW TOKEN)
# - (export DRONE_TOKEN=your-token; export DRONE_SERVER=http://dotty-ci.epfl.ch; drone sign lampepfl/dotty)
# - Copy your token from http://dotty-ci.epfl.ch/account (Click SHOW TOKEN)
# - DRONE_TOKEN=your-token DRONE_SERVER=http://dotty-ci.epfl.ch drone sign lampepfl/dotty
#
# Please note that the signing can only be done by collaborators.

Expand Down Expand Up @@ -76,3 +76,5 @@ matrix:
CI_PUBLISH: false
- CI_TEST: dotty-bootstrapped/test
CI_PUBLISH: false
- CI_TEST: ;set bootstrapOptimised in ThisBuild := true ;dotty-bootstrapped/test
CI_PUBLISH: false
2 changes: 1 addition & 1 deletion .drone.yml.sig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
eyJhbGciOiJIUzI1NiJ9.IyBBZnRlciB1cGRhdGluZyB0aGlzIGZpbGUsIHlvdSBuZWVkIHRvIHJlLXNpZ24gaXQ6CiMKIyAtIEluc3RhbGwgW2Ryb25lLWNsaV0oaHR0cDovL3JlYWRtZS5kcm9uZS5pby91c2FnZS9nZXR0aW5nLXN0YXJ0ZWQtY2xpLykKIyAtIENvcHkgeW91ciB0b2tlbiBmcm9tICBodHRwOi8vZG90dHktY2kuZXBmbC5jaC9hY2NvdW50IChDbGljayBTSE9XIFRPS0VOKQojIC0gKGV4cG9ydCBEUk9ORV9UT0tFTj15b3VyLXRva2VuOyBleHBvcnQgRF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bjoKICAgICAgYnJhbmNoOiBtYXN0ZXIKCiAgc2xhY2s6CiAgICBpbWFnZTogcGx1Z2lucy9zbGFjawogICAgY2hhbm5lbDogZG90dHkKICAgIHdoZW46CiAgICAgIGJyYW5jaDogbWFzdGVyCiAgICAgIHN0YXR1czogY2hhbmdlZAoKbWF0cml4OgogIGluY2x1ZGU6CiAgICAtIENJX1RFU1Q6IGRvdHR5LWJpbi10ZXN0cy90ZXN0CiAgICAgIENJX1BVQkxJU0g6IHRydWUKICAgIC0gQ0lfVEVTVDogbGVnYWN5VGVzdHMKICAgICAgQ0lfUFVCTElTSDogZmFsc2UKICAgIC0gQ0lfVEVTVDogO3Rlc3Q7c2J0LWRvdHR5L3NjcmlwdGVkIGNvbXBpbGVyUmVwb3J0ZXIvKjtzYnQtZG90dHkvc2NyaXB0ZWQgZGlzY292ZXJ5Lyo7c2J0LWRvdHR5L3NjcmlwdGVkIHNidC1kb3R0eS8qCiAgICAgIENJX1BVQkxJU0g6IGZhbHNlCiAgICAtIENJX1RFU1Q6IGRvdHR5LWJvb3RzdHJhcHBlZC90ZXN0CiAgICAgIENJX1BVQkxJU0g6IGZhbHNlCiAgICAtIENJX1RFU1Q6IDtzZXQgYm9vdHN0cmFwT3B0aW1pc2VkIGluIFRoaXNCdWlsZCA6PSB0cnVlIDtkb3R0eS1ib290c3RyYXBwZWQvdGVzdAogICAgICBDSV9QVUJMSVNIOiBmYWxzZQo.0COKo7FjFKxUxTYAwxWvpOHgRClgdi9A4M4Kb91h6HQ
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ Try it out
==========
To try it in your project see also the [Getting Started User Guide](http://dotty.epfl.ch/#getting-started).

Code of Conduct
===============
Dotty uses the [Scala Code of Conduct](https://www.scala-lang.org/conduct.html)
for all communication and discussion. This includes both GitHub, Gitter chat and
other more direct lines of communication such as email.

How to Contribute
=================
* [Getting Started as Contributor](http://dotty.epfl.ch/docs/contributing/getting-started.html)
Expand Down
3 changes: 2 additions & 1 deletion compiler/src/dotty/tools/dotc/core/Symbols.scala
Original file line number Diff line number Diff line change
Expand Up @@ -556,9 +556,10 @@ object Symbols {
type ThisName = TypeName

/** If this is a top-level class, and if `-Yretain-trees` is set, return the TypeDef tree
* for this class, otherwise EmptyTree.
* for this class, otherwise EmptyTree. This will force the info of the class.
*/
def tree(implicit ctx: Context): tpd.Tree /* tpd.TypeDef | tpd.EmptyTree */ = {
denot.info
// TODO: Consider storing this tree like we store lazy trees for inline functions
if (unpickler != null && !denot.isAbsent) {
assert(myTree.isEmpty)
Expand Down
4 changes: 3 additions & 1 deletion compiler/src/dotty/tools/dotc/core/Types.scala
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ object Types {
def isRef(sym: Symbol)(implicit ctx: Context): Boolean = stripAnnots.stripTypeVar match {
case this1: TypeRef =>
this1.info match { // see comment in Namer#typeDefSig
case TypeAlias(tp) => tp.isRef(sym)
case TypeAlias(tp) =>
assert((tp ne this) && (tp ne this1), s"$tp / $this")
tp.isRef(sym)
case _ => this1.symbol eq sym
}
case this1: RefinedOrRecType => this1.parent.isRef(sym)
Expand Down
34 changes: 25 additions & 9 deletions compiler/src/dotty/tools/dotc/interactive/InteractiveDriver.scala
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,13 @@ class InteractiveDriver(settings: List[String]) extends Driver {

def currentCtx: Context = myCtx

private val myOpenedFiles = new mutable.LinkedHashMap[URI, SourceFile]
private val myOpenedTrees = new mutable.LinkedHashMap[URI, List[SourceTree]]
private val myOpenedFiles = new mutable.LinkedHashMap[URI, SourceFile] {
override def default(key: URI) = NoSource
}

private val myOpenedTrees = new mutable.LinkedHashMap[URI, List[SourceTree]] {
override def default(key: URI) = Nil
}

def openedFiles: Map[URI, SourceFile] = myOpenedFiles
def openedTrees: Map[URI, List[SourceTree]] = myOpenedTrees
Expand All @@ -69,6 +74,10 @@ class InteractiveDriver(settings: List[String]) extends Driver {
}
}

// Presence of a file with one of these suffixes indicates that the
// corresponding class has been pickled with TASTY.
private val tastySuffixes = List(".hasTasty", ".tasty")

private def classNames(cp: ClassPath, packageName: String): List[String] = {
def className(classSegments: List[String]) =
classSegments.mkString(".").stripSuffix(".class")
Expand All @@ -85,9 +94,6 @@ class InteractiveDriver(settings: List[String]) extends Driver {
binFile.name.stripSuffix(".class")
else
null
// Presence of a file with one of these suffixes indicates that the
// corresponding class has been pickled with TASTY.
val tastySuffixes = List(".hasTasty", ".tasty")
prefix != null && {
binFile match {
case pf: PlainFile =>
Expand Down Expand Up @@ -123,8 +129,12 @@ class InteractiveDriver(settings: List[String]) extends Driver {
.stream
.toArray(new IntFunction[Array[ZipEntry]] { def apply(size: Int) = new Array(size) })
.toSeq
entries.filter(_.getName.endsWith(".tasty"))
.map(_.getName.replace("/", ".").stripSuffix(".tasty"))
for {
entry <- entries
name = entry.getName
tastySuffix <- tastySuffixes
if name.endsWith(tastySuffix)
} yield name.replace("/", ".").stripSuffix(tastySuffix)
}

// FIXME: classfiles in directories may change at any point, so we retraverse
Expand All @@ -136,8 +146,14 @@ class InteractiveDriver(settings: List[String]) extends Driver {
val root = dirCp.dir.toPath
Files.walkFileTree(root, new SimpleFileVisitor[Path] {
override def visitFile(path: Path, attrs: BasicFileAttributes) = {
if (!attrs.isDirectory && path.getFileName.toString.endsWith(".tasty")) {
names += root.relativize(path).toString.replace("/", ".").stripSuffix(".tasty")
if (!attrs.isDirectory) {
val name = path.getFileName.toString
for {
tastySuffix <- tastySuffixes
if name.endsWith(tastySuffix)
} {
names += root.relativize(path).toString.replace("/", ".").stripSuffix(tastySuffix)
}
}
FileVisitResult.CONTINUE
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/parsing/Parsers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1681,7 +1681,7 @@ object Parsers {

def addFlag(mods: Modifiers, flag: FlagSet): Modifiers = {
def incompatible(kind: String) = {
syntaxError(s"modifier(s) `${mods.flags}' not allowed for $kind")
syntaxError(ModifiersNotAllowed(mods.flags, kind))
Modifiers(flag)
}
if (compatible(mods.flags, flag)) mods | flag
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ public enum ErrorMessageID {
OnlyCaseClassOrCaseObjectAllowedID,
ExpectedClassOrObjectDefID,
AnonymousFunctionMissingParamTypeID,
SuperCallsNotAllowedInlineID
SuperCallsNotAllowedInlineID,
ModifiersNotAllowedID,
;

public int errorNumber() {
Expand Down
17 changes: 17 additions & 0 deletions compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import printing.Formatting
import ErrorMessageID._
import Denotations.SingleDenotation
import dotty.tools.dotc.ast.Trees
import dotty.tools.dotc.ast.untpd.Modifiers
import dotty.tools.dotc.core.Flags.{FlagSet, Mutable}
import dotty.tools.dotc.core.SymDenotations.SymDenotation

Expand Down Expand Up @@ -1614,4 +1615,20 @@ object messages {
val msg = s"super call not allowed in inline $symbol"
val explanation = "Method inlining prohibits calling superclass methods, as it may lead to confusion about which super is being called."
}

case class ModifiersNotAllowed(flags: FlagSet, sort: String)(implicit ctx: Context)
extends Message(ModifiersNotAllowedID) {
val kind = "Syntax"
val msg = s"modifier(s) `$flags' not allowed for $sort"
val explanation = {
val code = "sealed def y: Int = 1"
hl"""You tried to use a modifier that is inapplicable for the type of item under modification
|
|
|Consider the following example:
|$code
|In this instance, the modifier 'sealed' is not applicable to the item type 'def' (method)
"""
}
}
}
10 changes: 10 additions & 0 deletions compiler/test/dotty/tools/dotc/reporting/ErrorMessagesTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -839,4 +839,14 @@ class ErrorMessagesTests extends ErrorMessagesTest {
val SuperCallsNotAllowedInline(symbol) = err
assertEquals("method bar", symbol.show)
}

@Test def modifiersNotAllowed =
checkMessagesAfter("refchecks")("""lazy trait T""")
.expect { (ictx, messages) =>
implicit val ctx: Context = ictx
assertMessageCount(1, messages)
val ModifiersNotAllowed(flags, sort) :: Nil = messages
assertEquals("lazy", flags.toString)
assertEquals("trait", sort)
}
}
3 changes: 3 additions & 0 deletions doc-tool/resources/css/dottydoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ h1#doc-page-title {
margin: 10px 0 40px 10px;
font-family: "Source Sans Pro", sans-serif;
font-weight: 400;
display: -webkit-flex;
display: flex;
width: 550px;
}

div#post-title > h2#sub-title {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,9 +351,12 @@ object DottyLanguageServer {

/** Convert an lsp4j.Position to a SourcePosition */
def sourcePosition(driver: InteractiveDriver, uri: URI, pos: lsp4j.Position): SourcePosition = {
val source = driver.openedFiles(uri) // might throw exception
val p = Positions.Position(source.lineToOffset(pos.getLine) + pos.getCharacter)
new SourcePosition(source, p)
val source = driver.openedFiles(uri)
if (source.exists) {
val p = Positions.Position(source.lineToOffset(pos.getLine) + pos.getCharacter)
new SourcePosition(source, p)
}
else NoSourcePosition
}

/** Convert a SourcePosition to an lsp4j.Range */
Expand Down
13 changes: 11 additions & 2 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._
object ExposedValues extends AutoPlugin {
object autoImport {
val bootstrapFromPublishedJars = Build.bootstrapFromPublishedJars
val bootstrapOptimised = Build.bootstrapOptimised
}
}

Expand Down Expand Up @@ -52,6 +53,7 @@ object Build {
val JENKINS_BUILD = "dotty.jenkins.build"
val DRONE_MEM = "dotty.drone.mem"


val agentOptions = List(
// "-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005"
// "-agentpath:/home/dark/opt/yjp-2013-build-13072/bin/linux-x86-64/libyjpagent.so"
Expand Down Expand Up @@ -84,12 +86,14 @@ object Build {
lazy val dottydoc = inputKey[Unit]("run dottydoc")

lazy val bootstrapFromPublishedJars = settingKey[Boolean]("If true, bootstrap dotty from published non-bootstrapped dotty")
lazy val bootstrapOptimised = settingKey[Boolean]("Bootstrap with -optimise")

// Used in build.sbt
lazy val thisBuildSettings = Def.settings(
// Change this to true if you want to bootstrap using a published non-bootstrapped compiler
bootstrapFromPublishedJars := false,

bootstrapOptimised := false,

// Override `runCode` from sbt-dotty to use the language-server and
// vscode extension from the source repository of dotty instead of a
Expand Down Expand Up @@ -167,8 +171,6 @@ object Build {
// otherwise sbt 0.13 incremental compilation breaks (https://github.com/sbt/sbt/issues/3142)
scalacOptions ++= Seq("-bootclasspath", sys.props("sun.boot.class.path")),

scalacOptions += "-optimise",

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

Expand All @@ -177,6 +179,13 @@ object Build {
// ...but scala-library is
libraryDependencies += "org.scala-lang" % "scala-library" % scalacVersion,

scalacOptions ++= {
if (bootstrapOptimised.value)
Seq("-optimise")
else
Seq()
},

ivyConfigurations ++= {
if (bootstrapFromPublishedJars.value)
Seq(Configurations.ScalaTool)
Expand Down
1 change: 1 addition & 0 deletions tests/idempotency/Checker.scala
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@


object Test {
def main(args: Array[String]): Unit =
IdempotencyCheck.checkIdempotency("../out/idempotency")
Expand Down

0 comments on commit 5b1d7f2

Please sign in to comment.