Skip to content

Commit a96e4fc

Browse files
committed
More improvements
1 parent 901af3a commit a96e4fc

File tree

4 files changed

+16
-20
lines changed

4 files changed

+16
-20
lines changed

deps/rabbitmq_cli/lib/rabbitmq/cli/formatters/csv.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ end
9696

9797
# Elixir 1.15 compiler optimizations require that we explicitly
9898
# add the csv code path
99-
true = Code.append_path(Path.join(["_build", Atom.to_string(Mix.env()), "lib", "csv", "ebin"]))
99+
true = Code.append_path(Path.join(["..", "csv", "ebin"]))
100100

101101
defimpl CSV.Encode, for: PID do
102102
def encode(pid, env \\ []) do

deps/rabbitmq_cli/lib/rabbitmqctl.ex

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,20 @@ defmodule RabbitMQCtl do
2525
@type command_result() :: {:error, ExitCodes.exit_code(), term()} | term()
2626

2727
@spec main(list()) :: no_return()
28-
def main(["--auto-complete" | []]) do
28+
def main(cmd0) do
29+
cmd = Enum.map(cmd0, fn val -> :erlang.list_to_binary(val) end)
30+
main1(cmd)
31+
end
32+
33+
def main1(["--auto-complete" | []]) do
2934
# silence Erlang/OTP's standard library warnings, it's acceptable for CLI tools,
3035
# see rabbitmq/rabbitmq-server#8912
3136
_ = :logger.set_primary_config(:level, :error)
3237

3338
handle_shutdown(:ok)
3439
end
3540

36-
def main(unparsed_command) do
41+
def main1(unparsed_command) do
3742
# silence Erlang/OTP's standard library warnings, it's acceptable for CLI tools,
3843
# see rabbitmq/rabbitmq-server#8912
3944
{:ok, _} = :application.ensure_all_started(:rabbitmqctl)

deps/rabbitmq_ct_helpers/src/rabbit_ct_helpers.erl

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ maybe_rabbit_srcdir(Config) ->
341341
ensure_application_srcdir(Config, App, Module) ->
342342
ensure_application_srcdir(Config, App, erlang, Module).
343343

344-
ensure_application_srcdir(Config, App, Lang, Module) ->
344+
ensure_application_srcdir(Config, App, _Lang, Module) ->
345345
AppS = atom_to_list(App),
346346
Key = list_to_atom(AppS ++ "_srcdir"),
347347
SecondaryKey = list_to_atom("secondary_" ++ AppS ++ "_srcdir"),
@@ -350,18 +350,10 @@ ensure_application_srcdir(Config, App, Lang, Module) ->
350350
case code:which(Module) of
351351
non_existing ->
352352
filename:join(?config(erlang_mk_depsdir, Config), AppS);
353-
P when Lang =:= erlang ->
353+
P ->
354354
%% P is $SRCDIR/ebin/$MODULE.beam.
355355
filename:dirname(
356-
filename:dirname(P));
357-
P when Lang =:= elixir ->
358-
%% P is $SRCDIR/_build/$MIX_ENV/lib/$APP/ebin/$MODULE.beam.
359-
filename:dirname(
360-
filename:dirname(
361-
filename:dirname(
362-
filename:dirname(
363-
filename:dirname(
364-
filename:dirname(P))))))
356+
filename:dirname(P))
365357
end;
366358
P ->
367359
P
@@ -499,9 +491,8 @@ new_script_location(Config, Script) ->
499491

500492
ensure_rabbitmqctl_app(Config) ->
501493
SrcDir = ?config(rabbitmq_cli_srcdir, Config),
502-
MixEnv = os:getenv("MIX_ENV", "dev"),
503494
EbinDir = filename:join(
504-
[SrcDir, "_build", MixEnv, "lib", "rabbitmqctl", "ebin"]),
495+
[SrcDir, "ebin"]),
505496
case filelib:is_file(filename:join(EbinDir, "rabbitmqctl.app")) of
506497
true ->
507498
true = code:add_path(EbinDir),
@@ -512,11 +503,11 @@ ensure_rabbitmqctl_app(Config) ->
512503
Config;
513504
{error, _} ->
514505
{skip, "Access to rabbitmq_cli ebin dir. required, " ++
515-
"please build rabbitmq_cli and set MIX_ENV"}
506+
"please build rabbitmq_cli"}
516507
end;
517508
false ->
518509
{skip, "Access to rabbitmq_cli ebin dir. required, " ++
519-
"please build rabbitmq_cli and set MIX_ENV"}
510+
"please build rabbitmq_cli"}
520511
end.
521512

522513
load_rabbitmqctl_app(Config) ->

erlang.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
ERLANG_MK_FILENAME := $(realpath $(lastword $(MAKEFILE_LIST)))
1818
export ERLANG_MK_FILENAME
1919

20-
ERLANG_MK_VERSION = 2022.05.31-150-g91e552d-dirty
20+
ERLANG_MK_VERSION = 2022.05.31-151-gef04797-dirty
2121
ERLANG_MK_WITHOUT =
2222

2323
# Make 3.81 and 3.82 are deprecated.
@@ -1504,7 +1504,7 @@ app:: $(if $(wildcard ebin/test),beam-cache-restore-app) deps
15041504
$(verbose) $(MAKE) --no-print-directory $(PROJECT).d
15051505
$(verbose) $(MAKE) --no-print-directory app-build
15061506

1507-
PROJECT_MOD := $(if $(PROJECT_MOD),$(PROJECT_MOD),$(if $(wildcard src/$(PROJECT_MOD)_app.erl),$(PROJECT_MOD)_app))
1507+
PROJECT_MOD := $(if $(PROJECT_MOD),$(PROJECT_MOD),$(if $(wildcard src/$(PROJECT)_app.erl),$(PROJECT)_app))
15081508

15091509
define app_file
15101510
{application, '$(PROJECT)', [

0 commit comments

Comments
 (0)