Skip to content

Warn users about using provided/optional/implementation for annotation deps, especially with @Implies #294

Closed

Description

@cpovirk

I wrote something about those scopes for Guava users in https://github.com/google/guava/wiki/UseGuavaInYourBuild#what-about-guavas-own-dependencies, but here we'd be writing primarily to other library authors who are making their own decisions about what scope to use.

We'll hopefully be defining annotations such that those scopes can't cause "Cannot find annotation method 'value()'" problems, but I don't know that we'll be able to prevent all runtime problems. And @Implies is going to be a whole additional problem (somewhat similar to @Inherited) about which I'll file an issue shortly.

Some other links:

Activity

  1. added this to the Post-1.0 milestone on Oct 3, 2022
  2. cpovirk commented on Oct 3, 2022

    @cpovirk
    CollaboratorAuthor

    (In our docs, we can mention that JSpecify is a small library (and, given our rate of progress, is going to stay that way ;)).)

  3. kevinb9n commented on Oct 5, 2022

    @kevinb9n
    Collaborator

    I think you were summarizing this issue in #295 like this:

    When developers declare a dependency on a library of annotations (like JSpecify), they sometimes choose to declare the dependency in a way that tells tools: "When someone depends on my library, don't include that annotation library on that user's classpath, either at build time or at runtime." I think this is a bad idea in general (and so I want to discourage it).

    So unless we reverse course on "bad idea", we should continue this evangelism, and strongly advise tool owners that they should issue loud warnings when they spot an annotation they know nothing about. And maybe even add a javadoc blurb to @Implies in particular about it.

  4. modified the milestones: Post-1.0, 1.0 on Oct 5, 2022
  5. added
    documentation
    and removed on Nov 30, 2022
  6. self-assigned this
    on Jun 27, 2024
  7. cpovirk commented on Jul 2, 2024

    @cpovirk
    CollaboratorAuthor

    See also #389.

  8. cpovirk commented on Jul 8, 2024

    @cpovirk
    CollaboratorAuthor

    Continuing to dump links without thinking deeply: As long as nullness checkers contain code like this that introspects on annotation declarations, we will have another reason to worry about building without those annotations on the classpath.

  9. netdpb commented on Jul 16, 2024

    @netdpb
    Collaborator

    This is written in the docs-1.0 branch, which we'll merge into main soon.

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

Metadata

Metadata

Assignees

Labels

documentation

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions