I have some code that generates a few thousand function clauses via a macro that runs fine in most platforms but when trying to run it in Docker on an ARM mac it fails in a weird way.
Here’s a contrived example that reproduces the issue:
defmodule Test do
Enum.each 1..4096, fn id ->
def __id__(unquote(id)) do
IO.puts("Executing clause for #{unquote(id)}")
end
end
end
Test.__id__(2)
If running on native Linux or Mac, this code runs fine regardless of the number of clauses generated but when running in an “aarch64 Linux” docker image, then the code compiles fine in every case but the call to Test.__id__(2)
fails with a no function clause matching
error when the number of clauses is bigger than 4096.
This is happening with Erlang/OTP 25 [erts-13.2] and Elixir 1.14.2.
It there something that I’m missing here or should I open a bug in the github repo?
Thanks!