Skip to content

Refine the contract for Build Events Listeners #33772

@mlopatkin

Description

@mlopatkin

Currently, BuildEventsListenerRegistry.onTaskCompletion accepts any provider of any OperationCompletionListener implementation.

However, when the Configuration Cache is enabled, anything but providers of BuildService returned by BuildServiceRegistry.registerIfAbsent results in CC failure (after #15530).

This is inconvenient for several reasons:

  1. This is a discrepancy between Configuration Cache and Vintage modes, making it harder to adopt CC in an existing build.
  2. Nothing in the type system highlights this requirement.

Ideally, only CC-supported listeners should be accepted by the registry regarding of CC being enabled. This can also be solved by relaxing the restriction on the listeners.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions