Skip to content

Conversation

@mergify
Copy link

@mergify mergify bot commented Feb 17, 2025

This is not sufficient to build RabbitMQ on OTP 28.0-rc1 but it fixes the first problem that we hit. It might be that Elixir will support regex module attributes once it supports OTP 28, but we don't have to wait - this minor refactor just makes our code compatible with OTP28 without changing anything of substance.


This is an automatic backport of pull request #13351 done by Mergify.
This is an automatic backport of pull request #13355 done by Mergify.

When trying to use OTP28.0-rc1, Elixir fails to compile these modules
because a module attribute cannot be a regex. It is not yet clear
whether it's something to be fixed in Elixir for OTP28 compatibility
or something that accidentally worked in the past, but either way,
using a string as an attribute is equally good and works all OTP
versions, including OTP28.0-rc1.

```
== Compilation error in file lib/rabbitmq/cli/core/command_modules.ex ==
** (ArgumentError) cannot inject attribute @commands_ns into function/macro because cannot escape #Reference<0.2201422310.1333657602.13657>. The supported values are: lists, tuples, maps, atoms, numbers, bitstrings, PIDs and remote functions in the format &Mod.fun/arity
    (elixir 1.18.2) lib/kernel.ex:3729: Kernel.do_at/5
    (elixir 1.18.2) expanding macro: Kernel.@/1
    lib/rabbitmq/cli/core/command_modules.ex:133: RabbitMQ.CLI.Core.CommandModules.make_module_map/2
```

(cherry picked from commit 7e8ecc9)
(cherry picked from commit bc1721b)
@michaelklishin michaelklishin added this to the 4.0.7 milestone Feb 17, 2025
@michaelklishin michaelklishin merged commit 858dccd into v4.0.x Feb 17, 2025
268 checks passed
@michaelklishin michaelklishin deleted the mergify/bp/v4.0.x/pr-13355 branch February 17, 2025 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants