Skip to content

Commit 6d90aa4

Browse files
authored
Run buildifier on BUILD files, .bzl files, WORKSPACE (#29)
1 parent 22f4f7e commit 6d90aa4

File tree

8 files changed

+110
-90
lines changed

8 files changed

+110
-90
lines changed

WORKSPACE

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,18 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")
22

33
http_file(
44
name = "emacs",
5-
urls = ["https://mirror.its.dal.ca/gnu/emacs/emacs-28.1.tar.gz",
6-
"https://mirrors.kernel.org/gnu/emacs/emacs-28.1.tar.gz"],
7-
sha256 = "1439bf7f24e5769f35601dbf332e74dfc07634da6b1e9500af67188a92340a28"
5+
sha256 = "1439bf7f24e5769f35601dbf332e74dfc07634da6b1e9500af67188a92340a28",
6+
urls = [
7+
"https://mirror.its.dal.ca/gnu/emacs/emacs-28.1.tar.gz",
8+
"https://mirrors.kernel.org/gnu/emacs/emacs-28.1.tar.gz",
9+
],
810
)
911

1012
http_file(
1113
name = "ubuntu_20.04_1.3GB",
12-
urls = ["https://mirror.math.princeton.edu/pub/ubuntu-iso/focal/ubuntu-20.04.4-live-server-amd64.iso",
13-
"https://mirror.pit.teraswitch.com/ubuntu-releases/focal/ubuntu-20.04.4-live-server-amd64.iso"],
14-
sha256 = "28ccdb56450e643bad03bb7bcf7507ce3d8d90e8bf09e38f6bd9ac298a98eaad"
14+
sha256 = "28ccdb56450e643bad03bb7bcf7507ce3d8d90e8bf09e38f6bd9ac298a98eaad",
15+
urls = [
16+
"https://mirror.math.princeton.edu/pub/ubuntu-iso/focal/ubuntu-20.04.4-live-server-amd64.iso",
17+
"https://mirror.pit.teraswitch.com/ubuntu-releases/focal/ubuntu-20.04.4-live-server-amd64.iso",
18+
],
1519
)

cpp/BUILD

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
cc_binary(
2-
name = "cpp",
3-
srcs = ["main.cc"],
2+
name = "cpp",
3+
srcs = ["main.cc"],
44
)

docker/network/BUILD

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
# TODO: edit this value to match your Docker registry, image name, and digest
1717
DOCKER_JDK_PSQL = "docker://gcr.io/YOUR-IMAGE-NAME@sha256:b6ed8f68abd6e23409ee7a500c2c50a8064cea11071ac447a59b88e6afa4c220"
1818

19-
2019
java_test(
2120
name = "docker-network-test",
2221
srcs = ["DockerNetworkTest.java"],

docker/sandbox/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ genrule(
88
[genrule(
99
name = "dep%d" % i,
1010
outs = ["dep%d.txt" % i],
11-
target_compatible_with = ["@platforms//os:linux"],
1211
cmd = "(echo hello %d ; echo \"inside docker: $$(cat /proc/1/cgroup | grep -Eq 'docker|lxc' && echo yes || echo no)\" ; echo \"host: $$(hostname)\" ; echo \"date: $$(date)\" ; echo) > $@" % i,
12+
target_compatible_with = ["@platforms//os:linux"],
1313
) for i in range(3)]
1414

1515
java_binary(

genrules/BUILD

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,33 +13,34 @@
1313
# limitations under the License.
1414
#
1515
# The following genrules are able to produce thousands of targets based
16-
# on the user's input.
16+
# on the user's input.
1717
# This can be used for stress testing your build infrastructure.
18-
# Change the upper bound of the range and enjoy!
18+
# Change the upper bound of the range and enjoy!
1919
UPPER_BOUND = 10
20+
2021
[genrule(
21-
name = "foo_TXT_4KB_" + str(x),
22-
outs = ["foo_text" + str(x) + ".txt"],
23-
cmd = "echo 'Hello engflow world' > $@",
24-
) for x in range(1,UPPER_BOUND)]
22+
name = "foo_TXT_4KB_" + str(x),
23+
outs = ["foo_text" + str(x) + ".txt"],
24+
cmd = "echo 'Hello engflow world' > $@",
25+
) for x in range(1, UPPER_BOUND)]
2526

2627
[genrule(
27-
name = "gnu-manifesto_PDF_76KB" + str(x),
28-
outs = ["gnu-manifesto" + str(x) + ".pdf"],
29-
cmd = "cp $(location gnu-manifesto.pdf) $@",
30-
tools = ["gnu-manifesto.pdf"]
31-
) for x in range(1,UPPER_BOUND)]
28+
name = "gnu-manifesto_PDF_76KB" + str(x),
29+
outs = ["gnu-manifesto" + str(x) + ".pdf"],
30+
cmd = "cp $(location gnu-manifesto.pdf) $@",
31+
tools = ["gnu-manifesto.pdf"],
32+
) for x in range(1, UPPER_BOUND)]
3233

