Commit Graph

591 Commits

Author SHA1 Message Date
Googler c5493f9b2c BEGIN_PUBLIC
Implement cc_action_type_config.

Rename it from cc_action_config, to make it clear that we are not configuring an action, but rather configuring a type of action.
END_PUBLIC

PiperOrigin-RevId: 610518142
Change-Id: Ic10755952ee786d30a3a5564aa09a8dc16499f3a
2024-02-26 13:58:42 -08:00
Googler 0d68da5d50 BEGIN_PUBLIC
Implement cc_args_list.

It's completely unneccesary to implement it this early, but collecting args lists is also required for cc_feature.
END_PUBLIC

PiperOrigin-RevId: 609833962
Change-Id: I369a929af4280c0a7ebbe2e13159b640c1968209
2024-02-23 14:14:27 -08:00
Googler 837caeca75 BEGIN_PUBLIC
Pull more info into ArgsListInfo.

This allows us to make queries such as "get me all the flags / files required for this specific action". This will allow us to implement cc_action_config more easily and efficiently.
END_PUBLIC

PiperOrigin-RevId: 609828504
Change-Id: Ie3978674c5027f892d2e5e4c8d937a52c59fde5d
2024-02-23 13:54:41 -08:00
Googler 916074ec32 BEGIN_PUBLIC
Implement cc_tool
END_PUBLIC

PiperOrigin-RevId: 609307150
Change-Id: I2e135a59e06a56ca8ec071254d340ac4b984b234
2024-02-22 03:06:06 -08:00
Googler 9eb790fe47 BEGIN_PUBLIC
Add support for testing against more complex subject types.

We can now use subjects such as subjects.result(subjects.str) for something that may return a string, or fail.
END_PUBLIC

PiperOrigin-RevId: 608971309
Change-Id: I9ae61c988a597189b84fb6ccef75c96697c6e364
2024-02-21 06:24:34 -08:00
Googler 35fe45e91b BEGIN_PUBLIC
Implement cc_args.

Also change cc_flag_set / cc_flag_group to cc_args / cc_arg_group. This is to lean into the idea that this is roughly equivalent to ctx.actions.args()
END_PUBLIC

PiperOrigin-RevId: 608804069
Change-Id: I74ea883b14219f904aaafc4eab902b96a1fb3e3d
2024-02-20 17:58:39 -08:00
Googler 2e780ceda9 BEGIN_PUBLIC
Add support for testing rules_cc's new toolchains with rules_testing.
END_PUBLIC

PiperOrigin-RevId: 608769646
Change-Id: I1a698355e5e977cc86eedc7cf6e8e0f888593cb8
2024-02-20 15:54:10 -08:00
Googler 833f17060c Implement action types for the configurable cc toolchain.
This does nothing on its own, but is required for other types.

PiperOrigin-RevId: 606441930
Change-Id: I94dbbd760be856f28370a61edcf815eecb16f339
2024-02-12 18:54:59 -08:00
Googler 8857ebcb47 Add documentation for rule-based bazel toolchain configuration
PiperOrigin-RevId: 606434760
Change-Id: Ie238b5513144e4289186af470e7503f05dd87890
2024-02-12 18:22:13 -08:00
Googler e221babe8d Add providers for rule-based toolchain configuration.
Similar to the previous CL, this CL is to ensure that we agree on the relationship between each different type.

This will also allow for developing two things in parallel:
* The rules that generate these providers.
* Toolchain validation, and conversion to the cc_toolchain_config_lib providers.

PiperOrigin-RevId: 606391257
Change-Id: I9c2a9895d71ed987e85eb60f908d9833b838d9f8
2024-02-12 15:52:59 -08:00
Googler 760de9ef32 Cleanup uses of ctoolchain migration
BEGIN_PUBLIC
Internal change
END_PUBLIC

PiperOrigin-RevId: 606195771
Change-Id: I2c6ef2bd57991c6fe65e1bf49a67f3250c12724d
2024-02-12 03:16:53 -08:00
Googler db151d0a26 Fix internal breakages for `rules_cc`.
PiperOrigin-RevId: 590620989
Change-Id: I2586ea71b477fc5cb75429f8d839c8818d641e8b
2024-02-09 09:50:57 -08:00
Googler 05bd7e7e46 No public description
PiperOrigin-RevId: 590213610
Change-Id: Iefbee8b45c49fed7696f28519ac52f16ff643228
2024-02-09 09:50:43 -08:00
Jie Luo 15300e1a17 Automatic code cleanup.
PiperOrigin-RevId: 584077823
Change-Id: I1b57584d21fda9c8da2f04a0a03f1c387a579497
2023-11-20 11:11:32 -08:00
Copybara-Service 51b77439a1 Merge pull request #201 from renovate-bot:renovate/io_bazel_rules_go-0.x
PiperOrigin-RevId: 579091633
Change-Id: I80738931ec836d9f302f7bf41b1dc324d3b2f4f9
2023-11-03 00:29:32 -07:00
Mend Renovate 15e9203eac
Update dependency io_bazel_rules_go to v0.42.0 2023-09-30 01:55:50 +00:00
Ezekiel Warren b4071d7181
add emscripten compiler config_setting 2023-09-20 13:23:09 -07:00
Copybara-Service c8c38f8c71 Merge pull request #196 from bazelbuild:meteorcloudy-patch-2
PiperOrigin-RevId: 566554609
Change-Id: I083884dcd3d92ab421ea2a630cd4d4ed21ff9760
2023-09-19 01:45:32 -07:00
Yun Peng fb2ace54c3
Update MODULE.bazel 2023-09-19 10:05:03 +02:00
Yun Peng a943a35fc8
Update MODULE.bazel 2023-09-19 09:58:14 +02:00
Yun Peng 009750537d
Register cc toolchain from @bazel_tools
The one located in rules_cc isn't yet in sync.
2023-09-19 09:57:24 +02:00
Googler eef16ef276 Create toolchain types for proto_library and lang_proto_library
BEGIN_PUBLIC
Create toolchain types for proto_library and lang_proto_library

