Skip to content

Overcompilation on 1.10.x due to potentially incorrect initial invalidation #1420

@OndrejSpanel

Description

@OndrejSpanel

Follow-up to #1396

steps

  • checkout https://github.com/OndrejSpanel/ZincApiHash
  • if using IntelliJ IDE, make sure you have highlighting set to Built-in, not Compiler
  • from sbt use clean;compile
  • change the local variable name in Entities.f or change the comment in the same file
  • use compile

problem

There are two compilation cycles:

[info] compiling 2 Scala sources to C:\Dev\ZincOvercompile\target\scala-3.5.1\classes ...
[info] done compiling
[info] compiling 1 Scala source to C:\Dev\ZincOvercompile\target\scala-3.5.1\classes ...
[info] done compiling

expectation

No more compilation cycles should be needed on a change which does not change the API.

notes

  • I have developed a SBT plugin to help me isolating problems like this. It checks sbt.internal.inc.Analysis and prints which files were compiled and what classed have changed their API as a result of compilation. When used on this repro, it shows apiHash change on EntityState class
  • when you repeat modify / compile again, there is only one compilation cycle. The additional cycle happens only on the first compile after clean;compile.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions