Skip to content

incompatible_use_specific_tool_files: Use appropriate artifacts from cc_toolchain as inputs to C++ actions.  #8531

@scentini

Description

@scentini

cc_toolchain has attributes corresponding to various toolchain components like ar_files, compiler_files, and as_files. Previously, Bazel used broad file groups like all_files as inputs for several classes of actions and ignored the more specific toolchain attributes. --incompatible_use_specific_tool_files brings these attributes into use.

Namely, under this flag:

  • C and C++ compilation actions use compiler_files rather than all_files.
  • Static library-generating actions use ar_files rather than linker_files.
  • Non-processed assembler actions use as_files rather than all_files. Preprocessed assembly actions use compiler_files because preprocessing is usually done by the C compiler.

Relevant issues: #6927, #6928.

Migration

For every cc_toolchain rule, ensure

  • compiler_files contains the compiler binary and standard library header files if necessary
  • as_files includes the assembler (e.g., gas)
  • ar_files includes the static archive tool (e.g., ar)

Expected timeline

Disabled by default in 0.27.
Enabled in the September 2019 release.

Metadata

Metadata

Assignees

Labels

P2We'll consider working on this in future. (Assignee optional)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