Skip to content

Commit c3c9b3f

Browse files
committed
Merge branch 'bazel-dialyze'
2 parents 761af0a + 30f9a95 commit c3c9b3f

File tree

47 files changed

+491
-36
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+491
-36
lines changed

BUILD.bazel

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
load("@bazel-erlang//:dialyze.bzl", "plt")
12
load("elixir_home.bzl", "elixir_home")
23
load(":rabbitmq_home.bzl", "rabbitmq_home")
34
load(":rabbitmq_run.bzl", "rabbitmq_run", "rabbitmq_run_command")
@@ -42,6 +43,11 @@ platform(
4243
},
4344
)
4445

46+
plt(
47+
name = "base_plt",
48+
visibility = ["//visibility:public"],
49+
)
50+
4551
rabbitmq_home(
4652
name = "broker-home",
4753
plugins = [

deps/amqp10_client/BUILD.bazel

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
load("@bazel-erlang//:xref.bzl", "xref")
2+
load("@bazel-erlang//:dialyze.bzl", "dialyze", "plt")
23
load("@bazel-erlang//:ct.bzl", "ct_suite")
34
load("//:rabbitmq_home.bzl", "rabbitmq_home")
45
load("//:rabbitmq_run.bzl", "rabbitmq_run")
@@ -40,6 +41,17 @@ rabbitmq_lib(
4041

4142
xref(tags = ["xref"])
4243

44+
plt(
45+
name = "base_plt",
46+
apps = EXTRA_APPS,
47+
plt = "//:base_plt",
48+
)
49+
50+
dialyze(
51+
plt = ":base_plt",
52+
tags = ["dialyze"],
53+
)
54+
4355
rabbitmq_suite(
4456
name = "msg_SUITE",
4557
deps = DEPS,

deps/amqp10_common/BUILD.bazel

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ load(
55
"erlc",
66
)
77
load("@bazel-erlang//:xref.bzl", "xref")
8+
load("@bazel-erlang//:dialyze.bzl", "dialyze")
89
load("@bazel-erlang//:ct.bzl", "ct_suite")
910
load(
1011
"//:rabbitmq.bzl",
@@ -92,6 +93,11 @@ bazel_erlang_lib(
9293

9394
xref(tags = ["xref"])
9495

96+
dialyze(
97+
plt = "//:base_plt",
98+
tags = ["dialyze"],
99+
)
100+
95101
ct_suite(
96102
name = "binary_generator_SUITE",
97103
erlc_opts = RABBITMQ_TEST_ERLC_OPTS,

deps/amqp_client/BUILD.bazel

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
load("@bazel-erlang//:xref.bzl", "xref")
2+
load("@bazel-erlang//:dialyze.bzl", "dialyze", "plt")
23
load("@bazel-erlang//:ct.bzl", "ct_suite")
34
load("//:rabbitmq_home.bzl", "rabbitmq_home")
45
load("//:rabbitmq_run.bzl", "rabbitmq_run")
@@ -15,6 +16,10 @@ APP_ENV = """[
1516
{writer_gc_threshold, 1000000000}
1617
]"""
1718

19+
EXTRA_APPS = [
20+
"xmerl",
21+
]
22+
1823
DEPS = [
1924
"//deps/rabbit_common:bazel_erlang_lib",
2025
]
@@ -27,9 +32,7 @@ rabbitmq_lib(
2732
app_registered = [
2833
"amqp_sup",
2934
],
30-
extra_apps = [
31-
"xmerl",
32-
],
35+
extra_apps = EXTRA_APPS,
3336
first_srcs = [
3437
"src/amqp_gen_connection.erl",
3538
"src/amqp_gen_consumer.erl",
@@ -39,6 +42,17 @@ rabbitmq_lib(
3942

4043
xref(tags = ["xref"])
4144

45+
plt(
46+
name = "base_plt",
47+
apps = EXTRA_APPS,
48+
plt = "//:base_plt",
49+
)
50+
51+
dialyze(
52+
plt = ":base_plt",
53+
tags = ["dialyze"],
54+
)
55+
4256
rabbitmq_home(
4357
name = "broker-for-tests-home",
4458
plugins = [

deps/rabbit/BUILD.bazel

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
load("@bazel-erlang//:bazel_erlang_lib.bzl", "erlc")
22
load("@bazel-erlang//:xref.bzl", "xref")
3+
load("@bazel-erlang//:dialyze.bzl", "dialyze", "plt")
34
load("//:rabbitmq_home.bzl", "rabbitmq_home")
45
load("//:rabbitmq_run.bzl", "rabbitmq_run")
56
load(
67
"//:rabbitmq.bzl",
8+
"RABBITMQ_DIALYZER_OPTS",
79
"RABBITMQ_ERLC_OPTS",
810
"RABBITMQ_TEST_ERLC_OPTS",
911
"rabbitmq_integration_suite",
@@ -206,6 +208,24 @@ rabbitmq_lib(
206208

207209
xref(tags = ["xref"])
208210

211+
plt_apps = [
212+
"mnesia",
213+
] + EXTRA_APPS
214+
215+
plt_apps.remove("rabbitmq_prelaunch")
216+
217+
plt(
218+
name = "base_plt",
219+
apps = plt_apps,
220+
plt = "//:base_plt",
221+
)
222+
223+
dialyze(
224+
dialyzer_opts = RABBITMQ_DIALYZER_OPTS,
225+
plt = ":base_plt",
226+
tags = ["dialyze"],
227+
)
228+
209229
bats(
210230
srcs = glob(["test/**/*.bats"]),
211231
data = glob(
Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
load("@bazel-erlang//:bazel_erlang_lib.bzl", "erlang_lib", "test_erlang_lib")
2-
load("@bazel-erlang//:ct.bzl", "ct_suite")
3-
load("//:rabbitmq.bzl", "APP_VERSION")
1+
load("@bazel-erlang//:xref.bzl", "xref")
2+
load("@bazel-erlang//:dialyze.bzl", "dialyze")
3+
load("//:rabbitmq.bzl", "APP_VERSION", "rabbitmq_lib", "rabbitmq_suite")
44

55
APP_NAME = "rabbitmq_prelaunch"
66

@@ -9,31 +9,35 @@ APP_DESCRIPTION = "RabbitMQ prelaunch setup"
99
APP_MODULE = "rabbit_prelaunch_app"
1010

1111
RUNTIME_DEPS = [
12+
"@cuttlefish//:bazel_erlang_lib",
1213
"@jsx//:bazel_erlang_lib",
1314
]
1415

15-
erlang_lib(
16+
DEPS = [
17+
"//deps/rabbit_common:bazel_erlang_lib",
18+
]
19+
20+
rabbitmq_lib(
1621
app_description = APP_DESCRIPTION,
1722
app_module = APP_MODULE,
1823
app_name = APP_NAME,
1924
app_version = APP_VERSION,
2025
runtime_deps = RUNTIME_DEPS,
21-
deps = [
22-
"//deps/rabbit_common:bazel_erlang_lib",
23-
],
26+
deps = DEPS,
2427
)
2528

26-
test_erlang_lib(
27-
app_description = APP_DESCRIPTION,
28-
app_module = APP_MODULE,
29-
app_name = APP_NAME,
30-
app_version = APP_VERSION,
31-
runtime_deps = RUNTIME_DEPS,
32-
deps = [
33-
"//deps/rabbit_common:test_bazel_erlang_lib",
29+
xref(
30+
additional_libs = [
31+
"@systemd//:bazel_erlang_lib",
3432
],
33+
tags = ["xref"],
34+
)
35+
36+
dialyze(
37+
plt = "//:base_plt",
38+
tags = ["dialyze"],
3539
)
3640

37-
ct_suite(
41+
rabbitmq_suite(
3842
name = "rabbit_logger_std_h_SUITE",
3943
)

deps/rabbit_common/BUILD.bazel

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
load("@bazel-erlang//:bazel_erlang_lib.bzl", "app_file", "bazel_erlang_lib", "erlc")
22
load("@bazel-erlang//:xref.bzl", "xref")
3+
load("@bazel-erlang//:dialyze.bzl", "dialyze", "plt")
34
load("@bazel-erlang//:ct.bzl", "ct_test")
45
load("//:rabbitmq.bzl", "APP_VERSION", "RABBITMQ_ERLC_OPTS", "RABBITMQ_TEST_ERLC_OPTS")
56

@@ -57,23 +58,25 @@ RUNTIME_DEPS = [
5758

5859
APP_NAME = "rabbit_common"
5960

61+
EXTRA_APPS = [
62+
"compiler",
63+
"crypto",
64+
"public_key",
65+
"sasl",
66+
"ssl",
67+
"syntax_tools",
68+
"tools",
69+
"xmerl",
70+
]
71+
6072
HDRS = glob(["include/*.hrl"]) + ["include/rabbit_framing.hrl"]
6173

6274
app_file(
6375
name = "app_file",
6476
app_description = "Modules shared by rabbitmq-server and rabbitmq-erlang-client",
6577
app_name = APP_NAME,
6678
app_version = APP_VERSION,
67-
extra_apps = [
68-
"compiler",
69-
"crypto",
70-
"public_key",
71-
"sasl",
72-
"ssl",
73-
"syntax_tools",
74-
"tools",
75-
"xmerl",
76-
],
79+
extra_apps = EXTRA_APPS,
7780
modules = [":beam_files"],
7881
deps = DEPS + RUNTIME_DEPS,
7982
)
@@ -166,6 +169,21 @@ bazel_erlang_lib(
166169

167170
xref(tags = ["xref"])
168171

172+
plt(
173+
name = "base_plt",
174+
apps = [
175+
"mnesia",
176+
"crypto",
177+
"ssl",
178+
] + EXTRA_APPS,
179+
plt = "//:base_plt",
180+
)
181+
182+
dialyze(
183+
plt = ":base_plt",
184+
tags = ["dialyze"],
185+
)
186+
169187
erlc(
170188
name = "rabbit_env_SUITE_beam_files",
171189
testonly = True,

deps/rabbitmq_amqp1_0/BUILD.bazel

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
load("@bazel-erlang//:xref.bzl", "xref")
2+
load("@bazel-erlang//:dialyze.bzl", "dialyze")
23
load(
34
"//:rabbitmq.bzl",
5+
"RABBITMQ_DIALYZER_OPTS",
46
"broker_for_integration_suites",
57
"rabbitmq_integration_suite",
68
"rabbitmq_lib",
@@ -42,6 +44,12 @@ rabbitmq_lib(
4244

4345
xref(tags = ["xref"])
4446

47+
dialyze(
48+
dialyzer_opts = RABBITMQ_DIALYZER_OPTS,
49+
plt = "//:base_plt",
50+
tags = ["dialyze"],
51+
)
52+
4553
broker_for_integration_suites()
4654

4755
PACKAGE = "deps/rabbitmq_amqp1_0"

deps/rabbitmq_auth_backend_cache/BUILD.bazel

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
load("@bazel-erlang//:xref.bzl", "xref")
2+
load("@bazel-erlang//:dialyze.bzl", "dialyze")
23
load(
34
"//:rabbitmq.bzl",
5+
"RABBITMQ_DIALYZER_OPTS",
46
"broker_for_integration_suites",
57
"rabbitmq_integration_suite",
68
"rabbitmq_lib",
@@ -45,6 +47,12 @@ rabbitmq_lib(
4547

4648
xref(tags = ["xref"])
4749

50+
dialyze(
51+
dialyzer_opts = RABBITMQ_DIALYZER_OPTS,
52+
plt = "//:base_plt",
53+
tags = ["dialyze"],
54+
)
55+
4856
broker_for_integration_suites()
4957

5058
PACKAGE = "deps/rabbitmq_auth_backend_cache"

deps/rabbitmq_auth_backend_http/BUILD.bazel

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
load("@bazel-erlang//:xref.bzl", "xref")
2+
load("@bazel-erlang//:dialyze.bzl", "dialyze", "plt")
23
load("@bazel-erlang//:ct.bzl", "ct_suite")
34
load(
45
"//:rabbitmq.bzl",
6+
"RABBITMQ_DIALYZER_OPTS",
57
"broker_for_integration_suites",
68
"rabbitmq_integration_suite",
79
"rabbitmq_lib",
@@ -47,6 +49,18 @@ rabbitmq_lib(
4749

4850
xref(tags = ["xref"])
4951

52+
plt(
53+
name = "base_plt",
54+
apps = EXTRA_APPS,
55+
plt = "//:base_plt",
56+
)
57+
58+
dialyze(
59+
dialyzer_opts = RABBITMQ_DIALYZER_OPTS,
60+
plt = ":base_plt",
61+
tags = ["dialyze"],
62+
)
63+
5064
broker_for_integration_suites()
5165

5266
PACKAGE = "deps/rabbitmq_auth_backend_http"

deps/rabbitmq_auth_backend_ldap/BUILD.bazel

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
load("@bazel-erlang//:xref.bzl", "xref")
2+
load("@bazel-erlang//:dialyze.bzl", "dialyze", "plt")
23
load("//:rabbitmq_home.bzl", "rabbitmq_home")
34
load("//:rabbitmq_run.bzl", "rabbitmq_run")
45
load(
56
"//:rabbitmq.bzl",
7+
"RABBITMQ_DIALYZER_OPTS",
68
"broker_for_integration_suites",
79
"rabbitmq_integration_suite",
810
"rabbitmq_lib",
@@ -63,6 +65,18 @@ rabbitmq_lib(
6365

6466
xref(tags = ["xref"])
6567

68+
plt(
69+
name = "base_plt",
70+
apps = EXTRA_APPS,
71+
plt = "//:base_plt",
72+
)
73+
74+
dialyze(
75+
dialyzer_opts = RABBITMQ_DIALYZER_OPTS,
76+
plt = ":base_plt",
77+
tags = ["dialyze"],
78+
)
79+
6680
broker_for_integration_suites()
6781

6882
PACKAGE = "deps/rabbitmq_auth_backend_ldap"

deps/rabbitmq_auth_backend_oauth2/BUILD.bazel

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
load("@bazel-erlang//:bazel_erlang_lib.bzl", "erlc")
22
load("@bazel-erlang//:xref.bzl", "xref")
3+
load("@bazel-erlang//:dialyze.bzl", "dialyze")
34
load(
45
"//:rabbitmq.bzl",
6+
"RABBITMQ_DIALYZER_OPTS",
57
"RABBITMQ_TEST_ERLC_OPTS",
68
"broker_for_integration_suites",
79
"rabbitmq_integration_suite",
@@ -38,6 +40,12 @@ rabbitmq_lib(
3840

3941
xref(tags = ["xref"])
4042

43+
dialyze(
44+
dialyzer_opts = RABBITMQ_DIALYZER_OPTS,
45+
plt = "//:base_plt",
46+
tags = ["dialyze"],
47+
)
48+
4149
broker_for_integration_suites()
4250

4351
erlc(

0 commit comments

Comments
 (0)