Commit Graph

171 Commits

Author SHA1 Message Date
Marcel Hlopko 80b5b6b64b
Update renovate.json
Apparently formatting json with buildifier results in something that is not json. Who would have thought.
2019-11-03 11:40:55 +01:00
Googler 262ebec3c2 Fix buildifier warnings in @rules_cc
Fixes:

* Enabled buildifier on the Bazel CI again
* Added Skydocs where missing
* Moved public files out of .../private/... (e.g. cc_toolchain_config_lib.bzl)
* Reformatted
* Removed unused loads
* Using relative labels for cc_configure related files
* Added development dependency on rules_proto
    * they're not in the federation yet, so hand rolling in rules_cc's WORKSPACE file
* Added development dependency on rules_python (from federation)
* Cleaned up copybara (notable change - not using @rules_cc in labels inside rules_cc repo)
* Made cc_flags_supplier usable internally
* Moved load statements to the top of the bzl file
* Moved runfiles to the tools directory
* Unified toolchain_utils.bzl and find_cc_toolchain.bzl

RELNOTES: None.
PiperOrigin-RevId: 276479521
Change-Id: I3196896061fa2ee61a3efb130c214d288782066a
2019-10-24 07:01:25 -07:00
Googler 0e66ef31d6 rules_cc: Add top-level BUILD file to distribution.
Before this commit Bazel could not use the distribution since it failed with "Every .bzl file must have a corresponding package, but '@rules_cc//:internal_deps.bzl' does not have one."

https://buildkite.com/bazel/bazel-federation-distro-pre-release-testing/builds/20#29164fc9-b0bb-41aa-b62f-e2f3f20e9efc

PiperOrigin-RevId: 275263945
Change-Id: I12216f2070ddc579f553a22975790bbc9a18f0f9
2019-10-17 08:30:50 -07:00
Copybara-Service 12a2d801f6 Merge pull request #38 from hlopko:update_gtest
PiperOrigin-RevId: 274161434
Change-Id: Ic7cc0802695afff00095d5565496f7db46fe83e4
2019-10-11 06:35:58 -07:00
Marcel Hlopko 54c783c4d9 Actually, lets depend on the release archive, not the branch 2019-10-09 15:18:06 +02:00
Marcel Hlopko 2c9c93bc07 Update googletest to 1.10.x 2019-10-09 09:49:37 +02:00
Googler a508235df9 Add missing bzl files to rules_cc distribution.
PiperOrigin-RevId: 272505874
Change-Id: I68d1b43c859db54abf3da71ce1e11d5c15567257
2019-10-02 13:25:11 -07:00
Copybara-Service f871759081 Merge pull request #35 from fweikert:distro
PiperOrigin-RevId: 272444545
Change-Id: I8d582773c5ef124ecafe77a353434887f1abc1aa
2019-10-02 08:49:43 -07:00
fweikert 182a477244 Add version number to a dedicated bzl file
Adding the version number to defs.bzl caused some problems in our internal codebase.
2019-10-02 15:25:05 +02:00
Florian Weikert eae134361b Make Buildifier happy 2019-09-30 15:58:14 +02:00
Florian Weikert df4a51f42e Use latest federation version
This version includes rules_pkg 0.2.4, which contains the fix required to cut a first rules_cc release.
2019-09-30 15:10:00 +02:00
fweikert 29da92c66c Use rules_pkg for building releases
This commit allows the creation of distributions, with 0.0.1 being the first version.
See distro/README.md for details on how to build a release.

This commit also uses a new version of the Bazel federation that contains rules_pkg 0.2.2 instead of 0.2.1.

There are still some problems with the WORKSPACE stanza that is being printed by the release notes generation script, though:
- It references a //cc:deps.bzl file, which doesn't exist. I have to modify the scripts in rules_pkg to support a flag like 'has_deps'.
- It doesn't support the Bazel federation yet, since it always tells users to download code from the rules_cc repository.
2019-09-17 18:00:18 +02:00
Googler 42ed56d8ac Remove unused load statements from .bzl files
BEGIN_PUBLIC
Remove unused load statements from .bzl files

After transitive loads have been disabled in Blaze, unused load statements have
no effect (besides not useful memory consumption).

