Commit Graph

565 Commits

Author SHA1 Message Date
Copybara-Service 7381e24175 Merge pull request #198 from zaucy:emscripten-compiler
PiperOrigin-RevId: 691372690
Change-Id: I02e074a82591ba4112fe8449c0a7a86a35d64777
2024-10-30 04:49:48 -07:00
Copybara-Service faeafdb828 Merge pull request #253 from meteorcloudy:fix_compatibility
PiperOrigin-RevId: 689379342
Change-Id: Ia90576c00b917bf58a53362981d1f3e775d6dfd5
2024-10-24 07:51:08 -07:00
Googler f4e71c3a0c Update CODEOWNERS for rules_cc
PiperOrigin-RevId: 689375444
Change-Id: Ie4d9261f85290e25d76d634293bb7add9babea57
2024-10-24 07:37:56 -07:00
Googler f6c19dd20f Remove outdated toolchain README contents.
BEGIN_PUBLIC

Remove outdated toolchain README contents.

END_PUBLIC

PiperOrigin-RevId: 689365688
Change-Id: I78f3be0651e8aeaf842c3ea06d63161dd7ab42b4
2024-10-24 07:02:04 -07:00
Googler 9e3e907560 Exclude intentionally broken build target from GH CI
BEGIN_PUBLIC

Exclude intentionally broken build target from GH CI

Gets GitHub CI passing again.

END_PUBLIC

PiperOrigin-RevId: 687335065
Change-Id: Icb3d9d1f7b6ccfd1e19c9174ad3481ecc2dfcc7f
2024-10-18 09:46:57 -07:00
Yun Peng f7ca57feac Restore compatibility with Bazel 6 2024-10-11 18:23:48 +02:00
Googler ba3ec91a55 Enable cquery in GitHub CI
BEGIN_PUBLIC

Enable cquery in GitHub CI

This will prevent incompatible targets from being built and tested.

END_PUBLIC

PiperOrigin-RevId: 684771349
Change-Id: Iba8807531e2c5465f1378bc384359be439373bf6
2024-10-11 03:15:37 -07:00
Googler ae44550707 Add missing defaults for cc_toolchain
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
2024-10-10 23:37:00 -07:00
Googler 4a2d37625b Bump rules_cc version to 0.0.13
PiperOrigin-RevId: 684052002
Change-Id: I91de575a1ad021297787d00f9f95f0d569d9a5d8
2024-10-09 08:46:16 -07:00
Googler 324612d107 Add documentation for `cc_toolchain`
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
2024-10-09 08:44:04 -07:00
Googler 56f4a8bfa1 Add testing for Bazel@HEAD and Bazel 6
PiperOrigin-RevId: 684046113
Change-Id: I98875f8c67b491759f121c21e33ed04ec1d590e0
2024-10-09 08:26:06 -07:00
Copybara-Service 7782be6db1 Merge pull request #237 from armandomontanez:rules-based-toolchain-example
PiperOrigin-RevId: 684024413
Change-Id: I36767bb7452d83749a48342ff447f792979da576
2024-10-09 07:10:20 -07:00
Googler 013a082858 Redirect cc_proto_library to protobuf
PiperOrigin-RevId: 683876696
Change-Id: I0444b3b3bc3ac67bb641d82fe1d67117a6e2bcae
2024-10-08 21:18:29 -07:00
Googler a2949e206e Fix toolchain argument ordering
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
2024-10-08 10:34:59 -07:00
Armando Montanez b82c650543 Merge branch 'main' into rules-based-toolchain-example 2024-10-08 10:12:35 -07:00
Googler eeed2a9ab7 Remove crostool migration tools
The migration to .bzl configured toolchains happened a long time ago and the conversion tools from proto files are not needed anymore.

This also cleans up rules_cc dependencies to build those tools. And unblock me around the import of py_proto_library, which is not needed anymore.

PiperOrigin-RevId: 683582749
Change-Id: I9a56d9e3f9089f7434708a2cfefdd4f12d186658
2024-10-08 05:35:42 -07:00
Googler b96ca29763 Directly exposing functions in toolchain_config_utils.bzl
setup_vc_env_vars should accepts more parameters than the wrapper previously allowed.

PiperOrigin-RevId: 683192260
Change-Id: Ie6063e0706640856e0f4c9dce3e1f4e8fe1ec9e9
2024-10-07 08:24:18 -07:00
Googler 19a278e626 Prepare for 0.0.12 release
PiperOrigin-RevId: 683189389
Change-Id: I6092c6d9716502cb236c307b9761d88a09b41334
2024-10-07 08:14:05 -07:00
Googler be5e15fc27 Prepare version 0.0.11 release
PiperOrigin-RevId: 683098220
Change-Id: I85a6ea0c63070e4a880a67f3063e1c2c4bef31ac
2024-10-07 02:36:13 -07:00
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