Skip to content

incompatible_require_ctx_in_configure_features: Require ctx argument in cc_common.configure_features #7793

@hlopko

Description

@hlopko

Flag: --incompatible_require_ctx_in_configure_features
Available since: 0.25
Will be flipped in: 0.26
Tracking issue: #6516

Motivation

In order to migrate C++ rules to platforms, we need the access to the C++ configuration fragment in Starlark APIs. All existing APIs have already access to it, but cc_common.configure_features doesn't. This incompatible change adds a ctx argument to configure_features.

Migration

Instead of:

feature_configuration = cc_common.configure_features(
    cc_toolchain = toolchain,
    requested_features = ctx.features,
    unsupported_features = ctx.disabled_features,
)

write:

feature_configuration = cc_common.configure_features(
    ctx = ctx,
    cc_toolchain = toolchain,
    requested_features = ctx.features,
    unsupported_features = ctx.disabled_features,
)

If your rule doesn't depend on cpp fragment yet, you will have to add fragments = ['cpp'] argument to the rule() call.

Metadata

Metadata

Assignees

Labels

P1I'll work on this now. (Assignee required)incompatible-changeIncompatible/breaking changeteam-Rules-CPPIssues for C++ rules

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions