Skip to content

Conversation

@pkoenig10
Copy link
Member

palantir/conjure-java-runtime-api#1095 broke consumers who did not themselves use the Immutables annotation processor.

warning: The following options were not recognized by any processor: '[immutables.gradle.incremental]'
error: warnings found and -Werror specified
1 error
1 warning

This is not a regression of #2465 - the test added in that PR still passes.


return Objects.equals(moduleId.getGroup(), "org.immutables") && Objects.equals(moduleId.getModule(), "value");
private static boolean isImmutablesValue(Dependency dependency) {
return Objects.equals(dependency.getGroup(), "org.immutables") && Objects.equals(dependency.getName(), "value");
Copy link
Contributor

@CRogers CRogers Feb 7, 2024

Choose a reason for hiding this comment

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

If people bring in the actual immutables processor jar (not ::annotations classifier) transitively and it ends up being used we should still actually apply this? Couldn't we fix this by keeping the code looking at transitives but making sure one of the components has a group org.immutables, artifactId value and no classifier? Might have to use the artifacts rather than components api from Gradle to do this from memory (so you can get the classifiers)?

Copy link
Member Author

Choose a reason for hiding this comment

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

Couldn't we fix this by keeping the code looking at transitives but making sure one of the components has a group org.immutables, artifactId value and no classifier?

This is what I tried to do at first, but I couldn't figure out how to get at the classifier here. Although it is just more complexity.

If palantir/conjure-java-runtime-api#1099 doesn't fix the issue I'll play around with this a bit more.

Although I have to imagine that bringing in the immutables processor as a transitive dependencies and then using it is pretty unlikely. Honestly, if you're using an annotation processor and not declaring an explicit dependency, then you have no right to complain if your build is slow because we didn't enable incremental compilation for you.

Copy link
Contributor

Choose a reason for hiding this comment

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

I swear I remember seeing the horror of some annotation processor produce an immutables class that was then compiled by immutables... It was a long time ago, sense may have prevailed.

Copy link
Contributor

@CRogers CRogers Feb 7, 2024

Choose a reason for hiding this comment

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

you have no right to complain if your build is slow because we didn't enable incremental compilation for you

I agree with the sentiment but the problem is it just silently becomes slower with no indication why... and devs often just suffer in silence. I guess this is telling me we should probably build something that makes a loud log line or fails the build when it detects an non-incremental annotation processor somehow (in an ideal world).

Copy link
Contributor

@CRogers CRogers Feb 7, 2024

Choose a reason for hiding this comment

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

I updated it with the version that checks the classifier using the old artifact APIs (Gradle still does not have a configuration cacheable api for maven classifiers 😢: gradle/gradle#23702).

Copy link
Member Author

@pkoenig10 pkoenig10 left a comment

Choose a reason for hiding this comment

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

👍

Confirmed that this fixes the issue, thanks for the help @CRogers!

@CRogers
Copy link
Contributor

CRogers commented Feb 7, 2024

👍

@changelog-app
Copy link

changelog-app bot commented Feb 7, 2024

Generate changelog in changelog/@unreleased

What do the change types mean?
  • feature: A new feature of the service.
  • improvement: An incremental improvement in the functionality or operation of the service.
  • fix: Remedies the incorrect behaviour of a component of the service in a backwards-compatible way.
  • break: Has the potential to break consumers of this service's API, inclusive of both Palantir services
    and external consumers of the service's API (e.g. customer-written software or integrations).
  • deprecation: Advertises the intention to remove service functionality without any change to the
    operation of the service itself.
  • manualTask: Requires the possibility of manual intervention (running a script, eyeballing configuration,
    performing database surgery, ...) at the time of upgrade for it to succeed.
  • migration: A fully automatic upgrade migration task with no engineer input required.

Note: only one type should be chosen.

How are new versions calculated?
  • ❗The break and manual task changelog types will result in a major release!
  • 🐛 The fix changelog type will result in a minor release in most cases, and a patch release version for patch branches. This behaviour is configurable in autorelease.
  • ✨ All others will result in a minor version release.

Type

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

Ignore org.immutables:value::annotations when deciding to add the annotation processor arg required by immutables to run incrementally.

Check the box to generate changelog(s)

  • Generate changelog entry

@CRogers CRogers changed the title Don't consider transitive dependencies when adding Immutable incremental arg Ignore org.immutables:value::annotations when adding Immutable incremental arg Feb 7, 2024
@bulldozer-bot bulldozer-bot bot merged commit b81e3f9 into develop Feb 7, 2024
@bulldozer-bot bulldozer-bot bot deleted the pkoenig/immutables branch February 7, 2024 22:51
@svc-autorelease
Copy link
Collaborator

Released 5.38.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants