Commit Graph

112 Commits

Author SHA1 Message Date
Bruno Bieth e4dd71c08c execute scripted test without publishing SBT first
Saves you some time when only your test has changed.
2013-11-13 15:51:21 -05:00
Grzegorz Kossakowski a37d8d4770 Fix unstable existential type names bug.
Fix the problem with unstable names synthesized for existential
types (declared with underscore syntax) by renaming type variables
to a scheme that is guaranteed to be stable no matter where given
the existential type appears.

The sheme we use are De Bruijn-like indices that capture both position
of type variable declarion within single existential type and nesting
level of nested existential type. This way we properly support nested
existential types by avoiding name clashes.

In general, we can perform renamings like that because type variables
declared in existential types are scoped to those types so the renaming
operation is local.

There's a specs2 unit test covering instability of existential types.
The test is included in compiler-interface project and the build
definition has been modified to enable building and executing tests
in compiler-interface project. Some dependencies has been modified:

  * compiler-interface project depends on api project for testing
    (test makes us of SameAPI)
  * dependency on junit has been introduced because it's needed
    for `@RunWith` annotation which declares that specs2 unit
    test should be ran with JUnitRunner

SameAPI has been modified to expose a method that allows us to
compare two definitions.

This commit also adds `ScalaCompilerForUnitTesting` class that allows
to compile a piece of Scala code and inspect information recorded
callbacks defined in  `AnalysisCallback` interface. That class uses
existing ConsoleLogger for logging. I considered doing the same for
ConsoleReporter. There's LoggingReporter defined which would fit our
usecase but it's defined in compile subproject that compiler-interface
doesn't depend on so we roll our own.

ScalaCompilerForUnit testing uses TestCallback from compiler-interface
subproject for recording information passed to callbacks. In order
to be able to access TestCallback from compiler-interface
subproject I had to tweak dependencies between interface and
compiler-interface so test classes from the former are visible in the
latter. I also modified the TestCallback itself to accumulate apis in
a HashMap instead of a buffer of tuples for easier lookup.

An integration test has been added which tests scenario
mentioned in #823.

This commit fixes #823.
2013-10-29 16:39:50 +01:00
Mark Harrah fb81ca67d8 bump Scala version to 2.10.3 2013-10-02 19:39:17 -04:00
Mark Harrah 72125e73ce Build: scope root sources to 'doc' task since they shouldn't be compiled normally. 2013-09-26 09:17:07 -04:00
Mark Harrah b2599c1bb1 Restore sxr support and fix links to sxr'd sources. Fixes #863. 2013-09-24 11:34:14 -04:00
Mark Harrah 7b1b33758c Convert -classpath to CLASSPATH when forking on Windows and length exceeds a heuristic maximum. Fixes #755. 2013-09-11 18:22:16 -04:00
Mark Harrah 005384f9af Use sbt 0.13.0 to build the 0.13 branch. 2013-09-10 08:30:00 -04:00
Mark Harrah 50feb1c383 additional helpers to build against 2.11 nightlies 2013-07-18 22:45:04 -04:00
Mark Harrah 2195de1451 remove redundant crossPaths settings 2013-07-18 22:36:40 -04:00
Mark Harrah a0fdb3885d 0.13.1-SNAPSHOT to be able to use 0.13 plugins without changes 2013-07-17 14:58:53 -04:00
Mark Harrah 7278fbc567 Scala 2.11 modularized dependencies 2013-07-09 14:55:30 -04:00
Mark Harrah ab0d61c3fe define test-interface dependency in build in one place 2013-06-28 09:08:29 -04:00
cheeseng 5bb46359b5 Change to use test-interface-1.0-SNAP7, and use ScalaTest 2.0.M6-SNAP26 which implemented test-interface-1.0-SNAP7. 2013-06-28 17:18:38 +08:00
Mark Harrah 989c1d3dc6 auto-generate conscript launchconfigs from launcher boot.properties 2013-06-28 00:01:19 -04:00
Mark Harrah 1048976844 jline/jansi fixes for windows. Fixes #763, fixes #562.
The startup script should set sbt.cygwin=true if running from cygwin.
This will set the terminal type properly for JLine if not already set.
If sbt.cygwin=false or unset and os.name includes "windows", JAnsi is
downloaded by the launcher and installed on standard out/err.

