Skip to content

False invalidation by inheritance on JDK 11 #998

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

Closed
lrytz opened this issue Aug 10, 2021 · 0 comments · Fixed by #999
Closed

False invalidation by inheritance on JDK 11 #998

lrytz opened this issue Aug 10, 2021 · 0 comments · Fixed by #999
Assignees
Labels
area/over_compilation Zinc picks up more compilation than needed

Comments

@lrytz
Copy link
Contributor

lrytz commented Aug 10, 2021

steps

  • clone https://github.com/lrytz/sbtproj
  • use JDK 11 (OpenJDK 64-Bit Server VM Temurin-11.0.12+7)
  • sbt
    • clean
    • compile
    • debug
    • un-commment the println in A.scala
    • compile

A is recompiled, then the log shows

[debug] Invalidated by transitive inheritance dependency: Set(B)

and B is recompiled in a second round.

Doesn't happen on JDK 8.

@lrytz lrytz self-assigned this Aug 10, 2021
lrytz added a commit to lrytz/scala that referenced this issue Aug 11, 2021
Java annotations are identified by flag since 2.13.0
(scala#6869).

If the annotation's `typeSymbol` still has a lazy `ClassfileLoader`
info, the flags are not there yet.

This leads to spurious API changes and recompilations in zinc
(sbt/zinc#998).
@eed3si9n eed3si9n added the area/over_compilation Zinc picks up more compilation than needed label Sep 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/over_compilation Zinc picks up more compilation than needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants