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

Track added products for cache invalidation #569

Closed
wants to merge 2 commits into from
Closed

Track added products for cache invalidation #569

wants to merge 2 commits into from

Commits on Aug 10, 2018

  1. Configuration menu
    Copy the full SHA
    5e4f6d3 View commit details
    Browse the repository at this point in the history
  2. Track added products for cache invalidation

    I discovered that in sbt, the scripted tests/internal-tracking test
    would fail if run with -Dsbt.resident.limit=$NUM where $NUM > 0. This
    was because the test introduced a dependent project b, that depended on
    a, but was set to not track a. If the b project was compiled before the
    a project, the compilation would fail, but a cache entry would be added
    to the compiler cache with a key that included a's target directory in
    its classpath. If a was then independently compiled, the expectation
    would be that b would also compile, but this actually failed. The reason
    was that when zinc looked for the cached compiler, it found a hit and
    did not create a new compiler instance. This was a problem because the
    previous instance was unaware of the newly generated classes from the a
    project. To get b to compile, it is necessary to invalidate the compiler
    cache entry.
    
    To invalidate the entry, we must detect that there are changes to the
    project's dependencies. Previously, zinc did not even look at new
    classes in a dependencies target directory. It did look at
    removedProducts, but did not actually consider the removed products when
    constructing the DependencyChanges instance in Incremental.scala. To
    resolve this, I just append the removed and new products to the binary
    dependency changes. After this change,
    `scripted project/internal-tracking` passes even when a global compiler
    cache is used. The test I added to MultiProjectIncrementalSpec also
    fails without this change and passes with it.
    eatkins committed Aug 10, 2018
    Configuration menu
    Copy the full SHA
    b9fd5fd View commit details
    Browse the repository at this point in the history