Skip to content

incompatible_provide_cc_toolchain_info_from_cc_toolchain_suite: Provide CcToolchainInfo from cc_toolchain_suite, not cc_toolchain. #6537

@hlopko

Description

@hlopko

Flag: --incompatible_provide_cc_toolchain_info_from_cc_toolchain_suite
Available since: 0.20
Will be flipped in: 0.21
Enclosing tracking issue: #6072

In the past, cc_toolchain was selected during the configuration construction, and we want to move it the proper analysis phase. For that we need to change which rule provides CcToolchainInfo. Before it was cc_toolchain, now it will be cc_toolchain_suite. This will be mostly invisible change, things like ctx.fragments.cpp.cc_toolchain configuration field, cc_toolchain_alias, and find_cpp_toolchain will keep working transparently.

To refresh your understanding of how C++ specific toolchain selection works, see the docs.

Observable changes:

  • Label of the resolved target aliased by //tools/cpp:current_cc_toolchain will be different
  • rule.kind will be cc_toolchain_suite, not cc_toolchain.

Migration notes:

Unfortunately there is no domain-independent solution.

Important note:

C++ rules will migrate to platforms in 2019. When that happens, cc_toolchain_suite will be removed, and generic toolchain selection mechanism will be used. When we get there, we will again provide CcToolchainInfo from cc_toolchain. Therefore we advice you to make your code work with both cc_toolchain and cc_toolchain_suite, to save you from the future migration.

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