Commit Graph

4502 Commits

Author SHA1 Message Date
Eugene Yokota be69daeb8d Add notes for #2453 2016-02-11 16:32:39 -05:00
Jason Zaugg 7d4890b68a Avoid CCE when scalac internally uses compileLate. Fixes #2452
For example, when the `--sourcepath` option is provided
and the refchecks phase compiles an annotation found
on a referenced symbol from the sourcepath.

`compileLate` assumes that all non-sentinel compiler
phases can be down cast to `GlobalPhase`.

This commit changes the two phases in SBT to extend
this instead of `Phase`. This has the knock on benefit
of simplifying the phases by letting the `GlobalPhase.run`
iterator over the list of compilation units and feed them
to us one by one.

I checked that the test case failed before making each
change.
2016-02-11 16:29:09 -05:00
eugene yokota d3962a01ff Merge pull request #2441 from Duhemm/wip/fix-2436
Include ONLY nonpublic vars in API hash of traits
2016-02-10 16:26:54 -05:00
Martin Duhem 6576844698 Hash of traits: include private fields, objects and super accessors 2016-02-10 18:15:44 +01:00
Martin Duhem edc1174468 Extend test `trait-private-var` with vals
Private vars and private vals defined in a trait impact the bytecode
generated for the implementors of these traits. The scripted test
`source-dependencies/trait-private-var` only accounted for private vars.

It now tries the same scenario both with private vars and private vals.
2016-02-09 15:28:35 +01:00
Martin Duhem 7d94251108 Also include private vals 2016-02-09 14:55:30 +01:00
Martin Duhem 8e17269c97 Include non-public vars in API hash of traits 2016-02-09 14:35:12 +01:00
eugene yokota 6f072f8f3b Merge pull request #2443 from eed3si9n/wip/2427
Fixes #2427 inter-project dependency interference with sbt-web
2016-02-05 12:18:36 -05:00
Eugene Yokota bd5453c0b0 Fixes #2427 inter-project dependency interference with sbt-web
sbt-web uses exportedProducts key as an extension point.
This removes exportedProductsAlways from 0.13.10-RC1,
and uses exportedProducts instead.
2016-02-05 08:28:59 -05:00
eugene yokota cdb52e96ca Merge pull request #2430 from Duhemm/wip/fix-2428
Update bridge retrieval in `consoleProject`
2016-02-04 23:40:40 -05:00
eugene yokota e41859ffe4 Merge pull request #2440 from cunei/toni-output-jars
Do not create dir, if trying to output classes to a jar
2016-02-04 18:38:32 -05:00
Martin Duhem be8ba763fa Include ONLY non-public members in API hash of traits
The previous logic was wrong and included all members of traits in their
API hash, which degraded the performance of the incremental compiler.

This commit changes this logic so that only the non-public members of
traits are included into their API hash.

Fixes #2436
2016-02-04 16:32:36 +01:00
Grzegorz Kossakowski 207dd762f4 Move `trait-member-modified` to source-dependencies
It's not clear what the distinction between compiler-project and
source-dependencies scripted tests is so let's stick to the one that has
the biggest number of tests for incremental compiler.
2016-02-04 16:32:35 +01:00
Grzegorz Kossakowski 74ffe5d064 Add a pending test for a modified member of a trait
The test shows that name hashing optimization is broken for members
defined in traits. The problem is that modification of a member of a trait
triggers change of a hash of trait's name.

The behavior covered by this test regressed in
40ebc82531
The bug is tracked in #2436.
2016-02-04 16:32:35 +01:00
Antonio Cunei 3e50fdc825 Do not create dir, if trying to output classes to a jar 2016-02-04 15:11:55 +01:00
Martin Duhem 6cabb9b4cb Update bridge retrieval in `consoleProject`
Fixes sbt/sbt#2428
2016-01-31 17:09:56 +01:00
Dale Wijnand a92e50929c Merge pull request #2419 from eed3si9n/wip/2415
Fixes #2415. Hide global setting fix behind sbt.globalsettingfix
2016-01-25 23:00:44 +00:00
Eugene Yokota 9da5fc871b Changed the flag name to "sbt.global.autoimport" per review. 2016-01-26 03:05:30 +09:00
Martin Duhem e966329776 Merge pull request #2414 from smarter/fix/duplicate-defs
[0.13.10] ExtractAPI: avoid unnecessary duplication of defs with primitive types
2016-01-25 09:26:29 +01:00
Dale Wijnand 03524e3329 Merge pull request #2413 from smarter/fix/vc-return-type
[0.13.10] Always invalidate API when return type is a value class
2016-01-25 07:02:20 +00:00
Guillaume Martres 726b5c8a30 ExtractAPI: avoid unnecessary duplication of defs with primitive types
If a method's type contains a non-primitive value class then it has two
signatures: one before erasure and one after erasure. Before this
commit, we checked if this was the case using `isAnyValSubtype`, but
this is too crude since primitive value classes are also subtypes of
`AnyVal` but do not change signature after erasure.

