Commit Graph

597 Commits

Author SHA1 Message Date
Copybara-Service aba461762f Merge pull request #250 from bazelbuild:Wyverald-patch-1
PiperOrigin-RevId: 683088860
Change-Id: I8aae0bbe569e834bc4d1d46dcee29c1c2ee51a64
2024-10-07 01:59:36 -07:00
Copybara-Service 37dacbbcf2 Merge pull request #249 from meteorcloudy:stardoc-dev
PiperOrigin-RevId: 683088422
Change-Id: Id6308c12494f4b591fd1d47ffbe84cb3b01b745d
2024-10-07 01:57:42 -07:00
Xùdōng Yáng 5cbd830262
Fix empty glob in cc/private/BUILD
the glob pattern `**/*.bzl` doesn't match anything there, and this is bad for `--incompatible_disallow_empty_glob`. This PR removes the offending line.
2024-10-04 22:54:53 +02:00
Fabian Meumertzheim 083ace4f11 Make stardoc a dev dependency
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.
2024-10-04 15:07:57 +02:00
Copybara-Service 7343c660a4 Merge pull request #244 from keith:ks/allow-extra-args-to-cc_sysroot
PiperOrigin-RevId: 682280945
Change-Id: I1f0256f6c99dd1e67efdcd08145700e10ab26e6a
2024-10-04 05:25:37 -07:00
Copybara-Service 565dbd65bd Merge pull request #245 from keith:ks/add-objc_compile-to-compile_actions
PiperOrigin-RevId: 682280777
Change-Id: If9c3a8aa883f7630d9a21d09e65c3c7a230140f2
2024-10-04 05:24:32 -07:00
Googler fd72f9e62a Fix rules_cc copybara
PiperOrigin-RevId: 682280542
Change-Id: Ie5f9dbc05f4d87dbe14b2392a21a23ef0c3ea9a4
2024-10-04 05:23:24 -07:00
Copybara-Service b1bea517b7 Merge pull request #240 from bazelbuild:comius-patch-1
PiperOrigin-RevId: 682269919
Change-Id: Iae32802a2d92a79f9791708dceeafc8b1fb51f10
2024-10-04 04:41:30 -07:00
Ivo List b6db47b84b Add bazel version 2024-10-04 13:28:28 +02:00
Ivo List 6a6e870a20 Fix url 2024-10-04 13:28:28 +02:00
Ivo List 85e02e42b3 Adding maintainers 2024-10-04 13:28:28 +02:00
Armando Montanez e8989401d5 Address more comments 2024-10-03 19:48:19 -07:00
Armando Montanez 4ac204f4ed Run buildifier 2024-10-03 10:27:34 -07:00
Armando Montanez 08752d184e Remove bzlmod lockfile in example 2024-10-03 10:12:56 -07:00
Armando Montanez ddbe1503eb Update ignore all bazel-generated dirs 2024-10-03 10:10:35 -07:00
Armando Montanez 09cd8eb3d6 Merge branch 'main' into rules-based-toolchain-example 2024-10-03 10:09:43 -07:00
Armando Montanez be2b2e94af Reorganize to address review feedback 2024-10-03 10:04:23 -07:00
Googler c2549f6eb0 Sync cc toolchain from Bazel's tools/cpp
- @bazel_tools//tools/cpp:toolchain_type is not moved.
- Added cc/toolchains/toolchain_config_utils.bzl for exposing util functions for cc toolchain configuration.

Closes https://github.com/bazelbuild/rules_cc/pull/247

Working towards https://github.com/bazelbuild/bazel/issues/23809

PiperOrigin-RevId: 681913803
Change-Id: I16ff456a212ab0e579c137bd74344255f4e49bd8
2024-10-03 09:32:38 -07:00
Googler f364500ba8 Create a concept of a tool capability.
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
2024-10-02 19:56:22 -07:00
Armando Montanez dd9e124c92 Rename BUILD to BUILD.bazel
Indicate these build files only work with Bazel and not Blaze.
2024-10-02 17:00:28 -07:00
Armando Montanez 4567873de2 Merge branch 'main' into rules-based-toolchain-example 2024-10-02 16:12:08 -07:00
Armando Montanez 19920b75ab Update package/license declarations 2024-10-02 16:02:51 -07:00
Armando Montanez c28b850603 Remove experimental_enable_rule_based_toolchains
Removes nonexistent flag.
2024-10-02 15:56:21 -07:00
Armando Montanez 72d3b34612 Remove unnecessary allowlist_include_directories 2024-10-02 15:54:03 -07:00
Googler 1af2140e73 Document feature-related toolchain rules
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
2024-10-02 09:10:38 -07:00
Googler b06d2f7d53 Add cc_action_type and cc_tool documentation
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
2024-09-30 09:15:19 -07:00
Googler 9cb80cfc32 Add objcopy_embed_data to rules_cc action_names.bzl.
PiperOrigin-RevId: 680579470
Change-Id: I73600ea8df35aa8a7983ebc4e2e278945d2e65cb
2024-09-30 08:07:27 -07:00
Keith Smiley 97cc237a06
Add objc_compile to compile_actions
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.
2024-09-24 15:23:37 -07:00
Googler 848d56aa29 Update copybara to improve docs handling
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
2024-09-23 11:55:00 -07:00
Keith Smiley b4f54fab89
Allow extra args to cc_sysroot
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.
2024-09-22 14:00:13 -07:00
Googler 91f050e461 Release rules_cc 0.0.10
PiperOrigin-RevId: 674308086
Change-Id: I1b673c7b1c04e3d47b826160903357fa1dbb3ba9
2024-09-13 08:30:29 -07:00
Googler 58debbffe4 Remove experimental_enable_rule_based_toolchains flag
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
2024-09-12 17:31:23 -07:00
Googler de86823dde Document args-related toolchain rules
BEGIN_PUBLIC