3334
[genrule(
34-
name = "emacs_TARGZ_68MB" + str(x),
35-
outs = ["emacs" + str(x) + ".tar.gz"],
36-
cmd = "cp $(location @emacs//file) $@",
37-
tools = ["@emacs//file"]
38-
) for x in range(1,UPPER_BOUND)]
35+
name = "emacs_TARGZ_68MB" + str(x),
36+
outs = ["emacs" + str(x) + ".tar.gz"],
37+
cmd = "cp $(location @emacs//file) $@",
38+
tools = ["@emacs//file"],
39+
) for x in range(1, UPPER_BOUND)]
3940

4041
[genrule(
41-
name = "ubuntu_20.04_1.3GB" + str(x),
42-
outs = ["ubuntu_20.04_1.3GB" + str(x) + ".iso"],
43-
cmd = "cp $(location @ubuntu_20.04_1.3GB//file) $@",
44-
tools = ["@ubuntu_20.04_1.3GB//file"]
45-
) for x in range(1,2)]
42+
name = "ubuntu_20.04_1.3GB" + str(x),
43+
outs = ["ubuntu_20.04_1.3GB" + str(x) + ".iso"],
44+
cmd = "cp $(location @ubuntu_20.04_1.3GB//file) $@",
45+
tools = ["@ubuntu_20.04_1.3GB//file"],
46+
) for x in range(1, 2)]

java/com/engflow/example/BUILD

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
package(default_visibility = ["//visibility:public"])
22

33
java_library(
4-
name = "example",
5-
srcs = glob(["Example.java"]),
4+
name = "example",
5+
srcs = glob(["Example.java"]),
66
)
77

88
java_test(
9-
name = "ExampleTest",
10-
srcs = glob(["ExampleTest.java"]),
11-
deps = [":example"],
9+
name = "ExampleTest",
10+
srcs = glob(["ExampleTest.java"]),
11+
deps = [":example"],
1212
)

remote_config/cc/BUILD