This commit replaces `isAnyValSubtype` by `isDerivedValueClass` which
excludes primitive value classes.

In practice, for an empty class, this reduces the size of the output of
`DefaultShowAPI` from 65 lines to 25 lines.
Before:
https://gist.github.com/smarter/cf1d6fe58efda88d6ee6#file-old-api
After:
https://gist.github.com/smarter/cf1d6fe58efda88d6ee6#file-new-api
2016-01-25 02:53:52 +01:00
Guillaume Martres 0993c1c7cc Always invalidate API when return type is a value class
Before this commit, we did not do the invalidation for methods with
multiple parameter list, the comment above `hasValueClassAsReturnType`
said:

  Note: We only inspect the "outermost type" (i.e. no recursion) because
  we don't need to inspect after erasure a function that would, for
  instance, return a function that returns a subtype of AnyVal.

But this is wrong: a method with signature:
  def foo(a: A)(b: B): C
is erased to:
  def foo(a: A, b: B): C
and not, as the comment in the code suggest, to:
  def foo(a: A): B => C
so we do need to inspect the final result type of methods, because they
can be value classes that will be erased to their underlying value.
2016-01-25 02:53:34 +01:00
Eugene Yokota ceccbf2d5a Fixes #2415. Hide global setting fix behind sbt.globalsettingfix
We are hiding a bug fix on global setting that was not importing auto
imports because fixing this via sbt/sbt#2399 breaks the source
compatibility: sbt/sbt#2415
I've split out the relevant portion of the scripted test into
global-settings, and marked it pending.
2016-01-24 16:50:21 -08:00
Eugene Yokota e64b01142b Merge branch '0.13' into 0.13.10 2016-01-24 15:57:53 -08:00
eugene yokota 14dcca6a31 Merge pull request #2418 from Duhemm/fix-2411
Fix #2411
2016-01-24 15:56:21 -08:00
Martin Duhem 1ebe86b704 Restore compiler bridge source for Scala < 2.10 2016-01-24 18:54:03 +01:00
Martin Duhem a93f1e50c8 Add second test case for sbt/sbt#2411
Thanks @smarter, see sbt/sbt#2416
2016-01-24 09:42:01 +01:00
Adriaan Moors 49431eb6f8 determine bytecode type with transformedType
... not exitingPostErasure, as this phase-travel crashes the compile
(it's only really meant for going back in time, right?)
2016-01-24 09:31:53 +01:00
Eugene Yokota 27039e2b3c Reproduce #2411 2016-01-24 08:56:46 +01:00
Dale Wijnand 395851147c Merge pull request #2409 from dwijnand/tweak-0.13.10-notes
[0.13.10] Tweak the release notes
2016-01-23 02:51:37 +00:00
Dale Wijnand 26b9d9c1ab Notes: Collapse an improvement into its fix 2016-01-22 23:19:03 +00:00
Dale Wijnand 8a12edbfa0 Notes: Reword some passages 2016-01-22 23:18:31 +00:00
Dale Wijnand 899ac9eb98 Notes: Fix links 2016-01-22 23:14:27 +00:00
Dale Wijnand 223cb2632e Notes: Sort issues, move ivy/jline to the top 2016-01-22 23:11:43 +00:00
Eugene Yokota 06658661a1 Hand merged notes 2016-01-22 14:47:37 -05:00
eugene yokota afa8603ef7 Merge pull request #2407 from eed3si9n/wip/2347
Adds CompatibilityWarningOptions
2016-01-22 13:24:41 -05:00
Eugene Yokota a9dc9be83b Adds CompatibilityWarningOptions. Fixes #2347
This addresses 0.13.10 regression, which currently warns users about
Maven incompatibility on a private configuration. This adds a config
class so the build user can control the level of the warning as well as
the target configuration to be monitored.
By default, we are only going to look at `Compile` and `Runtime`.
2016-01-22 01:39:00 -05:00
Dale Wijnand 35aed2bc20 Merge pull request #2399 from timcharper/0.13
bugfix - apply autoImports for global plugins at global configuration stage
2016-01-19 06:41:08 +00:00
Tim Harper 7d86bc70d3 bugfix - apply autoImports for global plugins at global configuration stage
Previously, the autoimports for globally defined plugins were not
imported for global configuration files, although they were imported for
project configuration files.

This patch causes an additional plugin discovery phase to happen during
global config evaluation, so that auto-plugins can be detected and their
imports subsequently included.
2016-01-18 15:05:29 -07:00
Tim Harper d6c80ba1bd add notes on running tests 2016-01-18 15:02:23 -07:00
Tim Harper d86e52830e Amend contributing build instructions to help solve potential build problems 2016-01-18 00:41:25 -07:00
eugene yokota d9f10853fb Merge pull request #2371 from dwijnand/update-sbt-plugins
Upgrade sbt plugins. Fixes #2368
2016-01-16 03:11:17 -05:00
Dale Wijnand 84cba9669c Upgrade sbt plugins. Fixes #2368
Tested manually:

  $ grep 'version.*:=' build.sbt
  version := "0.13.10-SNAPSHOT",
  $ git archive --prefix=sbt-0.13.10-SNAPSHOT/ -o ~/Desktop/sbt-0.13.10-SNAPSHOT.tgz HEAD
  $ cd ~/Desktop
  $ ls
  sbt-0.13.10-SNAPSHOT.tgz
  $ tar xfz sbt-0.13.10-SNAPSHOT.tgz
  $ cd sbt-0.13.10-SNAPSHOT/
  $ sbt info
  [info] Loading global plugins from /Users/dnw/.dotfiles/.sbt/0.13/plugins
  [info] Loading project definition from /Users/dnw/Desktop/sbt-0.13.10-SNAPSHOT/project
  [info] Updating {file:/Users/dnw/Desktop/sbt-0.13.10-SNAPSHOT/project/}sbt-0-13-10-snapshot-build...
  [info] Resolving org.fusesource.jansi#jansi;1.4 ...
  [info] Done updating.
  [warn] There may be incompatibilities among your library dependencies.
  [warn] Here are some of the libraries that were evicted:
  [warn]  * com.typesafe.sbt:sbt-site:0.8.1 -> 0.8.2
  [warn] Run 'evicted' to see detailed eviction warnings
  [info] Compiling 12 Scala sources to /Users/dnw/Desktop/sbt-0.13.10-SNAPSHOT/project/target/scala-2.10/sbt-0.13/classes...
  [info] This is sbt 0.13.9
  [info] The current project is {file:/Users/dnw/Desktop/sbt-0.13.10-SNAPSHOT/}sbtRoot 0.13.10-SNAPSHOT
  [info] The current project is built against Scala 2.10.6
  [info] Available Plugins: sbt.plugins.IvyPlugin, sbt.plugins.JvmPlugin, sbt.plugins.CorePlugin...
  [info] sbt, sbt plugins, and build definitions are using Scala 2.10.5
2016-01-16 00:24:05 +00:00
eugene yokota a5bda9d80d Merge pull request #2354 from eed3si9n/wip/internal
Inter-project dependency tracking
2016-01-13 14:26:45 -05:00
Eugene Yokota c55c3ec966 Merge branch 'backport/internal-tracking' into wip/internal 2016-01-13 12:59:51 -05:00
Eugene Yokota 98b26ae5d3 Inter-project dependency tracking. Fixes #2266
Adds `trackInternalDependencies` and `exportToInternal` settings. These
can be used to control whether to trigger compilation of a dependent
subprojects when you call `compile`. Both keys will take one of three
values: `TrackLevel.NoTracking`, `TrackLevel.TrackIfMissing`, and
`TrackLevel.TrackAlways`. By default they are both set to
`TrackLevel.TrackAlways`.

When `trackInternalDependencies` is set to `TrackLevel.TrackIfMissing`,
sbt will no longer try to compile internal (inter-project) dependencies
automatically, unless there are no `*.class` files (or JAR file when
`exportJars` is `true`) in the output directory. When the setting is
set to `TrackLevel.NoTracking`, the compilation of internal
dependencies will be skipped. Note that the classpath will still be
appended, and dependency graph will still show them as dependencies.
The motivation is to save the I/O overhead of checking for the changes
on a build with many subprojects during development. Here's how to set
all subprojects to `TrackIfMissing`.

    lazy val root = (project in file(".")).
      aggregate(....).
      settings(
        inThisBuild(Seq(
          trackInternalDependencies := TrackLevel.TrackIfMissing,
          exportJars := true
        ))
      )

The `exportToInternal` setting allows the dependee subprojects to opt
out of the internal tracking, which might be useful if you want to
track most subprojects except for a few. The intersection of the
`trackInternalDependencies` and `exportToInternal` settings will be
used to determine the actual track level. Here's an example to opt-out
one project:

    lazy val dontTrackMe = (project in file("dontTrackMe")).
      settings(
        exportToInternal := TrackLevel.NoTracking
      )
2016-01-13 12:56:28 -05:00
eugene yokota 7e88edbc25 Merge pull request #2358 from gkossakowski/compileInterface-tests
Run unit tests from compileInterface on Travis CI.
2016-01-08 20:52:18 -05:00
Grzegorz Kossakowski dd0ed7de5e Fix DependencySpecification test.
This is a fixup of 0f616294c4.
That commit assumed that dealiasing is being done for types referred in
self type. It was changed to not do that but the test wasn't updated.
Unfortunately, that mistake slipped by during PR review because unit tests
of compileInterface were not ran (see #2358).
2016-01-09 00:00:14 +01:00
Grzegorz Kossakowski e738bc3f73 Run unit tests from compileInterface on Travis CI.
Also, make the intent of the env variable clearer in travis configuration.

Fixes #2357.
2016-01-08 21:53:53 +01:00
eugene yokota d06b49d66d Merge pull request #2355 from eed3si9n/wip/scripted-more-mem
Adds more memory to internal scripted task
2016-01-08 11:22:27 -05:00