incompatible_disable_target_provider_fields: disallow access of providers on "target" objects by field syntax #9014
Related: #7347 (
The motivation for this change is described in #6241 and #7347. The affected Starlark syntax has been deprecated for over a year, and this aids #7347 in migrating off of the deprecated syntax.
is disallowed. Instead, use the following:
However, this is difficult to do in isolation. Namely, if my rule
Here we outline the migration plan for
STEP 1: Rule implementation functions which return providers use the old struct syntax must simultaneously support the new syntax and the old syntax. For example:
STEP 2: Rules which depend on rules using the deprecated syntax can, after step 1, access the provider using either
STEP 3: Rules which needed to be migrated in step 1 can completely migrate to the new syntax. The syntax from step 1 becomes:
This becomes a safe migration if we're guaranteed that all users of the rule have --incompatible_disable_target_provider_fields enabled from step 2.