Skip to content

Commit 7ad8e28

Browse files
committed
make: Restrict Erlang.mk plugin inclusion
This has no real impact on performance[1] but should make it clear which application can run the broker and/or publish to Hex.pm. In particular, applications that we can't run the broker from will now give up early if we try to. Note that while the broker can't normally run from the amqp_client application's directory, it can run from tests and some of the tests start the broker. [1] on my machine
1 parent 445f3c9 commit 7ad8e28

File tree

15 files changed

+27
-35
lines changed

15 files changed

+27
-35
lines changed

deps/amqp10_client/Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,9 @@ TEST_DEPS = rabbit rabbitmq_ct_helpers
3434
LOCAL_DEPS = ssl inets crypto public_key
3535

3636
DEP_EARLY_PLUGINS = rabbit_common/mk/rabbitmq-early-plugin.mk
37+
# We do not depend on rabbit therefore can't run the broker.
3738
DEP_PLUGINS = rabbit_common/mk/rabbitmq-build.mk \
38-
rabbit_common/mk/rabbitmq-hexpm.mk \
39-
rabbit_common/mk/rabbitmq-dist.mk \
40-
rabbit_common/mk/rabbitmq-run.mk
39+
rabbit_common/mk/rabbitmq-hexpm.mk
4140

4241
DEP_PLUGINS += elvis_mk
4342
dep_elvis_mk = git https://github.com/inaka/elvis.mk.git master

deps/amqp10_common/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ TEST_DEPS = rabbitmq_ct_helpers proper
3939
-include development.pre.mk
4040

4141
DEP_EARLY_PLUGINS = rabbit_common/mk/rabbitmq-early-plugin.mk
42+
# We do not depend on rabbit therefore can't run the broker.
4243
DEP_PLUGINS = rabbit_common/mk/rabbitmq-build.mk \
43-
rabbit_common/mk/rabbitmq-hexpm.mk \
44-
rabbit_common/mk/rabbitmq-dist.mk
44+
rabbit_common/mk/rabbitmq-hexpm.mk
4545

4646
PLT_APPS = eunit
4747

deps/amqp_client/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ DEPS = rabbit_common credentials_obfuscation
4444
TEST_DEPS = rabbitmq_ct_helpers rabbit meck
4545

4646
DEP_EARLY_PLUGINS = rabbit_common/mk/rabbitmq-early-plugin.mk
47-
DEP_PLUGINS = rabbit_common/mk/rabbitmq-build.mk \
48-
rabbit_common/mk/rabbitmq-hexpm.mk \
49-
rabbit_common/mk/rabbitmq-dist.mk \
50-
rabbit_common/mk/rabbitmq-run.mk
47+
# We do not depend on rabbit therefore can't run the broker;
48+
# however we can run a test broker in the test suites.
49+
DEP_PLUGINS = rabbit_common/mk/rabbitmq-plugin.mk \
50+
rabbit_common/mk/rabbitmq-hexpm.mk
5151

5252
PLT_APPS = ssl public_key
5353

deps/oauth2_client/Makefile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ LOCAL_DEPS = ssl inets crypto public_key
1010
PLT_APPS = rabbit
1111

1212
DEP_EARLY_PLUGINS = rabbit_common/mk/rabbitmq-early-plugin.mk
13-
DEP_PLUGINS = rabbit_common/mk/rabbitmq-build.mk \
14-
rabbit_common/mk/rabbitmq-hexpm.mk \
15-
rabbit_common/mk/rabbitmq-dist.mk \
16-
rabbit_common/mk/rabbitmq-run.mk
13+
DEP_PLUGINS = rabbit_common/mk/rabbitmq-plugin.mk
1714

1815
include rabbitmq-components.mk
1916
include erlang.mk

deps/rabbit/Makefile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,7 @@ WEB_MANPAGES = $(patsubst %,%.html,$(MANPAGES))
155155
MD_MANPAGES = $(patsubst %,%.md,$(MANPAGES))
156156

157157
DEP_EARLY_PLUGINS = rabbit_common/mk/rabbitmq-early-plugin.mk
158-
DEP_PLUGINS = rabbit_common/mk/rabbitmq-build.mk \
159-
rabbit_common/mk/rabbitmq-dist.mk \
160-
rabbit_common/mk/rabbitmq-run.mk
158+
DEP_PLUGINS = rabbit_common/mk/rabbitmq-plugin.mk
161159

162160
include ../../rabbitmq-components.mk
163161
include ../../erlang.mk

deps/rabbit_common/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ DEPS = thoas ranch recon credentials_obfuscation
3939
-include development.pre.mk
4040

4141
DEP_EARLY_PLUGINS = $(PROJECT)/mk/rabbitmq-early-plugin.mk
42+
# We do not depend on rabbit therefore can't run the broker.
4243
DEP_PLUGINS = $(PROJECT)/mk/rabbitmq-build.mk \
43-
$(PROJECT)/mk/rabbitmq-hexpm.mk \
44-
$(PROJECT)/mk/rabbitmq-dist.mk
44+
$(PROJECT)/mk/rabbitmq-hexpm.mk
4545

4646
PLT_APPS += mnesia crypto ssl
4747

deps/rabbit_common/mk/rabbitmq-hexpm.mk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# --------------------------------------------------------------------
22
# Hex.pm.
3+
#
4+
# This Erlang.mk plugin should only be included by
5+
# applications that produce an Hex.pm release.
36
# --------------------------------------------------------------------
47

58
.PHONY: hex-publish hex-publish-docs

deps/rabbit_common/mk/rabbitmq-plugin.mk

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ ifeq ($(filter rabbitmq-build.mk,$(notdir $(MAKEFILE_LIST))),)
22
include $(dir $(lastword $(MAKEFILE_LIST)))rabbitmq-build.mk
33
endif
44

5-
ifeq ($(filter rabbitmq-hexpm.mk,$(notdir $(MAKEFILE_LIST))),)
6-
include $(dir $(lastword $(MAKEFILE_LIST)))rabbitmq-hexpm.mk
7-
endif
8-
95
ifeq ($(filter rabbitmq-dist.mk,$(notdir $(MAKEFILE_LIST))),)
106
include $(dir $(lastword $(MAKEFILE_LIST)))rabbitmq-dist.mk
117
endif

deps/rabbitmq_amqp1_0/Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ PROJECT_DESCRIPTION = Deprecated no-op AMQP 1.0 plugin
33

44
LOCAL_DEPS = rabbit
55

6-
DEP_EARLY_PLUGINS = rabbit_common/mk/rabbitmq-early-plugin.mk
7-
DEP_PLUGINS = rabbit_common/mk/rabbitmq-plugin.mk
6+
DEP_PLUGINS = rabbit_common/mk/rabbitmq-build.mk
87

98
.DEFAULT_GOAL = all
109

deps/rabbitmq_amqp_client/Makefile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,8 @@ BUILD_DEPS = rabbit_common
88
DEP_EARLY_PLUGINS = rabbit_common/mk/rabbitmq-early-plugin.mk
99
TEST_DEPS = rabbit rabbitmq_ct_helpers
1010

11-
DEP_PLUGINS = rabbit_common/mk/rabbitmq-build.mk \
12-
rabbit_common/mk/rabbitmq-hexpm.mk \
13-
rabbit_common/mk/rabbitmq-dist.mk \
14-
rabbit_common/mk/rabbitmq-run.mk
11+
# We do not depend on rabbit therefore can't run the broker.
12+
DEP_PLUGINS = $(PROJECT)/mk/rabbitmq-build.mk
1513

1614
.DEFAULT_GOAL = all
1715

0 commit comments

Comments
 (0)