Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge 1.0.x into 1.x #455

Merged
merged 46 commits into from
Nov 23, 2017
Merged

Merge 1.0.x into 1.x #455

merged 46 commits into from
Nov 23, 2017

Commits on Sep 5, 2017

  1. Fix ConsoleInterface binding things properly^2

    Follow-up on sbt#314 - I _still_ misinterpreted..
    
    Turns out the ".asInstanceOf[AnyRef].getClass.getName" implementation
    was the _original_ implementation. Then Mark switched to using bindValue
    in sbt/sbt@4b8f0f3.
    
    Since Scala 2.11.0 (scala/scala#1648 in particular) bindValue was
    removed. So we'll use NamedParam and quietBind, both which exist since
    Scala 2.9.0.
    
    Fixes sbt/sbt#2884, tested with local releases.
    dwijnand committed Sep 5, 2017
    Configuration menu
    Copy the full SHA
    33d2e68 View commit details
    Browse the repository at this point in the history

Commits on Sep 8, 2017

  1. Merge pull request sbt#386 from dwijnand/consoleProject

    Fix ConsoleInterface binding things properly^2
    eed3si9n authored Sep 8, 2017
    Configuration menu
    Copy the full SHA
    25ad019 View commit details
    Browse the repository at this point in the history

Commits on Sep 25, 2017

  1. use neo-sbt-scalafmt

    eed3si9n committed Sep 25, 2017
    Configuration menu
    Copy the full SHA
    372d32f View commit details
    Browse the repository at this point in the history
  2. sbt.version=1.0.2

    eed3si9n committed Sep 25, 2017
    Configuration menu
    Copy the full SHA
    50b00c7 View commit details
    Browse the repository at this point in the history
  3. make LoggedReporter fields lazy

    I get NPE when I extend ManagedLoggedReporter if I don't do this.
    eed3si9n committed Sep 25, 2017
    Configuration menu
    Copy the full SHA
    264ffc5 View commit details
    Browse the repository at this point in the history
  4. Merge pull request sbt#413 from eed3si9n/wip/LoggedReporter

    neo-sbt-scalafmt and making LoggedReporter extensible
    jvican authored Sep 25, 2017
    Configuration menu
    Copy the full SHA
    30c9bb4 View commit details
    Browse the repository at this point in the history

Commits on Oct 9, 2017

  1. Move REPL related xsbti Java to correct module

    xsbti Java classes were ported into compiler bridge, instead of the compiler interface by mistake.
    Since there's not code utilizing this interface yet, this was never caught.
    eed3si9n committed Oct 9, 2017
    Configuration menu
    Copy the full SHA
    e2896e1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    505ac2e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f2e2bf2 View commit details
    Browse the repository at this point in the history

Commits on Oct 10, 2017

  1. Merge pull request sbt#425 from eed3si9n/wip/repl

    Move REPL related xsbti Java classes to the correct module
    jvican authored Oct 10, 2017
    Configuration menu
    Copy the full SHA
    291cefa View commit details
    Browse the repository at this point in the history

Commits on Oct 12, 2017

  1. Fix source-dependencies/sealed

    sealed test used to be implemented with `-> compile` in sbt/sbt but was marked pending in 8e65c00.
    This changes back to the original state.
    eed3si9n committed Oct 12, 2017
    Configuration menu
    Copy the full SHA
    456e071 View commit details
    Browse the repository at this point in the history
  2. Add trait-trait-212 for Scala 2.12.3

    This commit proves that the error only exists with 2.11.x.
    jvican authored and eed3si9n committed Oct 12, 2017
    Configuration menu
    Copy the full SHA
    6a829c2 View commit details
    Browse the repository at this point in the history
  3. Add real reproduction case for sbt#417

    jvican authored and eed3si9n committed Oct 12, 2017
    Configuration menu
    Copy the full SHA
    91c0a69 View commit details
    Browse the repository at this point in the history
  4. Fixes undercompilation on inheritance on same source

    ### background
    
    In sbt 0.13 days, we could ignore the relationship between two classes defined
    in the same `*.scala` source file, because they will be compiled anyway, and
    the invalidation was done at the source file level. With class-based namehashing,
    the invalidation is done at the class level, so we can no longer ignore inheritance
    relationship coming from the same source, but we still have old assumptions scattered
    around the xsbt-dependency implementation.
    
    ### what we see without the fix
    
    ```
    [info] Compiling 1 Scala source to ...
    ....
    [debug] [inv]   internalDependencies:
    [debug] [inv]     DependencyByInheritance Relation [
    [debug] [inv]     xx.B -> gg.table.A
    [debug] [inv]     xx.Foo -> xx.C
    [debug] [inv] ]
    [debug] [inv]     DependencyByMemberRef Relation [
    [debug] [inv]     xx.B -> gg.table.A
    [debug] [inv]     xx.Hello -> gg.table.A
    [debug] [inv]     xx.Foo -> xx.C
    [debug] [inv] ]
    ....
    Caused by: java.lang.AbstractMethodError: xx.Foo.buildNonemptyObjects(II)V
    ```
    
    First, we see that `xx.C -> xx.B DependencyByInheritance` relationship is missing. Second, the error message seen is `java.lang.AbstractMethodError` happening on `xx.Foo`.
    
    ### what this changes
    
    This change changes two if expressions that was used to filter out dependency info coming from the same source.
    
    One might wonder why it's necessary to keep the local inheritance info, if two classes involved are compiled together anyways. The answer is transitive dependencies.
    Here's likely what was happening:
    
    1. `gg.table.A` was changed,
    2. causing `xx.B` to invalidate.
    3. However, because of the missing same-source inheritance, it did not invalidate `xx.C`.
    4. This meant that neither `xx.Foo` was invalidated.
    5. Calling transform method on a new `xx.Foo` causes runtime error.
    
    By tracking same-source inheritance, we will now correctly invalidate `xx.C` and `xx.Foo`.
    I think the assumption that's broken here is that "we don't need to track inheritance that is happening between two classes in a same source."
    
    ### Is this 2.11 only issue?
    
    No. The simple trait-trait inheritance reproduction alone will not cause problem in Scala 2.12
    because of the [compile-to-interface](http://www.scala-lang.org/news/2.12.0/#traits-compile-to-interfaces) traits.
    However, not all traits will compile to interface.
    This means that if we want to take advantage of the compile-to-interface traits,
    we still should keep track of the same-source inheritance, but introduce some more
    logic to determine whether recompilation is necessary.
    
    Fixes sbt#417
    eed3si9n committed Oct 12, 2017
    Configuration menu
    Copy the full SHA
    05482d1 View commit details
    Browse the repository at this point in the history
  5. source-dependencies / patMat-scope workaround

    `source-dependencies / patMat-scope` passes locally for me.
    The invalidation on the CI is likely caused by:
    
    ```
    [debug] Recompiling all 3 sources: invalidated sources (2) exceeded 50.0% of all sources
    ```
    
    This attempts to workaround that by adding more source. This does not affect the fidelity of the original test.
    eed3si9n committed Oct 12, 2017
    Configuration menu
    Copy the full SHA
    9403160 View commit details
    Browse the repository at this point in the history
  6. Merge pull request sbt#424 from eed3si9n/wip/417

    Fixes undercompilation on inheritance on same source
    dwijnand authored Oct 12, 2017
    Configuration menu
    Copy the full SHA
    1a7dc5d View commit details
    Browse the repository at this point in the history

Commits on Oct 13, 2017

  1. Configuration menu
    Copy the full SHA
    03e4119 View commit details
    Browse the repository at this point in the history
  2. Fix sbt#127: Use unexpanded name instead of name

    It looks like scalac encodes access rights of objects in their names. To
    make sure that we get the right simple names, we need to use
    `unexpandedName` instead of `name` which will decipher these access
    rights and return their simple names insted (with all the previous `$$`
    prefixes stripped out).
    jvican committed Oct 13, 2017
    Configuration menu
    Copy the full SHA
    6dc7586 View commit details
    Browse the repository at this point in the history

Commits on Oct 16, 2017

  1. Configuration menu
    Copy the full SHA
    797855f View commit details
    Browse the repository at this point in the history
  2. Merge pull request sbt#431 from scalacenter/issue-127

    Fix sbt#127: Use unexpanded names
    jvican authored Oct 16, 2017
    Configuration menu
    Copy the full SHA
    aa1a628 View commit details
    Browse the repository at this point in the history

Commits on Oct 22, 2017

  1. Configuration menu
    Copy the full SHA
    045f194 View commit details
    Browse the repository at this point in the history
  2. Improve and make scripted parallel

    These are the improvements that I've added to scripted:
    
    1. Scripted is now parallel and does batch execution.
    2. Scripted logs to both a file and the console (if `bufferLog == true`).
       All the logs can be inspected locally by going to a directory in
       `/tmp`. This directory is shown to the user at the end of the
       execution.
    3. Scripted UI has been improved.
       3.1. Colors are used for `+` and `x`.
       3.1. It shows the command that actually failed, not `Command failed {line 1}`.
       3.2. It trims the stack traces of the wrapping exceptions
            (corresponding to the scripted infrastructure). Only the stack traces
            of the causing exceptions are shown (which are the ones we're
            interested in and are usually assertion errors).
    
    I think these improvements enhance the current dev workflow
    considerably. I invite you to give them a try.
    
    This change combined with sbt#429, gives a really fast execution of
    scripted. Testing just one test is under 7 seconds in my machine (note
    that in those 7 seconds we have to fetch the bridge, etc).
    jvican committed Oct 22, 2017
    Configuration menu
    Copy the full SHA
    6c2c325 View commit details
    Browse the repository at this point in the history

Commits on Oct 25, 2017

  1. Merge pull request sbt#441 from scalacenter/issue-436

    Fix sbt#436: Remove annoying log4j scripted exception
    dwijnand authored Oct 25, 2017
    Configuration menu
    Copy the full SHA
    ee74feb View commit details
    Browse the repository at this point in the history

Commits on Oct 26, 2017

  1. Ignore null in generic lambda tparams

    `Method.getGenericParameterType` may sometimes return `null` for the
    return types when the method's return type is indeed generic. It's not
    clear yet where this "sometimes" happens, but it looks like the JDK is
    not able to tell the return type of a lambda returning the generic
    class.
    
    This can be seen in the `java-lambda-typeparams` scripted test. In this
    context, lambda metafactory synthesizes a lambda class that returns a
    class that is parameterized in its return type. In that context, when
    `ClassToAPI` inspects the synthesized lambda and tries to figure out the
    full return type of it, the `null` is returned.
    
    It looks like the Java reflection API sparingly returns `null`s. We can
    see that in `ClassToAPI` where we guard against `null`s in lots of other
    places. So the guard added by this commit is not a novelty, but rather
    the norm.
    
    Fixes sbt#389.
    jvican authored and eed3si9n committed Oct 26, 2017
    Configuration menu
    Copy the full SHA
    573c4bd View commit details
    Browse the repository at this point in the history
  2. Merge pull request sbt#446 from eed3si9n/wip/389

    Ignore null in generic lambda tparams
    eed3si9n authored Oct 26, 2017
    Configuration menu
    Copy the full SHA
    73d0585 View commit details
    Browse the repository at this point in the history

Commits on Nov 8, 2017

  1. source-dependencies/value-class-underlying: fix test

    We were not testing what we thought we were testing before, because C
    used the name "x" which is also the name of the parameter we change in
    A, so when we changed A we were invalidating C too. Fixed by using a
    different name than "x" in C, which reveals that there is a bug
    somewhere since the test doesn't pass anymore.
    smarter committed Nov 8, 2017
    Configuration menu
    Copy the full SHA
    5a986a4 View commit details
    Browse the repository at this point in the history
  2. Fix sbt#442: Name hash of value class should include underlying type

    Quoting from 1e7e99e:
        If the underlying type of a value class change, its name hash
        doesn't change, but the name hash of <init> change and since every
        class uses the name <init>, we don't need to do anything special to
        trigger recompilations either
    
    This was true until aca8dfa where we
    started giving unique names to constructors. This broke the
    value-class-underlying type but this wasn't noticed because the test was
    broken in the same commit (and has now been fixed in the previous commit in
    this PR).
    smarter committed Nov 8, 2017
    Configuration menu
    Copy the full SHA
    0215c84 View commit details
    Browse the repository at this point in the history
  3. Merge pull request sbt#444 from smarter/fix-value-classes

    Fix sbt#442: Name hash of value class should include underlying type
    dwijnand authored Nov 8, 2017
    Configuration menu
    Copy the full SHA
    8050289 View commit details
    Browse the repository at this point in the history

Commits on Nov 10, 2017

  1. Make classpath hashing more lightweight

    And make it parallel!
    
    This patch adds a cache that relies on filesystem metadata to cache
    hashes for jars that have the same last modified time across different
    compiler iterations. This is important because until now there was a
    significant overhead when running `compile` on multi-module builds that
    have gigantic classpaths. In this scenario, the previous algorithm
    computed hashes for all jars transitively across all these projects.
    
    This patch is conservative; there are several things that are wrong with
    the status quo of classpath hashing. The most important one is the fact
    that Zinc has been doing `hashCode` on a SHA-1 checksum, which doesn't
    make sense. The second one is that we don't need a SHA-1 checksum for
    the kind of checks we want to do. sbt#371
    explains why. The third limitation with this check is that file hashes
    are implemented internally as `int`s, which is not enough to represent
    the richness of the checksum. My previous PR also tackles this problem,
    which will be solved in the long term.
    
    Therefore, this pull request only tackles these two things:
    
    * Caching of classpath entry hashes.
    * Parallelize this IO-bound task.
    
    Results, on my local machine:
    
    - No parallel hashing of the first 500 jars in my ivy cache: 1330ms.
    - Parallel hashing of the first 500 jars in my ivy cache: 770ms.
    - Second parallel hashing of the first 500 jars in my ivy cache: 1ms.
    
    Fixes sbt#433.
    jvican committed Nov 10, 2017
    Configuration menu
    Copy the full SHA
    a90a0e9 View commit details
    Browse the repository at this point in the history

Commits on Nov 14, 2017

  1. Merge pull request sbt#452 from scalacenter/issue-433

    Fix sbt#433: Make classpath hashing more lightweight
    Duhemm authored Nov 14, 2017
    Configuration menu
    Copy the full SHA
    5dcf3e6 View commit details
    Browse the repository at this point in the history
  2. Update sbt-scalafmt to 1.12

    jvican committed Nov 14, 2017
    Configuration menu
    Copy the full SHA
    e334903 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    90da1fb View commit details
    Browse the repository at this point in the history
  4. Add headers to missing files

    This also proves that our sbt-header configuration works.
    jvican committed Nov 14, 2017
    Configuration menu
    Copy the full SHA
    0816162 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    d361251 View commit details
    Browse the repository at this point in the history

Commits on Nov 16, 2017

  1. Merge pull request sbt#438 from scalacenter/add-headers-restructure-dir

    Add headers and move compiler interface
    eed3si9n authored Nov 16, 2017
    Configuration menu
    Copy the full SHA
    f3d2b73 View commit details
    Browse the repository at this point in the history
  2. "sbt '++ 2.13.0-M2!' compile" does not work with sbt 1.0.0

    * add new compiler bridge
    jan0sch authored and eed3si9n committed Nov 16, 2017
    Configuration menu
    Copy the full SHA
    af6e535 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    2c9dbb7 View commit details
    Browse the repository at this point in the history
  4. Merge pull request sbt#440 from scalacenter/independent-scripted-para…

    …llel
    
    Improve and make scripted parallel
    jvican authored Nov 16, 2017
    Configuration menu
    Copy the full SHA
    67cb2eb View commit details
    Browse the repository at this point in the history
  5. Add yourkit acknoledgement in the README

    Fixes sbt#447.
    jvican committed Nov 16, 2017
    Configuration menu
    Copy the full SHA
    6fddbb7 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    62339c9 View commit details
    Browse the repository at this point in the history
  7. Merge pull request sbt#454 from scalacenter/yourkit

    Add yourkit acknoledgement in the README
    jvican authored Nov 16, 2017
    Configuration menu
    Copy the full SHA
    f7e45b4 View commit details
    Browse the repository at this point in the history

Commits on Nov 21, 2017

  1. Implement compiler bridge for 2.13.0-M2

    Fixes sbt#395, sbt/sbt#3427
    
    In scala/scala#5903 Scala compiler's REPL-related classes went through some changes, including move to a different package.
    This implements a new compiler bridge tracking the changes.
    
    To verify that the new bridge compiles under 2.13, we need to compile it using sbt 1.0.3, which in turn requires a bridge compatible with Scala 2.13.0-M2.
    To work around this chicken-egg, I've manually created a bridge and published it to Maven Central as "org.scala-sbt" % "compiler-bridge_2.13.0-M2" % "1.1.0-M1-bootstrap2".
    eed3si9n committed Nov 21, 2017
    Configuration menu
    Copy the full SHA
    c60ff23 View commit details
    Browse the repository at this point in the history
  2. Split compiler bridge tests to another subproject

    Splitting compiler bridge tests to another subproject because while the bridge itself can be compiled with just compiler-interface, util-interface, and Scala Compiler as dependencies, the testing introduces more (such as IO). This creates problem for new Scala versions where IO or test libraries do not exist yet (e.g. Scala 2.13.0-M2).
    
    This also removes the Mima test due to the lack of 2.13 bridge for Zinc 1.0.0.
    Compiler bridge just needs to compile itself against the interface and Scala compiler, so there's no need to run Mima test.
    eed3si9n committed Nov 21, 2017
    Configuration menu
    Copy the full SHA
    91cb532 View commit details
    Browse the repository at this point in the history

Commits on Nov 23, 2017

  1. Configuration menu
    Copy the full SHA
    9d6dfd7 View commit details
    Browse the repository at this point in the history
  2. Merge pull request sbt#453 from eed3si9n/wip/213-compiler-bridge

    "sbt '++ 2.13.0-M2!' compile" does not work with sbt 1.0.0
    dwijnand authored Nov 23, 2017
    Configuration menu
    Copy the full SHA
    d6d6988 View commit details
    Browse the repository at this point in the history
  3. Merge branch '1.0.x' into merge-1.0.x-into-1.x

    * 1.0.x: (28 commits)
      Split compiler bridge tests to another subproject
      Implement compiler bridge for 2.13.0-M2
      Add yourkit acknoledgement in the README
      "sbt '++ 2.13.0-M2!' compile" does not work with sbt 1.0.0
      Add header to cached hashing spec
      Add headers to missing files
      Fix sbt#332: Add sbt-header back to the build
      Update sbt-scalafmt to 1.12
      Make classpath hashing more lightweight
      Fix sbt#442: Name hash of value class should include underlying type
      source-dependencies/value-class-underlying: fix test
      Ignore null in generic lambda tparams
      Improve and make scripted parallel
      Fix sbt#436: Remove annoying log4j scripted exception
      Fix sbt#127: Use `unexpanded` name instead of `name`
      Add pending test case for issue/127
      source-dependencies / patMat-scope workaround
      Fixes undercompilation on inheritance on same source
      Add real reproduction case for sbt#417
      Add trait-trait-212 for Scala 2.12.3
      ...
    
     Conflicts:
    	internal/zinc-apiinfo/src/main/scala/sbt/internal/inc/ClassToAPI.scala
    	project/build.properties
    	zinc/src/main/scala/sbt/internal/inc/MixedAnalyzingCompiler.scala
    
    The ClassToAPI conflict is due to:
    * sbt#393 (a 1.x PR), conflicting with
    * sbt#446 (a 1.0.x PR).
    
    The build.properties conflict is due to different PRs bumping
    sbt.version from 1.0.0 to 1.0.2 to 1.0.3. (sbt#413, sbt#418, sbt#453).
    
    The MixedAnalyzingCompiler conflict is due to:
    * sbt#427 (a 1.x PR), conflicting with
    * sbt#452 (a 1.0.x PR).
    dwijnand committed Nov 23, 2017
    Configuration menu
    Copy the full SHA
    e245d95 View commit details
    Browse the repository at this point in the history