This makes it possible to remove dependency on protobuf. The dependency causes more problems than compatibility with some users of cc_proto_library from rules_cc.
Move WORKSPACE.bzlmod into correct directory.
PiperOrigin-RevId: 691445019
Change-Id: I45d7b4e381483de14ea2d20110be40f471a1ad12
BEGIN_PUBLIC
Add missing defaults for cc_toolchain
Fixes breakage caused by fully enumerating known attributes of a cc_toolchain without providing default values for optional arguments.
END_PUBLIC
PiperOrigin-RevId: 684719429
Change-Id: I8d031a344a65218fc925025cfef7768d123ad879
BEGIN_PUBLIC
Add documentation for `cc_toolchain`
Updates and includes documentation for the `cc_toolchain` rule, fixing some minor typos along the way.
END_PUBLIC
PiperOrigin-RevId: 684051451
Change-Id: I5bb62f22b3fb68e2d233fb85255d1a86bb45a47d
BEGIN_PUBLIC
Fix argument ordering
Expected argument ordering should be:
1. Arguments listed in `args`.
2. Legacy/built-in features.
3. User-defined features.
Due to some implementation changes, user-defined arguments were being applied last, reducing the ability for features to properly toggle behaviors dynamically.
This also fixes an issue caught by this change where cc_sysroot was applying flags to actions that had no associated action config.
END_PUBLIC
PiperOrigin-RevId: 683677895
Change-Id: I60e25ca22ffefce717e4e5ce476db0a070ca1993
setup_vc_env_vars should accepts more parameters than the wrapper previously allowed.
PiperOrigin-RevId: 683192260
Change-Id: Ie6063e0706640856e0f4c9dce3e1f4e8fe1ec9e9
the glob pattern `**/*.bzl` doesn't match anything there, and this is bad for `--incompatible_disallow_empty_glob`. This PR removes the offending line.
Otherwise rules_cc is transitively incompatible with Bazel 6 through the chain stardoc 0.7.0 -> rules_java 7.6.1.
`stardoc` targets are not needed by consumers of the ruleset.
This should make the concept of "sentinel features" work correctly with known_features and enabled_features, rather than enabling them directly in features.
PiperOrigin-RevId: 681688437
Change-Id: I29184a2079ccfd0eb3a275439508a66ca61109af
BEGIN_PUBLIC
Document feature-related toolchain rules
Extends the toolchain API documentation to cover all feature-related rules.
END_PUBLIC
PiperOrigin-RevId: 681476538
Change-Id: Icfe35e03937bdb0bc55eae24f57eafe0db7b16eb
BEGIN_PUBLIC
Add cc_action_type and cc_tool documentation
Extends the toolchain API documentation to include docs for cc_action_type, cc_action_type_set, cc_variable, and cc_tool.
Also improves cross-reference links and copybara behavior for docs.
END_PUBLIC
PiperOrigin-RevId: 680601617
Change-Id: Idbbdfbcb2c5a1c3598b6a7e7ba985ed14f871099
The majority of the time objc_compile is identical to C/C++ compiles.
Because of this I think by default all of those flags should apply here.
This is a bit funny since the current builtin toolchain doesn't support
Objective-C at all and that's only in the apple_support toolchain, but
new toolchains using these rules may want to support this.
Without this things like `--objccopt` just don't work out of the box.
BEGIN_PUBLIC
Add `@rules_cc` to generated docs
Ensures when docs are generated that the `@rules_cc` prefix is used for anything that appears to come from the repo.
END_PUBLIC
PiperOrigin-RevId: 677883741
Change-Id: I82b910b338aea8b14ecb7b192b5f3d3907be30ee
It's possible for there to be some arguments that are naturally
associated with the sysroot flag, for example on macOS there are
associated framework search paths that should be added with
`-F{sysroot}/Library/Frameworks`. There are also warnings flags you
might want to add such as `-Werror=missing-sysroot`. In this case I
think it's nicer to provide them alongside the sysroot definition,
instead of having to create a custom cc_args for them.
BEGIN_PUBLIC
Remove experimental_enable_rule_based_toolchains flag
Rule-based toolchains will not be gated by a flag when released with rules_cc v0.0.10. Also, this flag is unfortunately inherently incompatible with --experimental_exclude_starlark_flags_from_exec_config.
END_PUBLIC
PiperOrigin-RevId: 674072362
Change-Id: Iebda45d4daf4cec27c48296d61092dc513442911
BEGIN_PUBLIC
Consolidate action labels in toolchain args
Consolidates action labels used by re-implementation of legacy features to use logical groups rather than individually listing every action. This simplifies the rule definitions slightly.
END_PUBLIC
PiperOrigin-RevId: 673920103
Change-Id: If5453dd5b45d5549ff75d656da8a2873232117ae
BEGIN_PUBLIC
Create group for c compile actions
Adds `c_compile_actions` group to provide a logical C equivalent for `cpp_compile_actions`.
END_PUBLIC
PiperOrigin-RevId: 673408772
Change-Id: Ic5ccb57bc1fa7a98999d944316b97a39aac571ac
BEGIN_PUBLIC
Fix rule-based implementation of runtime_library_search_directories
As runtime_library_search_directories was written and reorganized through review, some instances of `$ORIGIN` were unintentionally renamed to `$EXEC_ORIGIN`. This change fixes those instances to correctly mirror CppActionConfigs.java.
END_PUBLIC
BUG: 349427627
PiperOrigin-RevId: 672401255
Change-Id: Ic20f9e77eccca8bc7e7f895aeaeb44f85022df28
*** Reason for rollback ***
Rollforward with fix for b/365154741
*** Original change description ***
Automated rollback of commit 0bc1ba56ef.
*** Reason for rollback ***
TAP failures in Bazel/Blaze, see b/365154741 and discussion at https://chat.google.com/room/AAAAXE3XKrY/_e3TpBFJvus
*** Original change description ***
Add user-facing documentation for cc_tool_map
BEGIN_PUBLIC
Add user-facing documentation for cc_tool_map
Adds user-facing documentation for the cc_tool_map toolchain rule, including an example and higher level analogies.
END_PUBLIC
***
***
PiperOrigin-RevId: 672000172
Change-Id: If7ad64e2378a2016d389a3718944aa04bc5e9759
*** Reason for rollback ***
TAP failures in Bazel/Blaze, see b/365154741 and discussion at https://chat.google.com/room/AAAAXE3XKrY/_e3TpBFJvus
*** Original change description ***
Add user-facing documentation for cc_tool_map
BEGIN_PUBLIC
Add user-facing documentation for cc_tool_map
Adds user-facing documentation for the cc_tool_map toolchain rule, including an example and higher level analogies.
END_PUBLIC
***
PiperOrigin-RevId: 671898382
Change-Id: Iead81a71adb17dff46b1b442471e595769fb5c2e
BEGIN_PUBLIC
Add user-facing documentation for cc_tool_map
Adds user-facing documentation for the cc_tool_map toolchain rule, including an example and higher level analogies.
END_PUBLIC
PiperOrigin-RevId: 671777889
Change-Id: Ib53de76f355db43a9530f7cbe11face3c9219675
BEGIN_PUBLIC
Implement archiver_flags as cc_args
This is the first change in a series that will reimplement the legacy
features defined in Bazel's Java code using the new toolchain rules. These implementations are redefined as raw arguments using the new toolchain rules, which allows for the definition shared and reused across different contexts.
This first change implements archiver_flags, which is used to produce the arguments for the archiver tool used by `cc_library`.
This CL also adds a test that compares the feature implementation produced by
the new rules to the feature implementation defined in Bazel's Java
code. This should make it easier to review the final result and ensure it
is functionally equivalent to the Java implementation.
END_PUBLIC
PiperOrigin-RevId: 671403834
Change-Id: I2d4f15b49619a11995a50c86439340ea532e360e
BEGIN_PUBLIC
Add support for implicit include directories to rule-based toolchains
Reorients the `cc_toolchain.cxx_builtin_include_directories` attribute so it is expressed as an attribute on `cc_args` and `cc_tool` to signify that the tools or arguments imply include directories that Bazel's include path checker should allowlist. This moves the allowlist to the source of truth that implies these directories.
END_PUBLIC
PiperOrigin-RevId: 671393376
Change-Id: Ide8cae548783726835168adcd3f705028a1f4308