The value for jline.terminal is transformed from explicit jline.X to
the basic types "windows", "unix", or "none".  Now that sbt uses JLine
2.0, these types are understood by both sbt's JLine and Scala's.
Older Scala versions shaded the classes but not the terminal property
so both couldn't be configured with a class name at the same time.
2013-06-26 13:40:33 -04:00
Mark Harrah aeab5bfdaa fix duplicate launcher upload 2013-06-24 20:06:38 -04:00
Mark Harrah a3defe2556 update to Scala 2.10.2 final 2013-06-20 15:44:29 -04:00
Mark Harrah 280e1b6d60 Build cleanup, publish launcher normally, pull it normally in scripted plugin
Still want to deploy the launcher to the previous path for compatibility with
existing scripts so that the transition to 0.13 is not impeded.
2013-06-20 15:44:29 -04:00
Mark Harrah 5dc671c7f8 Synchronize ClassLoaderCache and the Scala provider cache.
Construction of Scala providers was already properly synchronized jvm and machine-wide.
The cache on top of construction was not and neither was the newer ClassLoaderCache.
This could cause the same Scala version to be loaded in multiple class loaders, taking
up more permgen space and possibly decreasing performance due to less effective jit.

The issue is very rare in practice for 0.13 because of the low probability of contention
on ClassLoaderCache.  This is because the work for a cache miss is mainly the construction
of a URLClassLoader.  In 0.12, however, the work potentially involved network access and
class loading (not just class loader construction), thus greatly increasing the probability
of contention and thus duplicate work (i.e. class loader construction).

