Commit Graph

344 Commits

Author SHA1 Message Date
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
Googler f678ef5279 Automatic code cleanup.
PiperOrigin-RevId: 245027760
2019-04-24 05:30:15 -07:00
philwo 9e7c9de880 Add http_archive entries for testing with various JDK versions.
RELNOTES: None.
PiperOrigin-RevId: 245023756
2019-04-24 04:54:39 -07:00
philwo a4c4f3aa88 Don't test on Ubuntu 14.04.
Ubuntu 14.04 is about to be end-of-life and Bazel CI will stop supporting it shortly afterwards.

Context: https://groups.google.com/d/msg/bazel-dev/_D6XzfNkQQE/8TNKiNmsCAAJ
PiperOrigin-RevId: 245015462
2019-04-24 03:19:08 -07: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
Googler 3723b4c35f Update rules_go to 0.18.1
[Copybara import of https://github.com/bazelbuild/rules_cc/pull/9]

Merge 6181c870fc into 2312d72134

PiperOrigin-RevId: 240145582
2019-03-25 08:39:10 -07:00
Googler e86b282e6f Update protobuf to the latest release (3.7.0)
[Copybara import of https://github.com/bazelbuild/rules_cc/pull/8]

Because of https://github.com/protocolbuffers/protobuf/issues/5918 we
cannot use protobuf_deps() just yet. At least we can use the zlib.BUILD
file from their examples.

Fixes https://github.com/bazelbuild/rules_cc/issues/6
Merge 9bb624f3c8 into 2312d72134

PiperOrigin-RevId: 240091300
2019-03-25 01:00:32 -07:00
rosica 2312d72134 Fix allowed values in 'compiler' attribute of cc_toolchain_config rule.
When cpu value is not enough to distinguish between two toolchains, we use the compiler value. In that case, the user needs to specify the compiler value for all cc_toolchain_config rules, even for the ones with unique cpu. This cl fixes the allowed values in the compiler attribute to account for the values from unique toolchains.

Issue #5380
RELNOTES: None.
PiperOrigin-RevId: 239396228
2019-03-20 07:55:12 -07:00
rosica 943183cae8 Fix load("//tools/cpp:cc_toolchain_config_lib.bzl") to load("@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl")
And add a test checking the full output from the migrator for a simple CROSSTOOL.

Issue #5380
RELNOTES: None.
PiperOrigin-RevId: 239153961
2019-03-19 02:46:26 -07:00
rosica 3b89ccfbe7 Remove linter warnings that a feature or action_config may not be declared by setting it to None instead.
Also rename the rule from cc_toolchain_config_rule to cc_toolchain_config

Issue #5380

RELNOTES: None.
PiperOrigin-RevId: 238945434
2019-03-18 01:50:26 -07:00
hlopko 0c017ebc6d Do not condition linker_flags from DYNAMIC linking_mode_flags for transitive dynamic libraries on dynamic_linking_mode feature
https://github.com/bazelbuild/bazel/issues/6861

RELNOTES: None.
PiperOrigin-RevId: 238941083
2019-03-18 01:04:18 -07:00
hlopko 10f38e16da Fix migrator to correctly migrate dynamic linking mode linker_flags
This would have not introduced the osx crosstool bug in 2d0e27e8bc which was then fixed in unknown commit.

RELNOTES: None.
PiperOrigin-RevId: 238699176
2019-03-15 13:25:11 -07:00
hlopko b844e0c4b8 Replace scrubbing with copybara-comment-this-out-please in copybara
This will make sure the copybara export is reversible, which is needed for setting up copybara workflow for importing github PRs.

RELNOTES: None.
PiperOrigin-RevId: 238445502
2019-03-14 17:13:28 +01:00
hlopko 7a628f3387 Make python scripts consistent with ctoolchain_comparator
This will simplify copybara export logic.

RELNOTES: None.
PiperOrigin-RevId: 238396543
2019-03-14 17:12:55 +01:00
hlopko 475ed28215 Automated rollback of commit a613d78865.
*** Reason for rollback ***

And now rolling forward because apparently ospo approved renovate.

*** Original change description ***

Automated rollback of commit 776b274c8a.

*** Reason for rollback ***

Because they use agpl licence.

*** Original change description ***

Enable 'renovate' bot for rules_cc

Fixes https://github.com/bazelbuild/rules_cc/pull/5.

RELNOTES: None.
PiperOrigin-RevId: 237213545
2019-03-07 02:55:44 -08:00
hlopko 0b8e7b5940 Use is_using_fission in legacy_fields_migrator
Since unknown commit is submitted, the principled variable to use in per_object_debug_info is is_using_fission, not per_object_debug_info_file (in case of thinlto build, the former is present also for thinlto bitcode compile, the latter only for backend compile).

RELNOTES: None.
PiperOrigin-RevId: 237192121
2019-03-07 00:02:00 -08:00
Googler 2d3bc12294 Remove duplication of feature_configuration
RELNOTES: None.
PiperOrigin-RevId: 236652129
2019-03-04 07:53:44 -08:00
hlopko e12b276bc7 Fix issue template
RELNOTES: None.
PiperOrigin-RevId: 235876964
2019-02-27 01:37:03 -08:00
hlopko 3d5980e5cb Add example writing custom rule that depends and is dependable from rules_cc
RELNOTES: None.
PiperOrigin-RevId: 235869541
2019-02-27 00:37:05 -08:00
hlopko a613d78865 Automated rollback of commit 776b274c8a.
*** Reason for rollback ***

Because they use agpl licence.

*** Original change description ***

Enable 'renovate' bot for rules_cc

Fixes https://github.com/bazelbuild/rules_cc/pull/5.

RELNOTES: None.
PiperOrigin-RevId: 235746738
2019-02-26 10:28:17 -08:00
hlopko a68eaadfed List places to ask questions for rules_cc
RELNOTES: None.
PiperOrigin-RevId: 235702390
2019-02-26 05:11:07 -08:00
hlopko d08a69a7bd Let's see if this fixes issue template
RELNOTES: None.
PiperOrigin-RevId: 235700492
2019-02-26 04:55:08 -08:00
hlopko b099c8dd38 Add default issue template for rules_cc
RELNOTES: None.
PiperOrigin-RevId: 235695323
2019-02-26 04:02:29 -08:00
hlopko 776b274c8a Enable 'renovate' bot for rules_cc
Fixes https://github.com/bazelbuild/rules_cc/pull/5.

RELNOTES: None.
PiperOrigin-RevId: 235694213
2019-02-26 03:50:12 -08:00
cushon 64efe1299e Automated rollback of commit 2e79abf8ca.
PiperOrigin-RevId: 234756779
2019-02-20 01:41:00 -08:00
hlopko 7e835b273a Clear dynamic_library_linker_flag in legacy_fields_migrator
RELNOTES: None.
PiperOrigin-RevId: 234748020
2019-02-20 00:25:12 -08:00
hlopko 2e79abf8ca Flip --incompatible_disable_expand_if_all_available_in_flag_set
FlagSets in the CROSSTOOL no longer accept expand_if_all_available field

Fixes #7008

RELNOTES: `--incompatible_disable_expand_if_all_available_in_flag_set` has been flipped (https://github.com/bazelbuild/bazel/issues/7008)
PiperOrigin-RevId: 234466411
2019-02-18 05:16:18 -08:00