Skip to content

Commit

Permalink
Fix buildifier warnings in @rules_cc
Browse files Browse the repository at this point in the history
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
  • Loading branch information
hlopko authored and copybara-github committed Oct 24, 2019
1 parent 56babb6 commit 1a25668
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions tools/cpp/BUILD.empty
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ cc_toolchain_suite(

cc_toolchain(
name = "local",
toolchain_identifier = "local",
toolchain_config = ":local_config",
all_files = ":empty",
ar_files = ":empty",
as_files = ":empty",
Expand All @@ -45,6 +43,8 @@ cc_toolchain(
linker_files = ":empty",
objcopy_files = ":empty",
strip_files = ":empty",
toolchain_config = ":local_config",
toolchain_identifier = "local",
)

cc_toolchain_config(name = "local_config")
8 changes: 4 additions & 4 deletions tools/cpp/BUILD.static.freebsd
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ cc_toolchain_suite(

cc_toolchain(
name = "cc-compiler-freebsd",
toolchain_identifier = "local_freebsd",
toolchain_config = ":local_freebsd",
all_files = ":empty",
ar_files = ":empty",
as_files = ":empty",
Expand All @@ -52,6 +50,8 @@ cc_toolchain(
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 0,
toolchain_config = ":local_freebsd",
toolchain_identifier = "local_freebsd",
)

cc_toolchain_config(
Expand All @@ -75,8 +75,6 @@ toolchain(

cc_toolchain(
name = "cc-compiler-armeabi-v7a",
toolchain_identifier = "stub_armeabi-v7a",
toolchain_config = ":stub_armeabi-v7a",
all_files = ":empty",
ar_files = ":empty",
as_files = ":empty",
Expand All @@ -86,6 +84,8 @@ cc_toolchain(
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 0,
toolchain_config = ":stub_armeabi-v7a",
toolchain_identifier = "stub_armeabi-v7a",
)

cc_toolchain_config(
Expand Down
2 changes: 1 addition & 1 deletion tools/cpp/BUILD.toolchains.tpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
load("@local_config_platform//:constraints.bzl", "HOST_CONSTRAINTS")

toolchain(
name = "cc-toolchain-%{name}",
exec_compatible_with = HOST_CONSTRAINTS,
Expand All @@ -17,4 +18,3 @@ toolchain(
toolchain = "@local_config_cc//:cc-compiler-armeabi-v7a",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)

1 change: 0 additions & 1 deletion tools/cpp/osx_cc_configure.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ load(
load(
"@bazel_tools//tools/cpp:unix_cc_configure.bzl",
"configure_unix_toolchain",
"find_cc",
"get_env",
"get_escaped_cxx_inc_directories",
)
Expand Down

0 comments on commit 1a25668

Please sign in to comment.