When there is contention, multiple class loaders are constructed and then preserved by the
scalaInstance task in each project throughout the first task execution.  Only when multiple
scalaInstance tasks execute simultaneously and only during the first execution does this occur.
(Technically, it could still happen later, but it doesn't in practice.)

This means that the number of duplicate class loaders should quickly saturate instead of growing
linearly with the number of projects.  It also means that the impact depends on the exact
tree structure of projects.  A linear chain of dependencies will be unaffected, but a build with
independent leaves may be limited by the number of cores.  The number of cores affects
the number of threads typically used by the task engine, which limits the number of concurrently
executing scalaInstance tasks.

In summary, this might affect the first, cold compilation of a multi-module project with
independent leaves on a multi-core machine with Scala version different from the version used
for sbt.  It might increase the maximum permgen requirements as well as slow the jit compilation
by up to one task execution.  Subsequent compilations should be unaffected and the permgen
utilization return to be as expected.
2013-06-19 21:38:06 -04:00
Mark Harrah cb3df0982f snapshot version for development 2013-06-06 20:06:07 -04:00
Mark Harrah 6cee9d4aa4 0.13.0-Beta2 2013-06-05 23:57:21 -04:00
Mark Harrah e83038bed4 Fix issue with JLine dependency.
The reported issue was a JLine class not being found on sbt startup.

JLine was depended on in the sbt build in two places, one with an extra
attribute (component) and one without.  The retrieve pattern used by the
launcher includes that extra attribute.  Previously, the dependency
without the attribute was selected and jline properly ended up on the sbt
classpath.  Now, either by bumping JLine to 2.11 or some other
insignificant change, jline ends up in a subdirectory for the component
and doesn't get on the classpath.

(The move in 0.10 away from retrieving based on patterns and
using things directly from the cache was good, but this can't be
used in the launcher until a hash-based artifact is used so that
sbt+Scala jars aren't deleted or overwritten while sbt runs.)

A secondary issue was that the compiler-interface-src artifact didn't have
a configuration and was therefore not included in the published artifacts.
2013-06-03 22:49:48 -04:00
Mark Harrah 90d7834c86 snapshot version for development 2013-06-03 10:05:26 -04:00
Mark Harrah 19d75ae2f9 preparation for 0.13.0-Beta1 2013-06-01 10:56:30 -04:00
Mark Harrah 16b9f0a925 2.10.2-RC2 2013-05-30 19:22:17 -04:00
Mark Harrah 8d461953d4 snapshot version 2013-05-06 08:28:34 -04:00
Mark Harrah 5b90eee971 0.13.0-M2 2013-05-05 22:34:59 -04:00
Mark Harrah c3a5042f02 drop httpclient dependency, which wasn't actually being used by Ivy 2013-05-05 15:42:15 -04:00
cheeseng 838b737caa Bump up test-interface dependency to version 1.0-SNAP3. 2013-04-22 14:22:12 +08:00
Mark Harrah ebd24e95df back to a snapshot version 2013-03-18 11:47:45 -04:00
Mark Harrah 26d422fd0c 0.13.0-M1 2013-03-18 10:06:37 -04:00
Mark Harrah 6d4da5e394 precompile against Scala 2.9.3 2013-03-18 10:06:24 -04:00
Mark Harrah 6750ef7614 use Scala 2.10.1 final 2013-03-13 12:40:03 -04:00
Mark Harrah 9eb2406e6c Scala 2.10.1-RC3 2013-03-05 17:22:12 -05:00
Mark Harrah 8c4ebabe19 remove JLine from the launcher
It is no longer necessary for it to be loaded in a stable class loader
and line reading in the launcher does not require anything more advanced
than java.io.Console.readLine(String).
Scala versions 2.8 and later use the version that goes through JAnsi
and for that it is sufficient to have JNA in a stable loader.
2013-02-26 09:27:56 -05:00
Mark Harrah 67c459b6a2 -Ymacro-no-expand for API docs 2013-02-13 08:13:50 -05:00
Mark Harrah 76e0a941ba Update to 2.10.1-RC1
Needed an explicit type in PMap to workaround an error.
Need to drop tuple assignment of parser.parsed in input task macro as a workaround
  for macro/resetAllAttrs/pattern matching/annotation issue in RC1.
2013-02-13 07:17:20 -05:00
Mark Harrah 7a3a8bb50b Disable -Xlint for scalac. Too many 'Adapting argument list by creating a 2-tuple' warnings. 2013-02-13 03:25:13 -05:00
Mark Harrah c0b1bb51e6 -Xlint 2013-02-04 17:30:31 -05:00
Eugene Yokota 125727ba83 support binary version in launcher 2013-01-29 16:55:13 -05:00
Paolo G. Giarrusso b0fe85490c Enable Java -Xlint warnings, excluding serialization-related ones 2013-01-22 09:29:03 -05:00
Mark Harrah b5587700fd use provisionally published sbinary 2012-12-31 14:06:28 -05:00
Mark Harrah c358512e0b use 2.10.0 final 2012-12-31 09:23:14 -05:00
Mark Harrah 329b42453b move Eval test to correct location 2012-12-19 10:17:56 -05:00
Grzegorz Kossakowski ae211ee33e Cleanup parameter list of `ScriptedTests`.
All of `sbtVersion`, `defScalaVersion` and `buildScalaVersions` were
not used anymore. According to @harrah they are coming from really
old days of sbt and are not needed because of changes to how sbt
interacts with different Scala versions.
2012-12-14 12:57:47 -05:00
Mark Harrah 005b2b356f fix IO tests, which needed scala-compiler.jar on the classpath 2012-12-04 13:20:03 -05:00
Mark Harrah c1051f1f1e Source dependency on sbinary for 2.10.0-RC* for now 2012-12-03 08:56:55 -05:00
Mark Harrah 46b739aa5a bump to Scala 2.10.0-RC2 2012-11-18 09:18:22 -05:00
Mark Harrah 44e9c26162 bump to 2.10.0-RC1 2012-11-17 20:23:07 -05:00
Mark Harrah 522414cd99 AbsTypeTag -> WeakTypeTag and converted more settings 2012-11-17 20:23:06 -05:00