@@ -31,10 +31,6 @@ DISABLE_DISTCLEAN = 1
31
31
ifeq ($(filter-out xref,$(MAKECMDGOALS ) ) ,)
32
32
XREF_SCOPE = app deps
33
33
34
- # We add all the applications that are in non-standard paths
35
- # so they are included in the analyses as well.
36
- XREF_EXTRA_APP_DIRS = $(filter-out deps/rabbitmq_cli/_build/dev/lib/rabbit_common/,$(wildcard deps/rabbitmq_cli/_build/dev/lib/* /) ) deps/rabbitmq_prelaunch/
37
-
38
34
# For Elixir protocols the right fix is to include the consolidated/
39
35
# folders in addition to ebin/. However this creates conflicts because
40
36
# some modules are duplicated. So instead we ignore warnings from
@@ -49,10 +45,6 @@ XREF_IGNORE = [ \
49
45
xref : ERL_LIBS := $(ERL_LIBS ) :$(CURDIR ) /apps:$(CURDIR ) /deps:$(dir $(shell elixir --eval ':io.format "~s~n", [:code.lib_dir :elixir ]') )
50
46
endif
51
47
52
- ifneq ($(wildcard deps/.hex/cache.erl) ,)
53
- deps :: restore-hex-cache-ets-file
54
- endif
55
-
56
48
include rabbitmq-components.mk
57
49
58
50
# Set PROJECT_VERSION, calculated in rabbitmq-components.mk,
@@ -84,54 +76,6 @@ ifdef PLUGINS
84
76
RABBITMQ_ENABLED_PLUGINS ?= $(call comma_list,$(PLUGINS ) )
85
77
endif
86
78
87
- # --------------------------------------------------------------------
88
- # Mix Hex cache management.
89
- # --------------------------------------------------------------------
90
-
91
- # We restore the initial Hex cache.ets file from an Erlang term created
92
- # at the time the source archive was prepared.
93
- #
94
- # See the `$(SOURCE_DIST)` recipe for the reason behind this step.
95
-
96
- restore-hex-cache-ets-file : deps/.hex/cache.ets
97
-
98
- deps/.hex/cache.ets : deps/.hex/cache.erl
99
- $(gen_verbose ) $(call erlang,$(call restore_hex_cache_from_erl_term,$< ,$@ ) )
100
-
101
- define restore_hex_cache_from_erl_term
102
- In = "$(1 ) ",
103
- Out = "$(2 ) ",
104
- {ok, [Props, Entries]} = file:consult(In),
105
- Name = proplists:get_value(name, Props),
106
- Type = proplists:get_value(type, Props),
107
- Access = proplists:get_value(protection, Props),
108
- NamedTable = proplists:get_bool(named_table, Props),
109
- Keypos = proplists:get_value(keypos, Props),
110
- Heir = proplists:get_value(heir, Props),
111
- ReadConc = proplists:get_bool(read_concurrency, Props),
112
- WriteConc = proplists:get_bool(write_concurrency, Props),
113
- Compressed = proplists:get_bool(compressed, Props),
114
- Options0 = [
115
- Type,
116
- Access,
117
- {keypos, Keypos},
118
- {heir, Heir},
119
- {read_concurrency, ReadConc},
120
- {write_concurrency, WriteConc}],
121
- Options1 = case NamedTable of
122
- true -> [named_table | Options0];
123
- false -> Options0
124
- end,
125
- Options2 = case Compressed of
126
- true -> [compressed | Options0];
127
- false -> Options0
128
- end,
129
- Tab = ets:new(Name, Options2),
130
- [true = ets:insert(Tab, Entry) || Entry <- Entries],
131
- ok = ets:tab2file(Tab, Out),
132
- init:stop().
133
- endef
134
-
135
79
# --------------------------------------------------------------------
136
80
# Distribution - common variables and generic functions.
137
81
# --------------------------------------------------------------------
@@ -263,14 +207,6 @@ $(1): $(ERLANG_MK_RECURSIVE_DEPS_LIST)
263
207
sed -E -i.bak "s|^[[:blank:]]*include[[:blank:]]+\.\./.*erlang.mk$$$$|include ../../erlang.mk|" \
264
208
$$@ /deps/$$$$(basename $$$$dep) /Makefile && \
265
209
rm $$@ /deps/$$$$(basename $$$$dep) /Makefile.bak; \
266
- mix_exs=$$@ /deps/$$$$(basename $$$$dep) /mix.exs; \
267
- if test -f $$$$mix_exs; then \
268
- (cd $$$$(dirname "$$$$mix_exs" ) && \
269
- (test -d $$@ /deps/.hex || env DEPS_DIR=$$@ /deps MIX_HOME=$$@ /deps/.mix HEX_HOME=$$@ /deps/.hex MIX_ENV=prod FILL_HEX_CACHE=yes mix local.hex --force) && \
270
- env DEPS_DIR=$$@ /deps MIX_HOME=$$@ /deps/.mix HEX_HOME=$$@ /deps/.hex MIX_ENV=prod FILL_HEX_CACHE=yes mix deps.get --only prod && \
271
- cp $(CURDIR ) /mk/rabbitmq-mix.mk . && \
272
- rm -rf _build deps); \
273
- fi; \
274
210
if test -f "$$$$dep/license_info"; then \
275
211
cp "$$$$dep/license_info" "$$@ /deps/licensing/license_info_$$$$(basename $$$$dep) "; \
276
212
cat "$$$$dep/license_info" >> $$@ /LICENSE; \
@@ -295,7 +231,6 @@ $(1): $(ERLANG_MK_RECURSIVE_DEPS_LIST)
295
231
done
296
232
$${verbose} echo "PLUGINS := $(PLUGINS ) " > $$@ /plugins.mk
297
233
$${verbose} sort -r < "$$@ .git-times.txt" | head -n 1 > "$$@ .git-time.txt"
298
- $${verbose} $$(call erlang,$$(call dump_hex_cache_to_erl_term,$$(call core_native_path,$$@ ) ,$$(call core_native_path,$$@ .git-time.txt) ) )
299
234
$${verbose} find $$@ -print0 | xargs -0 touch -t "$$$$(cat $$@ .git-time.txt ) "
300
235
$${verbose} rm "$$@ .git-times.txt" "$$@ .git-time.txt"
301
236
@@ -337,47 +272,6 @@ clean-$(1):
337
272
clean:: clean-$(1 )
338
273
endef
339
274
340
- # Mix Hex component requires a cache file, otherwise it refuses to build
341
- # offline... That cache is an ETS table with all the applications we
342
- # depend on, plus some versioning informations and checksums. There
343
- # are two problems with that: the table contains a date (`last_update`
344
- # field) and `ets:tab2file()` produces a different file each time it's
345
- # called.
346
- #
347
- # To make our source archive reproducible, we fix the time of the
348
- # `last_update` field to the last Git commit and dump the content of the
349
- # table as an Erlang term to a text file.
350
- #
351
- # The ETS file must be recreated before compiling RabbitMQ. See the
352
- # `restore-hex-cache-ets-file` Make target.
353
- define dump_hex_cache_to_erl_term
354
- In = "$(1 ) /deps/.hex/cache.ets",
355
- Out = "$(1 ) /deps/.hex/cache.erl",
356
- {ok, DateStr} = file:read_file("$(2 ) "),
357
- {match, Date} = re:run(DateStr,
358
- "^([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})\.([0-9]{2})",
359
- [{capture, all_but_first, list}]),
360
- [Year, Month, Day, Hour, Min, Sec] = [erlang:list_to_integer(V) || V <- Date],
361
- {ok, Tab} = ets:file2tab(In),
362
- true = ets:insert(Tab, {last_update, {{Year, Month, Day}, {Hour, Min, Sec}}}),
363
- Props = [
364
- Prop
365
- || {Key, _} = Prop <- ets:info(Tab),
366
- Key =:= name orelse
367
- Key =:= type orelse
368
- Key =:= protection orelse
369
- Key =:= named_table orelse
370
- Key =:= keypos orelse
371
- Key =:= heir orelse
372
- Key =:= read_concurrency orelse
373
- Key =:= write_concurrency orelse
374
- Key =:= compressed],
375
- Entries = ets:tab2list(Tab),
376
- ok = file:write_file(Out, io_lib:format("~w.~n~w.~n", [Props, Entries])),
377
- ok = file:delete(In),
378
- init:stop().
379
- endef
380
-
381
275
# --------------------------------------------------------------------
382
276
# Distribution - public targets
383
277
# --------------------------------------------------------------------
0 commit comments