Skip to content

Pin rabbitmq_cli prod deps (backport #7467) (backport #7474) (backport #7475) #7480

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions deps/rabbitmq_cli/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ rabbitmqctl(
visibility = ["//visibility:public"],
deps = [
"//deps/rabbit_common:erlang_app",
"@observer_cli//:erlang_app",
"@stdout_formatter//:erlang_app",
],
)

Expand Down Expand Up @@ -119,6 +121,8 @@ rabbitmqctl_test(
"//deps/amqp_client:erlang_app",
"//deps/rabbit:erlang_app",
"//deps/rabbit_common:erlang_app",
"@observer_cli//:erlang_app",
"@stdout_formatter//:erlang_app",
],
)

Expand Down
2 changes: 1 addition & 1 deletion deps/rabbitmq_cli/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PROJECT = rabbitmq_cli

BUILD_DEPS = rabbit_common
DEPS = observer_cli
DEPS = observer_cli stdout_formatter
TEST_DEPS = amqp_client rabbit

DEP_EARLY_PLUGINS = rabbit_common/mk/rabbitmq-early-plugin.mk
Expand Down
90 changes: 41 additions & 49 deletions deps/rabbitmq_cli/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -123,59 +123,51 @@ defmodule RabbitMQCtl.MixfileBase do
# self-contained and RabbitMQ must be buildable offline). However, we
# don't have the equivalent for other methods.
defp deps() do
elixir_deps = [
{:json, "~> 1.4.1"},
{:csv, "~> 2.4.0"},
{:stdout_formatter, "~> 0.2.3"},
{:observer_cli, "~> 1.7.3"},
deps_dir = System.get_env("DEPS_DIR", "deps")

# Mix is confused by any `rebar.{config,lock}` we might have left in
# `rabbit_common` or `amqp_client`. So just remove those files to be
# safe, as they are generated when we publish to Hex.pm only.
for dir <- ["rabbit_common", "amqp_client"] do
for file <- ["rebar.config", "rebar.lock"] do
File.rm(Path.join([deps_dir, dir, file]))
end
end

make_cmd = System.get_env("MAKE", "make")
is_bazel = System.get_env("IS_BAZEL") != nil

[
{:json, "1.4.1"},
{:csv, "2.4.1"},
{
:stdout_formatter,
path: Path.join(deps_dir, "stdout_formatter"),
compile: if(is_bazel, do: false, else: make_cmd)
},
{
:observer_cli,
path: Path.join(deps_dir, "observer_cli"),
compile: if(is_bazel, do: false, else: make_cmd)
},
{:amqp, "~> 2.1.0", only: :test},
{:dialyxir, "~> 0.5", only: :test, runtime: false},
{:temp, "~> 0.4", only: :test},
{:x509, "~> 0.7", only: :test}
{:x509, "~> 0.7", only: :test},
{
:rabbit_common,
path: Path.join(deps_dir, "rabbit_common"),
compile: if(is_bazel, do: false, else: make_cmd),
override: true
},
{
:amqp_client,
path: Path.join(deps_dir, "amqp_client"),
compile: if(is_bazel, do: false, else: make_cmd),
override: true,
only: :test
}
]

rabbitmq_deps =
case System.get_env("DEPS_DIR") do
nil ->
# rabbitmq_cli is built as a standalone Elixir application.
[
{:rabbit_common, "~> 3.8.0"},
{:amqp_client, "~> 3.8.0", only: :test}
]

deps_dir ->
# rabbitmq_cli is built as part of RabbitMQ.

# Mix is confused by any `rebar.{config,lock}` we might have left in
# `rabbit_common` or `amqp_client`. So just remove those files to be
# safe, as they are generated when we publish to Hex.pm only.
for dir <- ["rabbit_common", "amqp_client"] do
for file <- ["rebar.config", "rebar.lock"] do
File.rm(Path.join([deps_dir, dir, file]))
end
end

make_cmd = System.get_env("MAKE", "make")
is_bazel = System.get_env("IS_BAZEL") != nil

[
{
:rabbit_common,
path: Path.join(deps_dir, "rabbit_common"),
compile: if(is_bazel, do: false, else: make_cmd),
override: true
},
{
:amqp_client,
path: Path.join(deps_dir, "amqp_client"),
compile: if(is_bazel, do: false, else: make_cmd),
override: true,
only: :test
}
]
end

elixir_deps ++ rabbitmq_deps
end

defp aliases do
Expand Down