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

Fix multiple annotation processing issues discovered by Micronaut #19067

Merged
merged 3 commits into from Nov 25, 2021

Conversation

oehme
Copy link
Contributor

@oehme oehme commented Nov 19, 2021

  • Don't reprocess types when there is nothing to compile
  • Merge annotation processing data across subsequent compilations

Fixes micronaut-projects/micronaut-core#6536

Contributor Checklist

  • Review Contribution Guidelines
  • Make sure that all commits are signed off to indicate that you agree to the terms of Developer Certificate of Origin.
  • Make sure all contributed code can be distributed under the terms of the Apache License 2.0, e.g. the code was written by yourself or the original code is licensed under a license compatible to Apache License 2.0.
  • Check "Allow edit from maintainers" option in pull request so that additional changes can be pushed by Gradle team
  • Provide integration tests (under <subproject>/src/integTest) to verify changes from a user perspective
  • Provide unit tests (under <subproject>/src/test) to verify logic
  • Update User Guide, DSL Reference, and Javadoc for public-facing changes
  • Ensure that tests pass sanity check: ./gradlew sanityCheck
  • Ensure that tests pass locally: ./gradlew <changed-subproject>:quickTest

Gradle Core Team Checklist

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation
  • Recognize contributor in release notes

@oehme
Copy link
Contributor Author

oehme commented Nov 19, 2021

Since this was a regression in 7.3, consider making this a 7.3.1 candidate.

@oehme oehme changed the title Don't reprocess aggregated types when there's nothing to compile Fix multiple annotation processing issues discovered by Micronaut Nov 22, 2021
@oehme
Copy link
Contributor Author

oehme commented Nov 22, 2021

@ljacomet FYI

@ljacomet
Copy link
Member

Thanks for the fix Stefan!

We have plans for a 7.3.1, adding this.

@ljacomet ljacomet self-assigned this Nov 22, 2021
@ljacomet ljacomet added this to the 7.3.1 milestone Nov 22, 2021
@ljacomet
Copy link
Member

Could you move these changes to be based off the release branch?

Otherwise generated files from old compilations would be forgotten.

Signed-off-by: Stefan Oehme <st.oehme@gmail.com>
@oehme oehme changed the base branch from master to release November 22, 2021 15:10
@oehme
Copy link
Contributor Author

oehme commented Nov 22, 2021

Done

@ljacomet
Copy link
Member

@bot-gradle test this

@bot-gradle
Copy link
Collaborator

OK, I've already triggered ReadyForMerge build for you.

@ljacomet ljacomet added the in:annotation-processing processor annotation incremental isolated aggregating apt kapt label Nov 24, 2021
@ljacomet ljacomet requested a review from asodja November 24, 2021 13:12
Copy link
Member

@asodja asodja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall, I just added some questions to the change.

Signed-off-by: Stefan Oehme <st.oehme@gmail.com>
@ljacomet
Copy link
Member

@bot-gradle test and merge

@bot-gradle
Copy link
Collaborator

OK, I've already triggered a build for you.

@lightbody
Copy link

Hey - I'm eagerly waiting to try this out and see if it fixes our Micronaut build issues too. Unfortunately, I haven't figured out how to install Gradle locally, so my next best option is to wait for this to merge and be available in one of the nightly releases.

Once merged, will it be in the 7.4 nightly or 7.3 nightly?

https://gradle.org/nightly/

https://gradle.org/release-nightly/

And of course, if you can point me to where I can solve my local Gradle install issues, I could verify this fix for our issues prior to merge ;)

@oehme
Copy link
Contributor Author

oehme commented Nov 25, 2021

@lightbody run gradlew install to create a local installation from source.

@lightbody
Copy link

@oehme Thanks. I was doing gradle install 😵‍💫 .

I think I'm using it now and, if so, it unfortunately doesn't solve my problem. We're seeing the same errors reported in that original Micronaut ticket. I'm going to try to triple check that I am indeed using the right build (I'm running ~/path/to/local/gradle compileJava vs my normal ./gradlew compileJava). But assuming it is indeed an outstanding bug, my next step will be to try to distill our giant build down to something that reproduces the problem.

@bot-gradle bot-gradle merged commit a2e63a5 into gradle:release Nov 25, 2021
@oehme
Copy link
Contributor Author

oehme commented Nov 25, 2021

@lightbody when you have a reproducer, just create a new issue and ping me on it and I'll look into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in:annotation-processing processor annotation incremental isolated aggregating apt kapt
Projects
None yet
Development

Successfully merging this pull request may close these issues.

error: Unexpected error: Attempt to recreate a file for type com.example.$DemoTest$Definition
5 participants