Skip to content

Commit d6eea87

Browse files
authored
Merge pull request #3404 from rabbitmq/mergify/bp/v3.8.x/pr-3403
Use Ranch 2.1.0 in bazel build (backport #3401) (backport #3403)
2 parents 17e86c7 + 3505ea4 commit d6eea87

File tree

7 files changed

+65
-9
lines changed

7 files changed

+65
-9
lines changed

BUILD.ranch

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
load("@bazel-erlang//:bazel_erlang_lib.bzl", "app_file", "bazel_erlang_lib", "erlc",
2+
"DEFAULT_ERLC_OPTS")
3+
4+
FIRST_SRCS = [
5+
"src/ranch_transport.erl",
6+
]
7+
8+
erlc(
9+
name = "first_beam_files",
10+
hdrs = glob(["include/**/*.hrl", "src/**/*.hrl"]),
11+
srcs = glob(FIRST_SRCS),
12+
erlc_opts = DEFAULT_ERLC_OPTS,
13+
dest = "ebin",
14+
)
15+
16+
erlc(
17+
name = "beam_files",
18+
hdrs = glob(["include/**/*.hrl", "src/**/*.hrl"]),
19+
srcs = glob(["src/**/*.erl"], exclude = FIRST_SRCS),
20+
beam = [":first_beam_files"],
21+
erlc_opts = DEFAULT_ERLC_OPTS,
22+
dest = "ebin",
23+
)
24+
25+
genrule(
26+
name = "appup",
27+
srcs = ["src/ranch.appup"],
28+
outs = ["ebin/ranch.appup"],
29+
cmd = "cp $< $@",
30+
)
31+
32+
app_file(
33+
name = "app_file",
34+
app_name = "ranch",
35+
app_version = "2.1.0",
36+
modules = [":first_beam_files", ":beam_files"],
37+
)
38+
39+
bazel_erlang_lib(
40+
name = "bazel_erlang_lib",
41+
app_name = "ranch",
42+
app = ":app_file",
43+
hdrs = glob(["include/**/*.hrl"]),
44+
beam = [":first_beam_files", ":beam_files", ":appup"],
45+
visibility = ["//visibility:public"],
46+
)

deps/amqp_client/BUILD.bazel

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,12 @@ rabbitmq_lib(
4141
deps = DEPS,
4242
)
4343

44-
xref(tags = ["xref"])
44+
xref(
45+
additional_libs = [
46+
"@ranch//:bazel_erlang_lib",
47+
],
48+
tags = ["xref"],
49+
)
4550

4651
plt(
4752
name = "base_plt",

deps/rabbit/apps/rabbitmq_prelaunch/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ rabbitmq_lib(
2626
xref(
2727
additional_libs = [
2828
"@cuttlefish//:bazel_erlang_lib",
29+
"@ranch//:bazel_erlang_lib",
2930
],
3031
tags = ["xref"],
3132
)

deps/rabbit_common/BUILD.bazel

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,12 @@ bazel_erlang_lib(
180180
deps = DEPS + RUNTIME_DEPS,
181181
)
182182

183-
xref(tags = ["xref"])
183+
xref(
184+
additional_libs = [
185+
"@ranch//:bazel_erlang_lib",
186+
],
187+
tags = ["xref"],
188+
)
184189

185190
plt(
186191
name = "base_plt",

deps/rabbitmq_amqp1_0/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ xref(
5050
)
5151

5252
dialyze(
53-
size = "small",
53+
size = "medium",
5454
dialyzer_opts = RABBITMQ_DIALYZER_OPTS,
5555
plt = "//:base_plt",
5656
tags = ["dialyze"],

deps/rabbitmq_aws/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ xref(
4040
"@credentials_obfuscation//:bazel_erlang_lib",
4141
"@jsx//:bazel_erlang_lib",
4242
"@lager//:bazel_erlang_lib",
43+
"@ranch//:bazel_erlang_lib",
4344
"@recon//:bazel_erlang_lib",
4445
],
4546
tags = ["xref"],

workspace_helpers.bzl

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -235,13 +235,11 @@ erlang_lib(
235235
],
236236
)
237237

238-
hex_pm_bazel_erlang_lib(
238+
hex_archive(
239239
name = "ranch",
240-
first_srcs = [
241-
"src/ranch_transport.erl",
242-
],
243-
version = "2.0.0",
244-
sha256 = "c20a4840c7d6623c19812d3a7c828b2f1bd153ef0f124cb69c54fe51d8a42ae0",
240+
version = "2.1.0",
241+
sha256 = "244ee3fa2a6175270d8e1fc59024fd9dbc76294a321057de8f803b1479e76916",
242+
build_file = rabbitmq_workspace + "//:BUILD.ranch",
245243
)
246244

247245
hex_pm_bazel_erlang_lib(

0 commit comments

Comments
 (0)