Skip to main content

DepOnlyIncompatibleInfo

A provider for defining custom soft error categories for dep-only incompatible targets. This can be used to get finer-grained data on whether it is safe to enable error_on_dep_only_incompatible for a given target.

To use this, first define rule returning this provider.

def _impl(ctx: AnalysisContext) -> list[Provider]:
return [
DefaultInfo(),
DepOnlyIncompatibleInfo(custom_soft_errors = {
"dep_only_incompatible_foo": DepOnlyIncompatibleRollout(
target_patterns = ["root//foo/..."],
exclusions = ["root//foo/excluded/..."],
),
"dep_only_incompatible_bar": DepOnlyIncompatibleRollout(
target_patterns = ["root//bar/..."],
exclusions = [],
),
})
]

Then register a target of this rule in root .buckconfig under buck2.dep_only_incompatible_info buckconfig key. Once registered, soft errors will be fired under category "dep_only_incompatible_foo" when a target in root//foo/... is dep-only incompatible and likewise dep_only_incompatible_bar for a target in root//bar/....

DepOnlyIncompatibleInfo.custom_soft_errors

DepOnlyIncompatibleInfo.custom_soft_errors: dict[str, list[str] | DepOnlyIncompatibleRollout]