Commit Graph

3049 Commits

Author SHA1 Message Date
Josh Suereth b9489c6035 Fix compilation failure due to missing type annotation. 2014-01-07 21:42:24 -05:00
Grzegorz Kossakowski b581b60aa4 Merge pull request #1069 from benjyw/0.13-format-v4-A
Make analysis file portable.
2014-01-07 15:50:23 -08:00
Benjy 2e1809e17e Make analysis file portable.
Serializes CompileSetup as text instead of base64-encoded
binary-serialized object.

This is necessary so that file paths in the CompileSetup can be
rebased when porting analysis files between systems.
2014-01-07 22:39:47 +00:00
Grzegorz Kossakowski af39679549 Merge pull request #1042 from gkossakowski/name-hashing
Implement name hashing algorithm in incremental compiler
2014-01-06 15:40:18 -08:00
Grzegorz Kossakowski f4940df48d Make all APIChange subclasses final.
They should have been final from the beginning. We are fixing that
omission now.
2014-01-07 00:20:17 +01:00
Grzegorz Kossakowski 6cf79aba08 Mark test that passes when name hashing is enabled.
There's one test that starts to pass when we enable name hashing. It's
`import-class` which tests whether tracking of dependencies that arise
from imports is properly tracked. The name hashing algorithm uses different
dependency tracking compared to the old algorithm and the new dependency
extraction logic does handle import tree nodes properly so the test passes.

We "mark" the test passing by copying it and enabling the name hashing
flag in it. This is done similarly as in 940f7ff46d.
2014-01-07 00:20:17 +01:00
Grzegorz Kossakowski cd6b2a2a8c Mark tests that regress when name hashing is enabled.
There are number of scripted tests that fail if we switch to name hashing
being enabled by default. There's no easy way to mark those tests as
pending only when name hashing flag is enabled so I decided to "mark" them
by copying those tests, enabling name hashing in each of them and mark
those copies as pending.

Here's explanation of each failing test:

  * `constants` and `java-static` fail due to typer inlining constants
    so we can't track dependencies properly (see SI-7173)
  * `macro` fails for similar reasons as above: typer expands macros
    and we can't track dependencies properly
  * `struct` fails because it turns out that we need to handle structural
    types in a special way both at declaration and use sites. At the moment
    we handle them explicitly at declaration site so `struct-usage` passes
    but `struct` fails
2014-01-07 00:20:17 +01:00
Grzegorz Kossakowski a48ab0d38b Implement name hashing algorithm in incremental compiler.
Provide implementation of invalidation logic that takes computed
name hashes into account. The implementation is spread amongst two
classes:

  1. `IncrementalNameHashing` which implements a variant of
     incremental compilation algorithm that computes modified
     names and delegates to `MemberReferenceInvalidationStrategy`
     when invalidating member reference dependencies
  2. `MemberReferenceInvalidationStrategy` which implements the
     core logic of dealing with dependencies introduced by member
     reference. See documentation of that class for details.

The name hashing optimization is applied when invalidating source files
having both internal and external dependencies (in initial iteration),
check `invalidateByExternal` and `invalidateSource` methods for details.

As seen in implementation of `MemberReferenceInvalidationStrategy`
the name hashing optimization is not applied when implicit members
change.

NOTE: All functionality introduced in this commit is enabled only
when `IncOptions.nameHashing` flag is set to true.

The `source-dependencies/transitive-memberRef` test has been changed
to test name hashing variant of incremental compilation. The change
to invalidated files reflects the difference between the old and the
new algorithm.

Also, there a few new tests added that cover issues previously found
while testing name hashing algorithm and are fixed in this commit.
Each paragraph describes a single test.

Add a test case which shows that detect properly changes to type aliases
in the name hashing algorithm. See gkossakowski/sbt#6 for details.