Document args-related toolchain rules

Adds comprehensive documentation for cc_args, cc_nested_args, and cc_args_list.

END_PUBLIC

PiperOrigin-RevId: 673921558
Change-Id: I1c9c0731925a03dedec983083072f52c6d4c270f
2024-09-12 11:09:02 -07:00
Googler 0d5561bcba Consolidate action labels in toolchain args
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
2024-09-12 11:05:19 -07:00
Googler da1ac71c8e Create group for c compile actions
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
2024-09-11 08:46:50 -07:00
Ivo List 7a67e9887b Copybara Merge: https://github.com/bazelbuild/rules_cc/pull/238
BEGIN_PUBLIC
Copybara import of the project:

--
2803a12428 by Ivo List <ilist@google.com>:

Prepare for release 0.0.10-rc2

--
3423c73208 by Ivo List <ilist@google.com>:

Format WORKSPACE

--
a99403a6b0 by Ivo List <ilist@google.com>:

Touch module

--
258d8c9f24 by Ivo List <ilist@google.com>:

Revert "Touch module"

This reverts commit a99403a6b0.

END_PUBLIC

COPYBARA_INTEGRATE_REVIEW=https://github.com/bazelbuild/rules_cc/pull/238 from comius:release-0.0.10-rc2 258d8c9f24
PiperOrigin-RevId: 673358956
Change-Id: Iabc9c29e6f168cfdfd2f0657438b71654f470cc9
2024-09-11 05:56:57 -07:00
Googler 96ac608d34 No public description
PiperOrigin-RevId: 673231375
Change-Id: I61110c5d47898c0ef27af650ad56de6f107d3976
2024-09-10 22:04:14 -07:00
Googler ce4bc8a8de Make `cc_helper.bzl` publicly `load()`-able for `@rules_java`
PiperOrigin-RevId: 672945291
Change-Id: I0c2a32475c1f2fdeffe28239cb0b9bead70295a7
2024-09-10 06:54:08 -07:00
Armando Montanez 8faacdf7e3 Remove :ubuntu: from CI task name 2024-09-09 08:39:54 -07:00
Armando Montanez c9a859abce Run buildifier 2024-09-09 08:36:30 -07:00
Armando Montanez c2c7987f55 Add copyright headers 2024-09-09 08:30:27 -07:00
Armando Montanez 28f3408ddb Merge branch 'main' into rules-based-toolchain-example 2024-09-09 08:21:33 -07:00
Googler 5c1be25800 Copy a few utilities from `@_builtins` to `@rules_cc`
PiperOrigin-RevId: 672519388
Change-Id: Icb077dd736af10724ffdbfb8330564516b43fb1d
2024-09-09 06:06:10 -07:00
Googler b8bb882895 Fix rule-based implementation of runtime_library_search_directories
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
2024-09-08 22:14:44 -07:00
Googler ca8483971c Automated rollback of commit 0f352c3497.
*** 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
2024-09-06 23:05:56 -07:00
Googler 0f352c3497 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: 671898382
Change-Id: Iead81a71adb17dff46b1b442471e595769fb5c2e
2024-09-06 14:50:15 -07:00
Armando Montanez a79b9c4c4b Add presubmit 2024-09-06 11:14:48 -07:00
Armando Montanez 87a3dd9d0e Get toolchain working 2024-09-06 11:09:10 -07:00
Armando Montanez 2bdc5d9a6b Rule-based toolchain example 2024-09-06 11:08:58 -07:00
Googler 0bc1ba56ef 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: 671777889
Change-Id: Ib53de76f355db43a9530f7cbe11face3c9219675
2024-09-06 09:01:28 -07:00