Skip to content

incompatible_load_cc_rules_from_bzl: load cc rules from @rules_cc #8743

@oquenchil

Description

@oquenchil

Flag: --incompatible_load_cc_rules_from_bzl
Available since: 0.28 (July2019 release)
Will be flipped in: 1.0 (September 2019 release)
Tracking issue: #7643

cc_library, cc_binary, cc_test, cc_import, cc_proto_library, fdo_profile, fdo_prefetch_hints, objc_library, objc_import, cc_toolchain, cc_toolchain_suite, cc_flags_supplier and compiler_flag have to be loaded from @rules_cc.

For example if you are using cc_library, add the following load statement to your BUILD/bzl file.
load("@rules_cc//cc:defs.bzl", "cc_library")

You will have to add the rules_cc to your WORKSPACE file as well:

http_archive(
    name = "rules_cc",
    sha256 = "e75dfb05bc1e89ebbb6696cadb5e455833690009310d9dc5512151c5adb0e4e3",
    strip_prefix = "rules_cc-cfe68f6bc79dea602f2f6a767797f94a5904997f",
    urls = [         
  "https://github.com/bazelbuild/rules_cc/archive/cfe68f6bc79dea602f2f6a767797f94a5904997f.zip",
    ],
)

There is a bug in a previous version of rules_cc that may cause problems when you have tags of your own that come from a separate bzl file. If you have to use the old version of rules_cc, you can get around the bug by passing tags = list(TAGS) to the cc_* rule. instead of doing tags = TAGS directly.

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