The CL has been created automatically by calling `buildifier --lint=fix --warnings=load` on all .bzl files.

The following additional command were run on all affected files to clean them up:

  * buildifier -a -v --lint=fix --warnings=load-on-top
    Moves all load statements to the top of a file
  * buildifier -a -v --lint=fix --warnings=same-origin-load
    Compresses all load statements from the same .bzl file to one load statement

END_PUBLIC

PiperOrigin-RevId: 269552258
Change-Id: I85ae6bf3467bf560ac3e0ab2470f864abb89e8e6
2019-09-17 06:09:06 -07:00
Copybara-Service cb2dfba674 Merge pull request #34 from hlopko:put_include_paths_into_action
PiperOrigin-RevId: 266894179
Change-Id: Ic93db66d9d22843b61b68f30851a312f74673ddb
2019-09-03 03:35:29 -07:00
Marcel Hlopko 8cf01f5ce5 Fix 2019-09-03 11:51:10 +02:00
Marcel Hlopko 2d62d780d1 Put include paths into action 2019-09-03 11:30:13 +02:00
Googler ea5c5422a6 Add support for thin LTO optimization in Bazel
Usage: CC=clang bazel build //foo:bar --features=thin_lto -c opt

RELNOTES: Bazel now supports ThinLTO builds on Linux for Clang versions >= 6.0. ThinLTO can be enabled through --features=thin_lto
PiperOrigin-RevId: 265649618
Change-Id: I68a38b8b8c1480e3b73d8e6f24e9dafece2c7de6
2019-08-27 03:33:52 -07:00
Googler c2790137ae Stop running Buildifier as part of the presubmit
We now have copies of .bzl files that we have to keep in sync between @rules_cc and @bazel_tools/tools
I propose to re-enable the Buildifier presubmit once this issue is resolved.

*** Original change description ***

Run Buildifier as part of the presubmit.

As a result we will catch some errors already in GitHub, and not later in Critique when it's harder to fix them.

***

PiperOrigin-RevId: 265636234
Change-Id: I10730665134240b3f47950e0e8fa0add8e0bd591
2019-08-27 01:51:17 -07:00
Googler 1d7c9eb8c8 Update copyright year in BUILD file.
RELNOTES:none
PiperOrigin-RevId: 265457282
Change-Id: Ibfb7f335c5f8c563ce9b31ba22435eec210cf132
2019-08-26 08:06:40 -07:00
Googler 4a1c578fb0 C++: Move tools/cpp from bazel_tools to rules_cc
Here we are duplicating bazel_tools/tools/cpp. The goal is for the BUILD files in bazel_tools/tools/cpp to have an alias that point to rules_cc. Then later on with the incompatible flag these aliases will no longer be valid.

Working towards #8743

RELNOTES:none
PiperOrigin-RevId: 264604076
Change-Id: I389702793a1a95b0990dce93577de2b7182e2e6b
2019-08-21 07:30:04 -07:00
Googler 624b5d59df Run Buildifier as part of the presubmit.
As a result we will catch some errors already in GitHub, and not later in Critique when it's harder to fix them.

PiperOrigin-RevId: 262967050
Change-Id: If598cea7cf9283203bad94533a6bb5be3349e118
2019-08-12 11:23:38 -07:00
Copybara-Service aed5c5b6d4 Merge pull request #31 from fweikert:merge
PiperOrigin-RevId: 262965730
Change-Id: Ibf68e12666dd01930f40adf04c4be18cb52d040f
2019-08-12 11:19:21 -07:00
fweikert 6d232cc0d6 Use federation version with working zlib repo 2019-08-12 15:56:12 +02:00
Florian Weikert d5d6527fcf Use federation version with required BUILD files 2019-08-09 16:17:16 +02:00
Florian Weikert 6cc7e712fb Fetch dependencies through the Bazel federation.
As a result of this commit, rules_cc now contains the required bzl files to be tested as part of the Bazel federation.
2019-08-09 15:41:00 +02:00
Googler 401380cd22 Add a cc_toolchain_config_compare_test that compares 2 Starlark C++ toolchain configuration rules
With CROSSTOOL not existing anymore, the comparison script can continue being useful in refactoring Starlark toolchain config rules.

