Commit Graph

451 Commits

Author SHA1 Message Date
Googler 69c9748afb BEGIN_PUBLIC
Fix problem with the toolchain definition.

A test for this will be added later in the form of an example toolchain.
END_PUBLIC

PiperOrigin-RevId: 615416990
Change-Id: I1f7fd1640e88b446597768b4f75c2154b630074f
2024-03-13 07:56:07 -07:00
Googler 59cf8ff109 Rename additional_files to data.
BEGIN_PUBLIC
Rename additional_files to data.

This is more consistent with other rules.
END_PUBLIC

PiperOrigin-RevId: 615364332
Change-Id: Ic27ec8c8e72d290e72074034f85a34b38401599b
2024-03-13 04:22:40 -07:00
Googler e658433e23 No public description
PiperOrigin-RevId: 613579953
Change-Id: I4aea8af1b3db8eb532c7c9296fc4dfa0c2ff9481
2024-03-07 07:40:02 -08:00
Googler 1ff1af662e Implement the cc_toolchain macro.
BEGIN_PUBLIC
Implement the cc_toolchain macro.

Things should be working at this point. This will be followed up with an example.
END_PUBLIC

PiperOrigin-RevId: 613436885
Change-Id: I1fc4a1e3a71c4f819998b69c73922821322d2991
2024-03-06 20:31:55 -08:00
Googler de4aaa6472 Allow cc_toolchain_info rule to be used as a parameter to pass into native.cc_toolchain(config = ...)
BEGIN_PUBLIC
Allow cc_toolchain_info rule to be used as a parameter to pass into native.cc_toolchain(config = ...)
END_PUBLIC

PiperOrigin-RevId: 613000772
Change-Id: I8348e2cbb4aa7d0a523341dcaf1e2c2bc647f640
2024-03-05 16:04:53 -08:00
Googler 94d4760a89 Implement cc_toolchain_config rule and cc_legacy_file_group rule.
BEGIN_PUBLIC
Implement cc_toolchain_config rule and cc_legacy_file_group rule.

Note that this rule is in the impl/ directory because we require users to use the cc_toolchain_config rule via the cc_toolchain macro that we will define later, to ensure that parameters such as `compile_files` are passed correctly.
END_PUBLIC

PiperOrigin-RevId: 612998387
Change-Id: I986d11775e368c4386a930ab2ce8663956a57f9d
2024-03-05 15:58:06 -08:00
Googler 7250ef4352 BEGIN_PUBLIC
Implement ToolchainConfigInfo.

Add support to create the toolchain from feature, action config, and args targets, and validate it to ensure correctness.
END_PUBLIC

PiperOrigin-RevId: 612985448
Change-Id: I7d9086dd1dde07eb0c2484414c9c28c1b8bfb427
2024-03-05 15:15:39 -08:00
Googler 9befdcd90e Remove macros wrapping rules that take in features.
Based on the comments in unknown commit, I created this CL

BEGIN_PUBLIC
Remove macros wrapping rules that take in features.
END_PUBLIC

PiperOrigin-RevId: 612979047
Change-Id: I5690717b164432c9cecebf87ef9dda41f9fa846f
2024-03-05 14:55:21 -08:00
Googler 4eccbe17c8 BEGIN_PUBLIC
Implement builtin CC toolchain features.

This will allow you to override builtin features
END_PUBLIC

PiperOrigin-RevId: 610887686
Change-Id: I30e928c116386ec703dff24a97f925481c395b06
2024-02-27 15:07:57 -08:00
Googler db087578f7 BEGIN_PUBLIC
Implement cc_feature_set and cc_feature_constraint.
END_PUBLIC

PiperOrigin-RevId: 610713183
Change-Id: Ia009ac536b71cd9aa44578f823f13361c1580e37
2024-02-27 04:49:36 -08:00
Googler 2b6cdcfe88 BEGIN_PUBLIC
Implement cc_feature for the rule based toolchain.
END_PUBLIC

PiperOrigin-RevId: 610712498
Change-Id: I2539825f0f4cf7f234a2310de6af0662aeb0ea2c
2024-02-27 04:45:26 -08:00
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
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