This handles only lang_proto_libraries defined in Bazel: Java, Java lite, Python, C++.

Design doc: https://docs.google.com/document/d/1CE6wJHNfKbUPBr7-mmk_0Yo3a4TaqcTPE0OWNuQkhPs/edit#heading=h.5mcn15i0e1ch
Issue: https://github.com/bazelbuild/rules_proto/issues/179
END_PUBLIC
PiperOrigin-RevId: 566380737
Change-Id: I49b132f861bc7a871d98bbd333271d540faaf737
2023-09-18 12:30:14 -07:00
Googler fc88354c6f Automatic code cleanup.
PiperOrigin-RevId: 566245154
Change-Id: Id906c52da9c922cee77782994a63c6b1dc656fc8
2023-09-18 03:04:35 -07:00
Googler 9c1686d2cc Upgrade version of rules_go
Fixes: https://github.com/bazelbuild/rules_cc/issues/195
PiperOrigin-RevId: 564652456
Change-Id: I2bef5c13c19374d2a3e57f6fb14ab84e48bc5a80
2023-09-12 02:17:23 -07:00
Googler b039a551a7 Fix lexicographical order to make Buildifier happy.
PiperOrigin-RevId: 562719963
Change-Id: I8c50b4606a69d5fedc9dd6b7f9768c2399d86ea3
2023-09-05 03:15:26 -07:00
Richard Levasseur b8d9580d80 Automatic code cleanup.
PiperOrigin-RevId: 562018631
Change-Id: I7b324d5b151341033df696f82b68e9f9160ad625
2023-09-01 12:20:38 -07:00
Copybara-Service 7771fb57dd Merge pull request #193 from renovate-bot:renovate/platforms-0.x
PiperOrigin-RevId: 552414057
Change-Id: Idaa9f93597e22571672f3ab14ee628cae8d0e570
2023-07-31 02:05:29 -07:00
Mend Renovate 67d307adad
Update dependency platforms to v0.0.7 2023-07-28 21:37:53 +00:00
Copybara-Service 22d91c627c Merge pull request #192 from alexeagle:patch-1
PiperOrigin-RevId: 549686322
Change-Id: I98922d3245c822a703e32c2ce686890b968ab31c
2023-07-20 11:15:49 -07:00
Alex Eagle f7aa3d5a2f
Update README.md
Explain that the provided toolchain is not hermetic, and point to some options which are.

This was a topic at the Rules Authors SIG meeting on 27 June 2023: https://docs.google.com/document/d/1YGCYAGLzTfqSOgRFVsB8hDz-kEoTgTEKKp9Jd07TJ5c/edit#heading=h.twkfyk2n9ye9
2023-07-19 15:32:02 -07:00
Googler 1583313f41 Fix licensing errors and add default condition for `local_defines`.
PiperOrigin-RevId: 548995629
Change-Id: I0734ca5b64cf37401ec74a339a67f3044321aa7c
2023-07-18 07:27:57 -07:00
Copybara-Service 5d8ef91731 Merge pull request #167 from fmeum:add-compiler-settings
PiperOrigin-RevId: 548940888
Change-Id: Id69973c5014cfe59729cab2d983df24b7422602d
2023-07-18 02:38:23 -07:00
Copybara-Service 84d2878ffc Merge pull request #188 from fmeum:tests-ci
PiperOrigin-RevId: 548924746
Change-Id: Ib201c6dd5c383b2fb8d0bec78c4037df964ab513
2023-07-18 01:25:43 -07:00
Googler 5a8cab742c Add support for expand_if_available for env_entry
PiperOrigin-RevId: 548694860
Change-Id: I90f46902058fe1ac3a75bb25bddbbf6e181fbabd
2023-07-17 08:12:34 -07:00
Fabian Meumertzheim 4e72e665a3 Add well-known compiler `config_setting`s
As of Bazel 6.0.0, all Bazel-provided toolchains report consistent
compiler names that can be matched on with `select`. Having a central
place for `config_setting`s that can be used for this purpose makes it
so that rulesets don't have to define them themselves and moving the
compiler flag out of `@bazel_tools` becomes easier as it is no longer
referenced directly.