RELNOTES: None.
PiperOrigin-RevId: 262544859
Change-Id: I633fdc4c09c7643d6e5d1c10537efa3c9a82003c
2019-08-09 05:56:16 -07:00
Googler e68ae76a67 Allow the C++ toolchain config rules comparator script to not need toolchain_identifier argument when both --before and --after arguments are CToolchains (coming from Starlark rules instead of CROSSTOOL proto)
We don't need to select a toolchain by the identifier when we get the proto from Starlark rules because in that case the proto contains a single toolchain.
The difference in toolchain_identifier field between the first and the second proto file will be caught as any other field.

RELNOTES: None.
PiperOrigin-RevId: 262543753
Change-Id: I1e66ee302bf551ade883c217f6269f44382393c0
2019-08-09 05:43:22 -07:00
Googler b7fe9697c0 C++: Add two more rules to defs.bzl in rules_cc
These rules are in bazel_tools.

RELNOTES:none
PiperOrigin-RevId: 259298756
Change-Id: I9ed4b8f3cd712adc889a950765c96b5b68a5d43c
2019-07-22 04:17:22 -07:00
Googler 555d034dbf C++: Add defs.bzl to genproto.bzl
RELNOTES:
PiperOrigin-RevId: 258767676
Change-Id: I72c1a4b10daa62c996472b4ed03659bc2ae99d48
2019-07-18 07:40:49 -07:00
Googler 438368b58b Automated rollback of commit a34fafd5f5.
*** Reason for rollback ***

Rolling back. No time before 1.0.

*** Original change description ***

C++: Move tools/cpp from bazel_tools to rules_cc

Here we are duplicating bazel_tools/tools/cpp. The goal is for the BUILD files in bazel_tools/tools/cpp to have an alias that point to rules_cc. Then later on with the incompatible flag these aliases will no longer be valid.

Working towards #8743

RELNOTES:none
PiperOrigin-RevId: 258756552
Change-Id: Ia44c0b5084ed9b28efbf9058e3dc29696db86fac
2019-07-18 06:12:58 -07:00
Googler a34fafd5f5 C++: Move tools/cpp from bazel_tools to rules_cc
Here we are duplicating bazel_tools/tools/cpp. The goal is for the BUILD files in bazel_tools/tools/cpp to have an alias that point to rules_cc. Then later on with the incompatible flag these aliases will no longer be valid.

Working towards #8743

RELNOTES:none
PiperOrigin-RevId: 258344117
Change-Id: I5c0ffb1c7b501facabb543ad57440ea067ab3d34
2019-07-16 04:57:31 -07:00
oquenchil 03e7a77edc Adds load statement for @rules_cc
This is in preparation for --incompatible_load_cc_rules_from_bzl

Closes #8744.

PiperOrigin-RevId: 256969979
Change-Id: I4f73790b9204156a5380e97e6bda70e2066d04a7
2019-07-08 07:01:57 -07:00
Copybara-Service 31b9de3cbf Merge pull request #23 from hlopko:fix_skylib
PiperOrigin-RevId: 255620253
Change-Id: I581657a0e29e0fe5e30c8da6fd7d4ad979d173d3
2019-06-28 10:03:31 -07:00
Marcel Hlopko ec70973809 Fix sha hash of the skylib release, and put mirror first
I have no clue what happened, but it seems skylib release on github was
changed after rules_cc started to depend on it.
2019-06-28 18:46:43 +02:00
Copybara-Service 74019302a4 Merge pull request #21 from excitoon:patch-1
PiperOrigin-RevId: 255562043
Change-Id: I6b744cfcdac6578e860ad3e1a48f374e494d37bc
2019-06-28 01:56:05 -07:00
Googler 0d5f3f2768 C++: Adds macros for wrapping C++ rules.
See: https://docs.google.com/document/d/1PgCYKVUBpFA0ZXTHTgHhUiLGgTRPloxKJ2d2t47TNo4/edit?usp=sharing

