commit | 2a5a16f0f813e5b8a9c379887ab9e0ba2cbfd66e | [log] [tgz] |
---|---|---|
author | armandomontanez <montanez.armando.l@gmail.com> | Thu Feb 06 13:34:38 2025 -0800 |
committer | Copybara-Service <copybara-worker@google.com> | Thu Feb 06 13:35:09 2025 -0800 |
tree | ba571adfe9cb4f069c266b29d797c81da1c2c225 | |
parent | c9b3ccb0bb42c71a9a4a603b2472ae5a130a6363 [diff] |
Override legacy features with cc_feature_set Copybara Import from https://github.com/bazelbuild/rules_cc/pull/338 BEGIN_PUBLIC Override legacy features with cc_feature_set (#338) Modifies experimental_replace_legacy_action_config_features slightly to make it override legacy features rather than just reimplement them as args. This should prevent duplicate arguments for the features that are re-implemented. Closes #338 END_PUBLIC COPYBARA_INTEGRATE_REVIEW=https://github.com/bazelbuild/rules_cc/pull/338 from armandomontanez:origin/experimental_override_legacy_features 42b5f5d4807f4444a8630e1c8678aabcd061a368 PiperOrigin-RevId: 724056412 Change-Id: I220b195b359afdea37afd50d655f871eea127e20
This repository contains a Starlark implementation of C++ rules in Bazel.
The rules are being incrementally converted from their native implementations in the Bazel source tree.
For the list of C++ rules, see the Bazel documentation.
There is no need to use rules from this repository just yet. If you want to use rules_cc
anyway, add the following to your WORKSPACE
file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "rules_cc", urls = ["https://github.com/bazelbuild/rules_cc/archive/refs/tags/<VERSION>.tar.gz"], sha256 = "...", )
Then, in your BUILD
files, import and use the rules:
load("@rules_cc//cc:defs.bzl", "cc_library") cc_library( ... )
This repo contains an auto-detecting toolchain that expects to find tools installed on your host machine. This is non-hermetic, and may have varying behaviors depending on the versions of tools found.
There are third-party contributed hermetic toolchains you may want to investigate:
If you'd like to use the cc toolchain defined in this repo, add this to your WORKSPACE after you include rules_cc:
load("@rules_cc//cc:repositories.bzl", "rules_cc_dependencies", "rules_cc_toolchains") rules_cc_dependencies() rules_cc_toolchains()
This repository also contains migration tools that can be used to migrate your project for Bazel incompatible changes.
Script that migrates legacy crosstool fields into features (incompatible flag, tracking issue).
TLDR:
bazel run @rules_cc//tools/migration:legacy_fields_migrator -- \ --input=my_toolchain/CROSSTOOL \ --inline
Bazel and rules_cc
are the work of many contributors. We appreciate your help!
To contribute, please read the contribution guidelines: CONTRIBUTING.md.
Note that the rules_cc
use the GitHub issue tracker for bug reports and feature requests only. For asking questions see:
rules_cc
mailing list#cc
on slack.bazel.build