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.

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)
@michaelklishin michaelklishin merged commit 1c88687 into v4.1.x Feb 17, 2025
265 of 268 checks passed
@michaelklishin michaelklishin deleted the mergify/bp/v4.1.x/pr-13351 branch February 17, 2025 17:06
michaelklishin added a commit that referenced this pull request Feb 17, 2025
CLI: Don't use regex as module attributes (backport #13351) (backport #13355)
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