Add test covering bug with use of symbolic names (issue
gkossakowski/sbt#5).

Add a test which covers the case where we refer to a name that is
declared in the same file. See issue gkossakowski/sbt#3 for details.
2014-01-07 00:20:17 +01:00
Josh Suereth 4207978f89 Merge pull request #1066 from jsuereth/wip/launcher-improvements
Launcher can now load servers in addition to regular applications.
2014-01-06 13:57:28 -08:00
Josh Suereth 418b854907 Launcher can now load servers in addition to regular applications.
* Add new ServerMain interface
* AppProvider can now choose to load ServerMain or AppMain classes
* Explicitly document what happens if something doesn't match an
  expected interface
* Improve error message on inability to load something.
* Parse new [server] section that denotes a service and is lock file
* Ability to serialize launch configurations.
* Attempt to look for active listening server via the lock file
* Forks the launcher itself to run servers from serialized launch configuration.
* Testing echo server.
* Tests to detect basic server functionality will work.
* Revamp all the documentation for the launcher, giving it its own section.
* Full documentation on launcher configuration files.

Revamp launcher documentation to be a bit more in-depth, and split bits into sections.
2014-01-06 16:54:45 -05:00
kenji yoshida 170c5f7a48 Merge pull request #1062 from xuwei-k/CommandStrings-settingsDetailed
fix CommandStrings.settingsDetailed
2014-01-06 09:20:06 -08:00
xuwei-k b6e16f1e95 fix CommandStrings.settingsDetailed 2014-01-05 23:40:02 +09:00
Josh Suereth e338266257 Merge pull request #1058 from jaceklaskowski/doc-small-changes
Small changes
2014-01-02 09:21:36 -08:00
Dan Sanduleac eb8077427e Fix saving session settings 2014-01-02 09:18:54 -05:00
Jacek Laskowski a5b8dffc74 Unify warning to other schemes and use string interpolation 2014-01-02 09:18:54 -05:00
Jacek Laskowski 2caadceaf6 Small changes 2014-01-01 23:29:35 +01:00
Josh Suereth 553ea80149 Merge pull request #1056 from dimbleby/typo
Fix a typo
2014-01-01 07:21:48 -08:00
David Hotham 09fa2f9efe Fix a typo 2014-01-01 13:50:33 +00:00
Mark Harrah 906f86e39f API documentation for TaskStreams. 2013-12-19 18:32:01 -05:00
Christian Dedie 38f44ec8ab add flyway-sbt plugin to community plugins 2013-12-18 11:54:24 -05:00
Mark Harrah ca4b22e272 Generate an error when making a path string from paths containing the separator. Fixes #1038.
This is an attempt to provide a decent error message in some cases.  However, paths that include
the Java path separator character are just fundamentally problematic and aren't always going to
be cleanly detected.
2013-12-18 11:53:46 -05:00
Grzegorz Kossakowski c2dc6cd529 Test for inheritance and member references.
Add a test-case that documents current behavior of incremental
compiler when it comes to invalidating dependencies that arise
from inheritance and member references.
2013-12-15 18:40:46 +01:00
Grzegorz Kossakowski d70bc51b6d Use `nameHashing` option throughout incremental compiler
There are two categories of places in the code that need to refer to
`nameHashing` option:

  * places where Analysis object is created so it gets proper
    implementation of underlying Relations object
  * places with logic that is specifically designed to be enabled by
    that option

This commit covers both cases.
2013-12-15 18:40:46 +01:00
Grzegorz Kossakowski cacb17fb2e Add `nameHashing` option to IncOptions
This option is not used anywhere yet. This commit just contains all
the boilerplate needed in order to introduce a new field to IncOptions
class.
2013-12-15 18:40:46 +01:00
Grzegorz Kossakowski 88528a43cb Fix a few mistakes related to IncOptions.recompileOnMacroDef
The 39036e7c20 introduced
`recompileOnMacroDef` option to IncOptions. However, not all necessary
logic has been changed. This commit fixes that:

  * `copy` method does not forget the value of the `recompileOnMacroDef`
    flag
  * `productArity` has been increased to match the arity of the class
  * `productElement` returns the value of `recompileOnMacroDef` flag
  * `hashCode` and `equals` methods take into account value of
    `recompileOnMacroDef` flag
  * fix the name of the key for `recompileOnMacroDef` flag
2013-12-15 18:40:46 +01:00
Grzegorz Kossakowski 4ebbf3fb8b Refactor code in IncrementalCommon and IncrementalDefaultImpl
Move implementation of the following methods from IncrementalCommon
to IncrementalDefaultImpl:

  * invalidatedPackageObjects
  * sameAPI
  * invalidateByExternal
  * allDeps
  * invalidateSource

These are the methods that are expected to have different implementation
in the name hashing algorithm. Hence, we make them abstract in
IncrementalCommon so they can be implemented differently in subclasses.
2013-12-15 18:40:46 +01:00
Grzegorz Kossakowski fdc72f3744 The invalidateByExternal takes single external api change.
Refactor the `invalidateByExternal` method to take single, external
api change. Introduce `invalidateByAllExternal` that takes all APIChanges
object.

This way `invalidateByExternal` will have an access to APIChange object
that represents changed name hashes once name hashing is merged.
2013-12-15 18:40:46 +01:00
Grzegorz Kossakowski 3643419e7c Make `invalidateSource` to take Relations.
This way we'll be able to have a polymorphic implementation of this
method in the future. One implementation will use the old dependency
tracking mechanism and the other will use the new one (implemented
for name hashing).
2013-12-15 18:40:46 +01:00
Grzegorz Kossakowski 83a131e4f5 Introduce `IncrementalCommon.invalidateSource` method.
In addition to `invalidateSources` we introduce `invalidateSource`
that invalidates dependencies of a single source. This is needed
for the name hashing algorithm because its invalidation logic
depends on information about API changes of each source file
individually.

The refactoring is done in `IncrementalCommon` class so it affects
the default implementation as well. However, this refactoring does
not affect the result of invalidation in the default implementation.
2013-12-15 18:32:49 +01:00
Grzegorz Kossakowski 946fd53a73 Introduce abstract `IncrementalCommon` class.
Introduce an abstract `IncrementalCommon class that holds the
implementation of incremental compiler that was previously done in
`Incremental` class. Also, introduce `IncrementalDefaultImpl` that
inherits from IncrementalCommon.

This is the first step to introduce a design where most of incremental
compiler's logic lives in IncrementalCommon and we have two subclasses:

  1. Default, which holds implementation specific to the old algorithm
     known from sbt 0.13.0
  2. NameHashing, which holds implementation specific to the name
     hashing algorithm

This commit is purely a refactoring and does not change any behavior.
2013-12-15 18:32:09 +01:00
Grzegorz Kossakowski 1de2900a67 Add Logger and IncOptions as Incremental class constructor args
Both Logger and IncOptions instances were passed around Incremental class
implementation unmodified. Given the fact that entire implementation of
the class uses exactly the same values for those types it makes sense
to extract them as constructor arguments so they are accessible everywhere.

This helps reducing signatures of other methods to more essential
parameters that are more specific to given method.
2013-12-15 18:32:09 +01:00
Grzegorz Kossakowski ae15eccd9c Introduce a companion `Incremental` class.
Move most of the functionality from `Incremental` object to its
companion class.

This commit is a preparation for making it possible to have
two different implementation of logic in `Incremental` object.
2013-12-15 18:30:59 +01:00
William Benton 5df24e5eb2 Update documentation references to Ivy 2.3.0 2013-12-13 14:25:56 -06:00
William Benton 3a1ad44c45 Support Ivy 2.3.0-final.
This entailed modifying ResolutionCache and the CustomPomParser
to reflect changes to the ResolutionCacheManager interface and
DefaultExtendsDescriptor class between Ivy 2.3.0-rc1 and
2.3.0-rc2. Specifically,

1. ResolutionCacheManager now includes two additional methods
that needed implementations in ResolutionCache:
getResolvedModuleDescriptor(mrid: ModuleRevisionId) and
saveResolvedModuleDescriptor(md: ModuleDescriptor). I adapted
the implementations for these (which are expressed primarily in
terms of other interface methods) from Ivy 2.3.0's
DefaultResolutionCacheManager.

2. Instead of taking a ModuleRevisionIdentifier and a resolved
ModuleRevisionIdentifier as its first two arguments, the
DefaultExtendsDescriptor constructor now takes a
ModuleDescriptor. This was a trivial change.

Note that ResolutionCache.getResolvedModuleDescriptor does not
appear to be used by Ivy as sbt uses Ivy and there is thus no
test coverage for its implementation. Also note that the
DefaultResolutionCacheManager object created in
Update.configureResolutionCache now requires a reference to an
IvySettings object; DRCM expects this to be non-null.
2013-12-13 14:24:37 -06:00
Mark Harrah b09cf5b5e7 Fixes #1035 by catching the format error and returning the erased type as a backup.
Review by @gkossakowski.
2013-12-13 14:04:31 -05:00
Mark Harrah 05695824a5 test case for #1035 2013-12-13 14:04:18 -05:00
Mark Harrah 06deda06af Reorganized/commented proguard build configuration.
Review by @jsuereth.
2013-12-13 10:33:07 -05:00
Josh Suereth 8f22d7d580 Merge pull request #1037 from jsuereth/wip/launcher-improvements
Minor launcher improvements
2013-12-12 07:30:30 -08:00
Josh Suereth ff71bca75c Drop some of the stack size of the launcher.
* Remove needless chained methods
* Attempt to create re-usable parsing methods.
2013-12-12 10:16:48 -05:00
Josh Suereth cfe14444b8 Document ComponentProvider interface. 2013-12-12 09:51:58 -05:00
Mark Harrah 0c62483e74 launchconfigs for version bump 2013-12-10 11:59:51 -05:00
Mark Harrah 82dcf8d250 delete dependency-management/inherit-repo test
repository used in the test doesn't exist anymore and project delegation is deprecated
2013-12-10 11:59:29 -05:00
Mark Harrah 48fb98f2d1 0.13.1 2013-12-10 10:18:42 -05:00
Mark Harrah 90143986e4 Test for #1031 2013-12-10 08:40:37 -05:00
Mark Harrah c669606999 TaskKey[T].previous: Option[T], which returns the value of the task the last time it executed.
This requires a Format[T] to be implicitly available at the call site and requires the task
to be referenced statically (not in a settingDyn call).  References to previous task values
in the form of a ScopedKey[Task[T]] + Format[T] are collected at setting load time in the
'references' setting.  These are used to know which tasks should be persisted (the ScopedKey)
and how to persist them (the Format).

When checking/delegating previous references, rules are slightly different.

A normal reference from a task t in scope s cannot refer to t in s unless
there is an earlier definition of t in s.  However, a previous reference
does not have this restriction.  This commit modifies validateReferenced
to allow this.

TODO: user documentation
TODO: stable selection of the Format when there are multiple .previous calls on the same task
TODO: make it usable in InputTasks, specifically Parsers
2013-12-06 20:45:01 -05:00
Mark Harrah 5d49fcbe78 Include the key name in the streams backing file path to avoid collisions. 2013-12-06 20:43:48 -05:00
Mark Harrah a677448a6c Fix closeable streams to recreate streams for a key if the delegate was closed. 2013-12-06 20:43:48 -05:00
Mark Harrah 21a05978de Fix parsing and evaluation of 'all' and 'show'. See comment in evaluatingParser. 2013-12-06 20:43:48 -05:00
Mark Harrah 140ce04809 Fix #1024. Use log.debug instead of println in TrapExit. 2013-12-05 12:00:00 -05:00
Mark Harrah d8c15bb80e Merge remote-tracking branch 'gkossakowski/compute-name-hashes' into 0.13 2013-12-05 08:53:50 -05:00