Skip to content

Commit effabb3

Browse files
authored
Merge pull request #4467 from rabbitmq/mergify/bp/v3.8.x/pr-4466
Updates for rules_erlang 2.5.0 (backport #4440) (backport #4465) (backport #4466)
2 parents 8533228 + 9ab9b03 commit effabb3

File tree

40 files changed

+176
-164
lines changed

40 files changed

+176
-164
lines changed

BUILD.ranch

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,10 @@ load("@rules_erlang//:erlang_app_info.bzl", "erlang_app_info")
33
load("@rules_erlang//:erlang_app.bzl", "DEFAULT_ERLC_OPTS")
44
load("@rules_erlang//:erlc.bzl", "erlc")
55

6-
FIRST_SRCS = [
7-
"src/ranch_transport.erl",
8-
]
9-
10-
erlc(
11-
name = "first_beam_files",
12-
hdrs = glob(["include/**/*.hrl", "src/**/*.hrl"]),
13-
srcs = glob(FIRST_SRCS),
14-
erlc_opts = DEFAULT_ERLC_OPTS,
15-
dest = "ebin",
16-
)
17-
186
erlc(
197
name = "beam_files",
208
hdrs = glob(["include/**/*.hrl", "src/**/*.hrl"]),
21-
srcs = glob(["src/**/*.erl"], exclude = FIRST_SRCS),
22-
beam = [":first_beam_files"],
9+
srcs = glob(["src/**/*.erl"]),
2310
erlc_opts = DEFAULT_ERLC_OPTS,
2411
dest = "ebin",
2512
)
@@ -35,14 +22,14 @@ app_file(
3522
name = "app_file",
3623
app_name = "ranch",
3724
app_version = "2.1.0",
38-
modules = [":first_beam_files", ":beam_files"],
25+
modules = [":beam_files"],
3926
)
4027

4128
erlang_app_info(
4229
name = "erlang_app",
4330
app_name = "ranch",
4431
app = ":app_file",
4532
hdrs = glob(["include/**/*.hrl"]),
46-
beam = [":first_beam_files", ":beam_files", ":appup"],
33+
beam = [":beam_files", ":appup"],
4734
visibility = ["//visibility:public"],
4835
)

WORKSPACE.bazel

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ rules_pkg_dependencies()
5959

6060
http_archive(
6161
name = "rules_erlang",
62-
sha256 = "a58ab84733ed3b43eda6a1c624edf04a0dac7cabdd2b4fcf84391ee8af969965",
63-
strip_prefix = "rules_erlang-2.2.1",
64-
urls = ["https://github.com/rabbitmq/rules_erlang/archive/refs/tags/2.2.1.zip"],
62+
sha256 = "36d8cb85574cda48952b5b4e538a45d054cc690397ba87905049bef556b55159",
63+
strip_prefix = "rules_erlang-2.5.1",
64+
urls = ["https://github.com/rabbitmq/rules_erlang/archive/refs/tags/2.5.1.zip"],
6565
)
6666

6767
load("@rules_erlang//:rules_erlang.bzl", "rules_erlang_dependencies")

deps/amqp10_client/BUILD.bazel

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,26 @@ APP_DESCRIPTION = "AMQP 1.0 client from the RabbitMQ Project"
1616

1717
APP_MODULE = "amqp10_client_app"
1818

19+
APP_EXTRA_KEYS = """%% Hex.pm package informations.
20+
{licenses, ["MPL-2.0"]},
21+
{links, [
22+
{"Website", "https://www.rabbitmq.com/"},
23+
{"GitHub", "https://github.com/rabbitmq/rabbitmq-server/deps/amqp10_client"}
24+
]},
25+
{build_tools, ["make", "rebar3"]},
26+
{files, [
27+
"erlang.mk",
28+
"git-revisions.txt",
29+
"include",
30+
"LICENSE*",
31+
"Makefile",
32+
"rabbitmq-components.mk",
33+
"README",
34+
"README.md",
35+
"src"
36+
]}
37+
"""
38+
1939
EXTRA_APPS = [
2040
"ssl",
2141
"inets",
@@ -33,6 +53,7 @@ DEPS = [
3353

3454
rabbitmq_app(
3555
app_description = APP_DESCRIPTION,
56+
app_extra_keys = APP_EXTRA_KEYS,
3657
app_module = APP_MODULE,
3758
app_name = APP_NAME,
3859
build_deps = BUILD_DEPS,
@@ -88,9 +109,6 @@ suites = [
88109
data = [
89110
"@activemq//:exec_dir",
90111
],
91-
erlc_opts = [
92-
"-I deps/amqp10_client",
93-
],
94112
test_env = {
95113
"ACTIVEMQ": "$TEST_SRCDIR/$TEST_WORKSPACE/external/activemq/bin/activemq",
96114
},

deps/amqp10_client/test/mock_server.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
recv_amqp_header_step/1
1717
]).
1818

19-
-include_lib("src/amqp10_client.hrl").
19+
-include_lib("amqp10_client/src/amqp10_client.hrl").
2020

2121
start(Port) ->
2222
{ok, LSock} = gen_tcp:listen(Port, [binary, {packet, 0}, {active, false}]),

deps/amqp10_client/test/system_SUITE.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
-include_lib("amqp10_common/include/amqp10_framing.hrl").
1414

15-
-include_lib("src/amqp10_client.hrl").
15+
-include_lib("amqp10_client/src/amqp10_client.hrl").
1616

1717
-compile(export_all).
1818

deps/amqp10_common/BUILD.bazel

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,25 @@ BUILD_DEPS = [
5555
app_file(
5656
name = "app_file",
5757
app_description = "Modules shared by rabbitmq-amqp1.0 and rabbitmq-amqp1.0-client",
58+
app_extra = """%% Hex.pm package informations.
59+
{licenses, ["MPL-2.0"]},
60+
{links, [
61+
{"Website", "https://www.rabbitmq.com/"},
62+
{"GitHub", "https://github.com/rabbitmq/rabbitmq-server/deps/amqp10_common"}
63+
]},
64+
{build_tools, ["make", "rebar3"]},
65+
{files, [
66+
"erlang.mk",
67+
"git-revisions.txt",
68+
"include",
69+
"LICENSE*",
70+
"Makefile",
71+
"rabbitmq-components.mk",
72+
"README",
73+
"README.md",
74+
"mk"
75+
]}
76+
""",
5877
app_name = APP_NAME,
5978
app_version = APP_VERSION,
6079
modules = [":beam_files"],

deps/amqp_client/BUILD.bazel

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,26 @@ APP_ENV = """[
1616
{writer_gc_threshold, 1000000000}
1717
]"""
1818

19+
APP_EXTRA_KEYS = """%% Hex.pm package informations.
20+
{licenses, ["MPL-2.0"]},
21+
{links, [
22+
{"Website", "https://www.rabbitmq.com/"},
23+
{"GitHub", "https://github.com/rabbitmq/rabbitmq-server/deps/amqp_client"},
24+
{"User guide", "https://www.rabbitmq.com/erlang-client-user-guide.html"}
25+
]},
26+
{build_tools, ["make", "rebar3"]},
27+
{files, [
28+
"erlang.mk",
29+
"git-revisions.txt",
30+
"include",
31+
"LICENSE*",
32+
"Makefile",
33+
"rabbitmq-components.mk",
34+
"README",
35+
"README.md"
36+
]}
37+
"""
38+
1939
EXTRA_APPS = [
2040
"xmerl",
2141
]
@@ -28,16 +48,13 @@ DEPS = [
2848
rabbitmq_app(
2949
app_description = "RabbitMQ AMQP Client",
3050
app_env = APP_ENV,
51+
app_extra_keys = APP_EXTRA_KEYS,
3152
app_module = "amqp_client",
3253
app_name = "amqp_client",
3354
app_registered = [
3455
"amqp_sup",
3556
],
3657
extra_apps = EXTRA_APPS,
37-
first_srcs = [
38-
"src/amqp_gen_connection.erl",
39-
"src/amqp_gen_consumer.erl",
40-
],
4158
deps = DEPS,
4259
)
4360

deps/rabbit/BUILD.bazel

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -190,14 +190,6 @@ EXTRA_APPS = [
190190
"xmerl",
191191
]
192192

193-
FIRST_SRCS = [
194-
"src/rabbit_tracking.erl",
195-
"src/rabbit_queue_type.erl",
196-
"src/rabbit_credential_validator.erl",
197-
"src/rabbit_policy_merge_strategy.erl",
198-
"src/rabbit_queue_master_locator.erl",
199-
]
200-
201193
rabbitmq_app(
202194
app_description = "RabbitMQ",
203195
app_env = _APP_ENV,
@@ -206,7 +198,6 @@ rabbitmq_app(
206198
app_registered = APP_REGISTERED,
207199
build_deps = BUILD_DEPS,
208200
extra_apps = EXTRA_APPS,
209-
first_srcs = FIRST_SRCS,
210201
runtime_deps = RUNTIME_DEPS,
211202
deps = DEPS,
212203
)
@@ -669,9 +660,6 @@ suites = [
669660
additional_hdrs = [
670661
"src/rabbit_fifo.hrl",
671662
],
672-
erlc_opts = [
673-
"-I deps/rabbit", # allow rabbit_fifo.hrl to be included at src/rabbit_fifo.hrl
674-
],
675663
runtime_deps = [
676664
"@ra//:erlang_app",
677665
],
@@ -690,9 +678,6 @@ suites = [
690678
additional_hdrs = [
691679
"src/rabbit_fifo.hrl",
692680
],
693-
erlc_opts = [
694-
"-I deps/rabbit", # allow rabbit_fifo.hrl to be included at src/rabbit_fifo.hrl
695-
],
696681
runtime_deps = [
697682
"@meck//:erlang_app",
698683
"@ra//:erlang_app",
@@ -710,9 +695,6 @@ suites = [
710695
additional_hdrs = [
711696
"src/rabbit_fifo_v0.hrl",
712697
],
713-
erlc_opts = [
714-
"-I deps/rabbit", # allow rabbit_fifo.hrl to be included at src/rabbit_fifo.hrl
715-
],
716698
runtime_deps = [
717699
"@meck//:erlang_app",
718700
"@ra//:erlang_app",

deps/rabbit/test/feature_flags_SUITE_data/my_plugin/BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
load("@rules_erlang//:erlang_app.bzl", "erlang_app")
2+
load("//:rabbitmq.bzl", "BROKER_VERSION_REQUIREMENTS_ANY")
23

34
DEPS = [
45
"//deps/rabbit_common:erlang_app",
@@ -7,6 +8,7 @@ DEPS = [
78

89
erlang_app(
910
app_description = "Plugin to test feature flags",
11+
app_extra = BROKER_VERSION_REQUIREMENTS_ANY,
1012
app_name = "my_plugin",
1113
app_version = "1.0.0",
1214
deps = DEPS,

deps/rabbit/test/rabbit_fifo_SUITE.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
-include_lib("common_test/include/ct.hrl").
1818
-include_lib("eunit/include/eunit.hrl").
1919
-include_lib("rabbit_common/include/rabbit.hrl").
20-
-include("src/rabbit_fifo.hrl").
20+
-include_lib("rabbit/src/rabbit_fifo.hrl").
2121

2222
%%%===================================================================
2323
%%% Common Test callbacks

deps/rabbit/test/rabbit_fifo_prop_SUITE.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
-include_lib("proper/include/proper.hrl").
1515
-include_lib("common_test/include/ct.hrl").
1616
-include_lib("eunit/include/eunit.hrl").
17-
-include("src/rabbit_fifo.hrl").
17+
-include_lib("rabbit/src/rabbit_fifo.hrl").
1818

1919
%%%===================================================================
2020
%%% Common Test callbacks

deps/rabbit/test/rabbit_fifo_v0_SUITE.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
-include_lib("common_test/include/ct.hrl").
1212
-include_lib("eunit/include/eunit.hrl").
1313
-include_lib("rabbit_common/include/rabbit.hrl").
14-
-include("src/rabbit_fifo_v0.hrl").
14+
-include_lib("rabbit/src/rabbit_fifo_v0.hrl").
1515

1616
%%%===================================================================
1717
%%% Common Test callbacks

0 commit comments

Comments
 (0)