[Pkg-erlang-devel] Bug#941124: Bug#941124:
Sergei Golovan
sgolovan at gmail.com
Tue Oct 1 11:44:26 BST 2019
Hi Evgeny,
On Tue, Oct 1, 2019 at 1:27 PM Evgeny Golyshev <eugulixes at gmail.com> wrote:
>
> Hello everyone
>
> I maintain Elixir in Debian.
> Obviously the compatibility between the Erlang's versions has been
> broken. I did a small research and found out that failing autopkgtest
> is the result of Erlang's :re module. Unfortunately, I can't provide
> details for the problem because a deeper study of it can take a lot of
> time which I don't have so far.
> Also I can confirm that rebuilding Elixir against the newest Erlang
> fixes the problem.
Here is a simple example which demonstrates the issue.
Just compile it using Erlang 21 backend, and then run with Erlang 22.
The first call to a Regex.run/2 uses the precompiled regex, and will match
only "s", the second call uses the same regex but recompiles it, so it will
successfully match the whole string. (The original Erlang re:run also
succeeds because it isn't precompiled).
# reg.ex
defmodule Reg do
def run do
regex = ~r/[a-z]+/i
IO.puts Regex.opts(regex)
IO.puts Regex.source(regex)
IO.puts Regex.run(regex, "sTrInG")
IO.puts Regex.run(Regex.recompile!(regex), "sTrInG")
IO.puts inspect :re.run("sTrInG", "[a-z]+", [:caseless])
end
end
Cheers!
--
Sergei Golovan
More information about the Pkg-erlang-devel
mailing list