RELNOTES:none
PiperOrigin-RevId: 255411415
Change-Id: I319fac86118d051644a19422d1f474bec2538774
2019-06-27 09:00:21 -07:00
Vladimir Chebotarev 4afc266bf0
Placed GitHub release first for @skylib.
See bazelbuild/bazel-skylib#164.
2019-06-27 13:51:21 +03:00
Googler d36c8d400c Refactor rules_cc to follow https://docs.bazel.build/versions/master/skylark/deploying.html
RELNOTES: None.
PiperOrigin-RevId: 253736769
Change-Id: Ib13ecb077559f890aa3cc207b7ec1a53ac18d553
2019-06-18 00:21:44 -07:00
Googler dfd3d3408e Update Slack link to use slack.bazel.build
PiperOrigin-RevId: 253354235
Change-Id: I9006e6ab21dbe26340a6fc0ee8202474c6282bd8
2019-06-14 23:38:22 -07:00
Copybara-Service e354fc37dc Merge pull request #19 from renovate-bot:renovate/io_bazel_rules_go-0.x
PiperOrigin-RevId: 253206234
Change-Id: I565fc794f6974839c15a5e6c7e435591552f862c
2019-06-14 04:37:25 -07:00
Renovate Bot c1b466c767
Update dependency io_bazel_rules_go to v0.18.6 2019-06-12 17:23:28 +00:00
Copybara-Service 236c6eb75c Merge pull request #17 from hlopko:add_find_cc_toolchain
PiperOrigin-RevId: 250229272
Change-Id: Id5cd1bfa65b53a54c6443a661337d5dcdcfed2e3
2019-05-28 00:50:32 -07:00
Marcel Hlopko d991801638 Add find_cc_toolchain.bzl to help accessing current C++ toolchain
This is to help migrating for:

* https://github.com/bazelbuild/bazel/issues/7260
* https://github.com/bazelbuild/bazel/issues/7643

It's mostly a copy of the file in
`@bazel_tools//tools/cpp:toolchain_utils.bzl`, with a small difference -
it depends on `@rules_cc//cc:toolchain_type`, not on
`@bazel_tools//tools/cpp:toolchain_type`.
2019-05-27 10:47:06 +02:00
Copybara-Service 1ef290f596 Merge pull request #16 from hlopko:alias_toolchain_type
PiperOrigin-RevId: 250112515
Change-Id: Id5d4e4b74f11fd2060e2e564a0da9fd7fc217e3b
2019-05-27 01:08:13 -07:00
Marcel Hlopko e283f126b5 Add //cc:toolchain_type alias to allow forward migration with Bazel 0.27
This target will eventually be the canonical place for C++ toolchain
type. Currently the actual target resides in @bazel_tools, but that will
soon change.
2019-05-27 09:09:16 +02:00
Copybara-Service 96eb170c6e Merge pull request #15 from hlopko:fix_examples_for_platforms
PiperOrigin-RevId: 249821791
Change-Id: I61b10b87731a9f5a892c58b8ea4c7158e35a943e
2019-05-24 06:17:43 -07:00
Marcel Hlopko 6cd7e75fc4 Update examples for platforms 2019-05-24 14:52:19 +02:00
Googler f25bda7e0d Internal change
PiperOrigin-RevId: 249460768
Change-Id: Ie2d02f0245492230c7a116a3b5acc92b759e73d8
2019-05-22 09:15:39 -07:00
Googler eeec015f3e Update rules_cc for --incompatible_enable_cc_toolchain_resolution
[Copybara import of https://github.com/bazelbuild/rules_cc/pull/14]

https://github.com/bazelbuild/bazel/issues/7260
Merge 3e6d3b9a4a into b308aae57f

PiperOrigin-RevId: 248296402
2019-05-15 02:19:39 -07:00
hlopko b308aae57f Add ctx argument to cc_common.configure_features
In order to migrate C++ rules to platforms, we need the access to the C++
configuration fragment in Starlark APIs. All existing APIs have already access
to it, but cc_common.configure_features doesn't. This change adds a
ctx argument to configure_features.

This is the migration needed for
https://github.com/bazelbuild/bazel/issues/7793, and is part of the effort for
https://github.com/bazelbuild/bazel/issues/6516.

If the rule doesn't depend on cpp fragment yet, you will have to add `fragments
=['cpp']` argument to the rule() call.

Note that this behavior is only available in Bazel 0.25 (to be released this month).

RELNOTES: None.
PiperOrigin-RevId: 247171967
2019-05-08 01:46:21 -07:00