rabbitmq / rabbitmq-delayed-message-exchange

Delayed Messaging for RabbitMQ
Other
2.06k stars 150 forks source link

Unable to build external plugins #260

Closed noxdafox closed 2 weeks ago

noxdafox commented 10 months ago

Describe the bug

While testing a PR on my plugin: https://github.com/noxdafox/rabbitmq-message-deduplication/pull/105

I could not manage to build it anymore. I could not track the core issue but I noticed this plugins suffers from the same issue.

Once running make, the following error shows up.

 DEP    ranch (2.1.0)
 DEP    rabbitmq_prelaunch ()
Error: Unknown or invalid dependency: rabbitmq_prelaunch.
make[1]: *** [../../erlang.mk:4396: /tmp/rabbitmq-delayed-message-exchange/deps/rabbitmq_prelaunch] Error 78
make[1]: Leaving directory '/tmp/rabbitmq-delayed-message-exchange/.erlang.mk/rabbitmq-server/deps/rabbit'
make: *** [erlang.mk:4512: deps] Error 2

Adding the explicit dependency (dep_rabbitmq_prelaunch) in the Makefile does not solve the issue.

Reproduction steps

Run make within the project.

Expected behavior

Dependencies are fetched and build correctly.

Additional context

No response

lukebakken commented 10 months ago

@noxdafox - give this a try:

https://github.com/gotthardp/rabbitmq-email/issues/61#issuecomment-1872145258

noxdafox commented 9 months ago

That does the trick but it's quite cumbersome and complicates the build and testing of external plugins quite a lot.

Is this the new way forward or is it a temporary solution while transitioning to RMQ 4?

michaelklishin commented 9 months ago

One optimal long term solution would be for 3rd party plugins to adopt Bazel. We are not currently sure what will happen with Make. For external plugins, it may or may not remain an option (but there are no plans to remove Make/erlang.mk as an option for developing RabbitMQ itself).

michaelklishin commented 2 weeks ago

This plugin was successfully updated for 4.0, therefore we have evidence that it can be built. RabbitMQ main has a much more efficient version of the erlang.mk-based build system which works exactly Make did before Bazel. In fact, we will use this build system instead of Bazel going forward.

noxdafox commented 2 weeks ago

Is it so that the only way forward is to build plugins by dropping them into the rabbitmq-server/deps folder?

I at least manage to get the build to work by doing so but are there better supported ways?

michaelklishin commented 2 weeks ago

@noxdafox with erlang.mk that's how it is done, yes.

noxdafox commented 3 days ago

I would then suggest to update the plugins development guide as this is not clear and very hard to guess.

https://www.rabbitmq.com/plugin-development

This way forward brings quite a bit of friction as it becomes hard to test the plugins without onboarding a fair bit of maintenance. Now the third party plugin needs to sit within the RMQ git repo although they belong to separate remote projects.

We can already see people getting quite confused by this build mechanics: https://github.com/noxdafox/rabbitmq-message-deduplication/issues/111

michaelklishin commented 3 days ago

You are welcome to update it, the website is open source and these days is based on Docusaurus, a widely used documentation/static website generator tool.