I’m in the process of moving a large application from OTP 23.x to OTP-27
As part of this process I needed to upgrade RabbitMQ from an old 3.6 series to 4.0.3
When compiling, all goes fine, but when building a release it fails with error:
===> Error generating release:
Circular dependencies among applications: [{amqp_client,"4.0.3"},
{rabbit_common,"4.0.3"}]
The error originates from systools_make.erl
where it’s trying to calculate start order of applications for generation of the boot script.
For the life of me I cannot figure out why it’s actually failing or how to fix it.
For reference, the applications
sections from relevant apps:
a) My main app has our shared library app smlib
in its applications
b) Our smlib
library app has amqp_client
in its applications
c) amqp_client
{applications, [kernel,stdlib,xmerl,ssl,public_key,rabbit_common,credentials_obfuscation]},
d) rabbit_common
{applications, [kernel,stdlib,compiler,crypto,public_key,sasl,ssl,syntax_tools,tools,xmerl,os_mon,runtime_tools,thoas,ranch,recon,credentials_obfuscation]},
I’ve dug in the processing of deps in systools_make.erl
a little, but for the life of me cannot figure out why this is happening.
In poking around I modified systools_make.erl
and removed the call to add_top_apps_to_uses/3
in function check_applications/1
, and that allows a successful build of the release, but smlib
and it’s applications are not started on boot (so obviously not a fix…)
I did generate a minimal app with amqp_client
as its only dep, and that release built without any issues.
I then tried just adding our smlib
app as the singular dep, and that built the release fine as well
I’ve also confirmed no other applications in the entire system other than smlib
depend on amqp_client
or rabbit_common
.
The was an issue on rabbitmq GH filed with the same Circular dependency
problem, which was unfortunately dismissed by rmq devs. Erlang AMQP 0-9-1 client releases on hex.pm have stopped at 4.0.3 · Issue #13379 · rabbitmq/rabbitmq-server · GitHub
Any help would be greatly appreciated.