Lines changed: 69 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ filegroup(
3838

3939
filegroup(
4040
name = "compiler_deps",
41-
srcs = glob(["extra_tools/**"], allow_empty = True) + [":builtin_include_directory_paths"],
41+
srcs = glob(
42+
["extra_tools/**"],
43+
allow_empty = True,
44+
) + [":builtin_include_directory_paths"],
4245
)
4346

4447
# This is the entry point for --crosstool_top. Toolchains are found
@@ -56,40 +59,75 @@ cc_toolchain_suite(
5659

5760
cc_toolchain(
5861
name = "cc-compiler-k8",
59-
toolchain_identifier = "linux_gnu_x86",
60-
toolchain_config = ":linux_gnu_x86",
6162
all_files = ":compiler_deps",
6263
ar_files = ":compiler_deps",
6364
as_files = ":compiler_deps",
6465
compiler_files = ":compiler_deps",
6566
dwp_files = ":empty",
6667
linker_files = ":compiler_deps",
68+
module_map = ":module.modulemap",
6769
objcopy_files = ":empty",
6870
strip_files = ":empty",
6971
supports_param_files = 1,
70-
module_map = ":module.modulemap",
72+
toolchain_config = ":linux_gnu_x86",
73+
toolchain_identifier = "linux_gnu_x86",
7174
)
7275

7376
cc_toolchain_config(
7477
name = "linux_gnu_x86",
75-
cpu = "k8",
78+
abi_libc_version = "glibc_2.19",
79+
abi_version = "clang",
80+
compile_flags = [
81+
"-U_FORTIFY_SOURCE",
82+
"-fstack-protector",
83+
"-Wall",
84+
"-Wthread-safety",
85+
"-Wself-assign",
86+
"-fcolor-diagnostics",
87+
"-fno-omit-frame-pointer",
88+
],
7689
compiler = "clang",
77-
toolchain_identifier = "linux_gnu_x86",
90+
coverage_compile_flags = ["--coverage"],
91+
coverage_link_flags = ["--coverage"],
92+
cpu = "k8",
93+
cxx_builtin_include_directories = [
94+
"/usr/local/include",
95+
"/usr/lib/llvm-10/lib/clang/10.0.0/include",
96+
"/usr/include/x86_64-linux-gnu",
97+
"/usr/include",
98+
"/usr/lib/llvm-10/lib/clang/10.0.0/share",
99+
"/usr/include/c++/9",
100+
"/usr/include/x86_64-linux-gnu/c++/9",
101+
"/usr/include/c++/9/backward",
102+
"/usr/lib/llvm-10/include/c++/v1",
103+
],
104+
cxx_flags = ["-std=c++0x"],
105+
dbg_compile_flags = ["-g"],
78106
host_system_name = "i686-unknown-linux-gnu",
79-
target_system_name = "x86_64-unknown-linux-gnu",
107+
link_flags = [
108+
"-fuse-ld=/usr/bin/ld.gold",
109+
"-Wl,-no-as-needed",
110+
"-Wl,-z,relro,-z,now",
111+
"-B/usr/lib/llvm-10/bin",
112+
],
113+
link_libs = [
114+
"-lstdc++",
115+
"-lm",
116+
],
117+
opt_compile_flags = [
118+
"-g0",
119+
"-O2",
120+
"-D_FORTIFY_SOURCE=1",
121+
"-DNDEBUG",
122+
"-ffunction-sections",
123+
"-fdata-sections",
124+
],
125+
opt_link_flags = ["-Wl,--gc-sections"],
126+
supports_start_end_lib = True,
80127
target_libc = "glibc_2.19",
81-
abi_version = "clang",
82-
abi_libc_version = "glibc_2.19",
83-
cxx_builtin_include_directories = ["/usr/local/include",
84-
"/usr/lib/llvm-10/lib/clang/10.0.0/include",
85-
"/usr/include/x86_64-linux-gnu",
86-
"/usr/include",
87-
"/usr/lib/llvm-10/lib/clang/10.0.0/share",
88-
"/usr/include/c++/9",
89-
"/usr/include/x86_64-linux-gnu/c++/9",
90-
"/usr/include/c++/9/backward",
91-
"/usr/lib/llvm-10/include/c++/v1"],
92-
tool_paths = {"ar": "/usr/bin/ar",
128+
target_system_name = "x86_64-unknown-linux-gnu",
129+
tool_paths = {
130+
"ar": "/usr/bin/ar",
93131
"ld": "/usr/bin/ld",
94132
"llvm-cov": "/usr/bin/llvm-cov",
95133
"cpp": "/usr/bin/cpp",
@@ -99,44 +137,21 @@ cc_toolchain_config(
99137
"nm": "/usr/bin/nm",
100138
"objcopy": "/usr/bin/objcopy",
101139
"objdump": "/usr/bin/objdump",
102-
"strip": "/usr/bin/strip"},
103-
compile_flags = ["-U_FORTIFY_SOURCE",
104-
"-fstack-protector",
105-
"-Wall",
106-
"-Wthread-safety",
107-
"-Wself-assign",
108-
"-fcolor-diagnostics",
109-
"-fno-omit-frame-pointer"],
110-
opt_compile_flags = ["-g0",
111-
"-O2",
112-
"-D_FORTIFY_SOURCE=1",
113-
"-DNDEBUG",
114-
"-ffunction-sections",
115-
"-fdata-sections"],
116-
dbg_compile_flags = ["-g"],
117-
cxx_flags = ["-std=c++0x"],
118-
link_flags = ["-fuse-ld=/usr/bin/ld.gold",
119-
"-Wl,-no-as-needed",
120-
"-Wl,-z,relro,-z,now",
121-
"-B/usr/lib/llvm-10/bin"],
122-
link_libs = ["-lstdc++",
123-
"-lm"],
124-
opt_link_flags = ["-Wl,--gc-sections"],
125-
unfiltered_compile_flags = ["-no-canonical-prefixes",
126-
"-Wno-builtin-macro-redefined",
127-
"-D__DATE__=\"redacted\"",
128-
"-D__TIMESTAMP__=\"redacted\"",
129-
"-D__TIME__=\"redacted\""],
130-
coverage_compile_flags = ["--coverage"],
131-
coverage_link_flags = ["--coverage"],
132-
supports_start_end_lib = True,
140+
"strip": "/usr/bin/strip",
141+
},
142+
toolchain_identifier = "linux_gnu_x86",
143+
unfiltered_compile_flags = [
144+
"-no-canonical-prefixes",
145+
"-Wno-builtin-macro-redefined",
146+
"-D__DATE__=\"redacted\"",
147+
"-D__TIMESTAMP__=\"redacted\"",
148+
"-D__TIME__=\"redacted\"",
149+
],
133150
)
134151

135152
# Android tooling requires a default toolchain for the armeabi-v7a cpu.
136153
cc_toolchain(
137154
name = "cc-compiler-armeabi-v7a",
138-
toolchain_identifier = "stub_armeabi-v7a",
139-
toolchain_config = ":stub_armeabi-v7a",
140155
all_files = ":empty",
141156
ar_files = ":empty",
142157
as_files = ":empty",
@@ -146,6 +161,8 @@ cc_toolchain(
146161
objcopy_files = ":empty",
147162
strip_files = ":empty",
148163
supports_param_files = 1,
164+
toolchain_config = ":stub_armeabi-v7a",
165+
toolchain_identifier = "stub_armeabi-v7a",
149166
)
150167

151168
armeabi_cc_toolchain_config(name = "stub_armeabi-v7a")

remote_config/config/BUILD

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
package(default_visibility = ["//visibility:public"])
1919

20-
2120
toolchain(
2221
name = "cc-toolchain",
2322
exec_compatible_with = [
@@ -35,7 +34,6 @@ toolchain(
3534

3635
platform(
3736
name = "platform",
38-
parents = ["@local_config_platform//:host"],
3937
constraint_values = [
4038
"@bazel_tools//platforms:linux",
4139
"@bazel_tools//platforms:x86_64",
@@ -45,4 +43,5 @@ platform(
4543
"container-image": "docker://gcr.io/bazel-public/ubuntu2004-java11@sha256:69a78f121230c6d5cbfe2f4af8ce65481aa3f2acaaaf8e899df335f1ac1b35b5",
4644
"OSFamily": "Linux",
4745
},
46+
parents = ["@local_config_platform//:host"],
4847
)

0 commit comments

Comments
 (0)