Commit Graph

25 Commits

Author SHA1 Message Date
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
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
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
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 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
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 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 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
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
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
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
Googler 9667b3dd9a .../BUILD: fix build file/module bugs (#18)
Change this pattern
    if foo [not] in native.existing_rules():
to
    if [not] native.existing_rule(foo):
for efficiency.

PiperOrigin-RevId: 241954724
2019-04-04 10:25:18 -07:00
Googler 951df6a496 Add skylib dependency
[Copybara import of https://github.com/bazelbuild/rules_cc/pull/10]

Skylib will be used to check minimum supported Bazel version.
Merge 2e5b5eb2d0 into 3723b4c35f

PiperOrigin-RevId: 240725578
2019-03-28 00:52:17 -07:00
hlopko 17818b2501 Add initial content of rules_cc repo
RELNOTES: None.
PiperOrigin-RevId: 227846116
2019-01-09 08:58:14 +01:00