Also includes minor fixes to `//tests/...` so that it can be enabled in
CI.
2023-07-10 16:39:33 +02:00
buildbreaker2021 d4c72e3166
Merge pull request #188 from fmeum/tests-ci
Enable `//tests/...` in CI
2023-07-10 16:38:35 +02:00
Fabian Meumertzheim f9e3b89332 Enable `//tests/...` in CI 2023-07-08 00:29:45 +02:00
Googler 1dbb691712 Get rid of unused objcpp_executable type
PiperOrigin-RevId: 539637641
Change-Id: I80f65a738e77b58054121bfe19a47659fb50fc42
2023-06-12 06:53:11 -07:00
Googler 7f0992b0bd Remove `cc_host_toolchain_alias` target.
Right now there should be no difference between `cc_host_toolchain_alias` and `cc_toolchain_alias` rules.
This is a potentially breaking change for Bazel, if something was depending on `current_cc_host_toolchain` try depending on `current_cc_toolchain` instead.

PiperOrigin-RevId: 528762965
Change-Id: Id2d211c61fa06a578a838c054682c3507aa48261
2023-05-02 06:19:53 -07:00
Googler 2e4313aeba Automated rollback of commit 06e9dcf4b7.
*** Reason for rollback ***

Breaking tap/blaze. Example failure: []

*** Original change description ***

Sort action lists to make diffing easier.

***

PiperOrigin-RevId: 523671424
Change-Id: I475ff02bf8efd3c56e489e2de3ba2c3a5639c32e
2023-04-12 05:19:20 -07:00
Googler 06e9dcf4b7 Sort action lists to make diffing easier.
PiperOrigin-RevId: 523639362
Change-Id: I8a43799f58ad1ed5b19ec074fa9cb9a567591f36
2023-04-12 02:07:04 -07:00
Copybara-Service be9ff3eb41 Merge pull request #183 from renovate-bot:renovate/rules_proto-digest
PiperOrigin-RevId: 513165629
Change-Id: Ib58015b1e049cc54a347b86ca781807196a162cf
2023-03-01 01:22:30 -08:00
Renovate Bot 0baf82487f
Update rules_proto digest to e51f588 2023-02-28 15:13:12 +00:00
Copybara-Service 998319083b Merge pull request #182 from renovate-bot:renovate/rules_proto-digest
PiperOrigin-RevId: 511535003
Change-Id: I4d5847e1339bf8fd882dfcb69140b44efb05072e
2023-02-22 10:36:14 -08:00
Renovate Bot adfbe56c12
Update rules_proto digest to 33aba33 2023-02-21 19:32:32 +00:00
Copybara-Service 42f3259960 Merge pull request #180 from silvergasp:patch-2
PiperOrigin-RevId: 510383031
Change-Id: Id0796b560d646fab81dbda1ee98e6adaf68bfa8e
2023-02-17 02:54:21 -08:00
Yannic 507f49698a Update cc_toolchain_config_lib.bzl for bazelbuild/bazel#10967 2023-02-16 10:19:56 -08:00
Googler ad1830946d Remove redundant "# copybara-use-repo-external-label"
Remove redundant tags for copybara to replace labels with labels including the
repository, where there are no labels to substitute after 2f8c04c044.

PiperOrigin-RevId: 510103824
Change-Id: I9b65a6b7f9b48885aec4df5f4723273633be4860
2023-02-16 04:17:58 -08:00
Googler d8dfa8b829 Introduce flag --@rules_cc//:link_extra_libs
Numerous tools override --custom_malloc to add debugging or monitoring runtimes
(see e.g. sanitizers). While this is fine for cases where the tool must also
override malloc to function, in other cases it's simply misuse of
--custom_malloc where no other mechanism exists to link an extra library.

This becomes especially problematic where a runtime library is supposed to be
added in certain configurations that should run in production or other
performance sensitive builds. In these cases, we should _not_ override malloc,
which may also be specified by a cc_binary target. Doing so would introduce
unwanted changes, potentially affecting performance negatively.

This is the @rules_cc counterpart to the equivalent Bazel tools flag
--@bazel_tools//tools/cpp:link_extra_libs. Users that use @rules_cc to build
their C++ projects may use both flags interchangably, however, the @rules_cc
flag should be preferred.

PiperOrigin-RevId: 510103352
Change-Id: Iafccd00ffdb65cb4f953d5acadc451cffc134533
2023-02-16 04:15:10 -08:00
Googler a43f67b72c Automatic code cleanup.
PiperOrigin-RevId: 509526713
Change-Id: I852b1620897d8c6787ca25b6790f245b5bc274f0
2023-02-14 07:49:46 -08:00