summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build.xml11
-rw-r--r--src/compiler/scala/reflect/internal/Symbols.scala4
-rw-r--r--src/compiler/scala/tools/nsc/Global.scala28
-rw-r--r--src/library/scala/collection/immutable/Map.scala1
-rw-r--r--test/disabled/properties.check (renamed from test/files/presentation/properties.check)0
-rw-r--r--test/disabled/properties/Runner.scala (renamed from test/files/presentation/properties/Runner.scala)0
-rw-r--r--test/disabled/properties/src/properties.scala (renamed from test/files/presentation/properties/src/properties.scala)0
-rwxr-xr-xtools/epfl-build5
-rwxr-xr-xtools/epfl-publish51
-rwxr-xr-xtools/get-scala-revision27
10 files changed, 89 insertions, 38 deletions
diff --git a/build.xml b/build.xml
index e02a33bed2..d179b8e240 100644
--- a/build.xml
+++ b/build.xml
@@ -189,9 +189,6 @@ PROPERTIES
<!-- if ANT_OPTS is already set by the environment, it will be unaltered,
but if it is unset it will take this default value. -->
<property name="env.ANT_OPTS" value="-Xms1536M -Xmx1536M -Xss1M -XX:MaxPermSize=192M -XX:+UseParallelGC" />
-
- <!-- to find max heap usage: -Xaprof ; currently at 980M for locker.comp -->
- <echo message="Forking with JVM opts: ${env.ANT_OPTS} ${jvm.opts}" />
<property
name="scalacfork.jvmargs"
@@ -246,8 +243,12 @@ INITIALISATION
value="${version.major}.${version.minor}.${version.patch}.${git.describe}"/>
<!-- And print-out what we are building -->
- <echo level="info" message="Build number is '${version.number}'"/>
- <echo level="info" message="Built ${time.human} from revision ${git.describe} with ${java.vm.name} ${java.version}"/>
+ <echo message=" build time: ${time.human}" />
+ <echo message=" java version: ${java.vm.name} ${java.version}" />
+ <echo message=" java args: ${env.ANT_OPTS} ${jvm.opts}" />
+ <echo message=" javac args: ${javac.args}" />
+ <echo message=" scalac args: ${scalac.args}" />
+ <echo message=" build number: ${version.number}" />
<!-- Local libs (developer use.) -->
<mkdir dir="${lib-extra.dir}"/>
diff --git a/src/compiler/scala/reflect/internal/Symbols.scala b/src/compiler/scala/reflect/internal/Symbols.scala
index 75fd733e7e..bc0c81a54b 100644
--- a/src/compiler/scala/reflect/internal/Symbols.scala
+++ b/src/compiler/scala/reflect/internal/Symbols.scala
@@ -1097,6 +1097,10 @@ trait Symbols extends api.Symbols { self: SymbolTable =>
def typeParams: List[Symbol] =
if (isMonomorphicType) Nil
else {
+ // analogously to the "info" getter, here we allow for two completions:
+ // one: sourceCompleter to LazyType, two: LazyType to completed type
+ if (validTo == NoPeriod)
+ atPhase(phaseOf(infos.validFrom))(rawInfo load this)
if (validTo == NoPeriod)
atPhase(phaseOf(infos.validFrom))(rawInfo load this)
diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala
index b4f14dd21b..f14474eda8 100644
--- a/src/compiler/scala/tools/nsc/Global.scala
+++ b/src/compiler/scala/tools/nsc/Global.scala
@@ -343,7 +343,14 @@ class Global(var currentSettings: Settings, var reporter: Reporter) extends Symb
def run() {
echoPhaseSummary(this)
- currentRun.units foreach applyPhase
+ currentRun.units foreach { unit =>
+ if (opt.timings) {
+ val start = System.nanoTime
+ try applyPhase(unit)
+ finally unitTimings(unit) += (System.nanoTime - start)
+ }
+ else applyPhase(unit)
+ }
}
def apply(unit: CompilationUnit): Unit
@@ -669,6 +676,21 @@ class Global(var currentSettings: Settings, var reporter: Reporter) extends Symb
protected lazy val phasesSet = new mutable.HashSet[SubComponent]
protected lazy val phasesDescMap = new mutable.HashMap[SubComponent, String] withDefaultValue ""
private lazy val phaseTimings = new Phases.TimingModel // tracking phase stats
+ private lazy val unitTimings = mutable.HashMap[CompilationUnit, Long]() withDefaultValue 0L // tracking time spent per unit
+ private def unitTimingsFormatted(): String = {
+ def toMillis(nanos: Long) = "%.3f" format nanos / 1000000d
+
+ val formatter = new util.TableDef[(String, String)] {
+ >> ("ms" -> (_._1)) >+ " "
+ << ("path" -> (_._2))
+ }
+ "" + (
+ new formatter.Table(unitTimings.toList sortBy (-_._2) map {
+ case (unit, nanos) => (toMillis(nanos), unit.source.path)
+ })
+ )
+ }
+
protected def addToPhasesSet(sub: SubComponent, descr: String) {
phasesSet += sub
phasesDescMap(sub) = descr
@@ -1149,8 +1171,10 @@ class Global(var currentSettings: Settings, var reporter: Reporter) extends Symb
if (opt.profileAll)
profiler.stopProfiling()
- if (opt.timings)
+ if (opt.timings) {
inform(phaseTimings.formatted)
+ inform(unitTimingsFormatted)
+ }
// In case no phase was specified for -Xshow-class/object, show it now for sure.
if (opt.noShow)
diff --git a/src/library/scala/collection/immutable/Map.scala b/src/library/scala/collection/immutable/Map.scala
index 45cf088dd9..bbefd983fd 100644
--- a/src/library/scala/collection/immutable/Map.scala
+++ b/src/library/scala/collection/immutable/Map.scala
@@ -47,6 +47,7 @@ trait Map[A, +B] extends Iterable[(A, B)]
def withDefault[B1 >: B](d: A => B1): immutable.Map[A, B1] = new Map.WithDefault[A, B1](this, d)
/** The same map with a given default value.
+ * Note: `get`, `contains`, `iterator`, `keys`, etc are not affected by `withDefaultValue`.
*
* Invoking transformer methods (e.g. `map`) will not preserve the default value.
*
diff --git a/test/files/presentation/properties.check b/test/disabled/properties.check
index a721d49e3a..a721d49e3a 100644
--- a/test/files/presentation/properties.check
+++ b/test/disabled/properties.check
diff --git a/test/files/presentation/properties/Runner.scala b/test/disabled/properties/Runner.scala
index 1ef3cf9025..1ef3cf9025 100644
--- a/test/files/presentation/properties/Runner.scala
+++ b/test/disabled/properties/Runner.scala
diff --git a/test/files/presentation/properties/src/properties.scala b/test/disabled/properties/src/properties.scala
index 35b6a92221..35b6a92221 100644
--- a/test/files/presentation/properties/src/properties.scala
+++ b/test/disabled/properties/src/properties.scala
diff --git a/tools/epfl-build b/tools/epfl-build
index e8f1be4a46..dd66307de3 100755
--- a/tools/epfl-build
+++ b/tools/epfl-build
@@ -10,8 +10,7 @@ Usage: $0 <version> [opt opt ...]
Example: $0 -Xcheckinit -Ycheck:all
Environment variables:
-
- EXTRA_TARGETS Additional ant targets to run after nightly
+ extra_ant_targets Additional ant targets to run after nightly
EOM
exit 0
@@ -25,5 +24,5 @@ ant all.clean && ./pull-binary-libs.sh
ant $scalaArgs build-opt &&
ant $scalaArgs nightly &&
-for target in $EXTRA_TARGETS; do ant $target ; done
+for target in $extra_ant_targets; do ant $target ; done
# [[ -n "$BUILD_DOCSCOMP" ]] && ant docscomp
diff --git a/tools/epfl-publish b/tools/epfl-publish
index 5f38bd067b..e9cd97b3d2 100755
--- a/tools/epfl-publish
+++ b/tools/epfl-publish
@@ -1,31 +1,50 @@
#!/usr/bin/env bash
#
-# publishes nightly build
+# publishes nightly build if $publish_to is set in environment.
+# alternate maven settings.xml file given in $maven_settings.
+#
-[[ $# -eq 2 ]] || {
+[[ $# -eq 1 ]] || {
cat <<EOM
-Usage: $0 <scala version> <rsync dest>
+Usage: $0 <scala version>
+
+Environment variables:
+ publish_to rsync destination
EOM
exit 0
}
+version="$1"
[[ -d dists/archives ]] || {
echo "Can't find build, has it completed? No directory at dists/archives"
exit 1
}
-version="$1"
-rsyncDest="$2"
-
# should not be hardcoded
-mavenSettings="/home/linuxsoft/apps/hudson-maven-settings/settings.xml"
+# adds -Dsettings.file= if fixed path is present
+mavenSettingsOption () {
+ hardcoded_path="/home/linuxsoft/apps/hudson-maven-settings/settings.xml"
+
+ # environment variable
+ if [[ -n $maven_settings ]]; then
+ echo -Dsettings.file="$maven_settings"
+ elif [[ -f $hardcoded_path ]]; then
+ echo -Dsettings.file="$hardcoded_path"
+ fi
+}
+
+mavenSettings=${maven_settings:-findMavenSettings}
-echo "Copying nightly build to $rsyncDest"
-# Archive Scala nightly distribution
-rsync -az dists/archives/ "$rsyncDest/distributions"
-# don't publish docs in 2.8.x
-[[ $version == "2.8.x" ]] || rsync -az build/scaladoc/ "$rsyncDest/docs"
-# sbaz
-[[ -d dists/sbaz ]] && rsync -az dists/sbaz/ "$rsyncDest/sbaz"
-# Deploy the maven artifacts on scala-tools.org
-( cd dists/maven/latest && ant deploy.snapshot -Dsettings.file="$mavenSettings" )
+if [[ -z $publish_to ]]; then
+ echo "Nothing to publish."
+else
+ echo "Publishing nightly build to $publish_to"
+ # Archive Scala nightly distribution
+ rsync -az dists/archives/ "$publish_to/distributions"
+ # don't publish docs in 2.8.x
+ [[ $version == "2.8.x" ]] || rsync -az build/scaladoc/ "$publish_to/docs"
+ # sbaz
+ [[ -d dists/sbaz ]] && rsync -az dists/sbaz/ "$publish_to/sbaz"
+ # Deploy the maven artifacts on scala-tools.org
+ ( cd dists/maven/latest && ant deploy.snapshot $(mavenSettingsOption) )
+fi
diff --git a/tools/get-scala-revision b/tools/get-scala-revision
index e8597844cc..3977a61040 100755
--- a/tools/get-scala-revision
+++ b/tools/get-scala-revision
@@ -1,19 +1,22 @@
-#!/bin/sh
+#!/usr/bin/env bash
#
# Usage: get-scala-revision [dir]
# Figures out current scala revision of a git clone.
#
# If no dir is given, current working dir is used.
-[ -n "$1" ] && cd "$1"
+# not like releases come out so often that we are duty-bound
+# to recalculate this every time.
+# git merge-base v2.9.1 master
+devbase="d6f3184fc8"
-# dev should be a tag at the merge-base of master and the
-# most recent release.
-if [ -z $(git tag -l dev) ]; then
- # no dev tag available - this will generate dev-g<sha>
- echo "dev-g$(git describe HEAD --abbrev=7 --always)"
-else
- # dev tag exists - this generates dev-NNNN-g<sha>
- # where NNNN is the number of commits since dev.
- git describe HEAD --abbrev=7 --match dev
-fi
+# reimplementing git describe hopefully in a way which works
+# without any particular tags, branches, or recent versions of git.
+# this is supposed to generate
+# dev-NNNN-g<sha>
+# where NNNN is the number of commits since devbase, which
+# is the merge-base of the most recent release and master.
+# Presently hardcoded to reduce uncertainty, v2.9.1/master.
+commits=$(git --no-pager log --pretty=oneline $devbase..HEAD | wc -l)
+sha=$(git rev-list -n 1 HEAD)
+printf "dev-%s-g%s\n" $commits ${sha:0:7}