This one has me scratching my head.
I author the table_rex
library; which is a little tool which outputs nicely spaced ascii data tables at the command line.
I recently accepted a PR to enable support for languages other than latin (East Asian ones in particular which come with varying character widths); and this PR came with a new test
only dependency named unicode
.
I checked the code out and mix test
completed after pulling deps, so it went in; however, this I then noticed that if I ran mix test
again…some of tests fail due to an undefined helper function:
** (UndefinedFunctionError) function Unicode.EastAsianWidth.east_asian_width_category/1 is undefined (module Unicode.EastAsianWidth is not available)
If you then do the following:
mix deps.clean --all
mix deps.get
mix test
The test suite will pass again. If you run mix test
a subsequent time it will fail with the undefined function error.
I have reproduced this behaviour on this branch, which deliberately runs the test suite twice in succession. As you can, it passes fine on Elixir 1.13 & Elixir 1.14, but fails on Elixir 1.15 (with both OTP 25 & 26).
Does anyone have any ideas what could cause this, or has anyone seen behaviour like it before?
Thanks in advance for any help.
As an extra…
This behaviour is also true of iex
. After the initial compile of unicode
it’ll work fine - but subsequent shell starts will result in the same function being undefined. The shell history of this:
mix deps.clean --all
mix deps.get
MIX_ENV=test iex -S mix
~/Source/table_rex misc/test-ci* 19s
nix-shell ❯ MIX_ENV=test iex -S mix
Erlang/OTP 25 [erts-13.2.2.1] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1] [jit]
==> unicode
Compiling 20 files (.ex)
Generated unicode app
==> table_rex
Generated table_rex app
Interactive Elixir (1.15.0) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> Unicode.EastAsianWidth.east_asian_width_category(36984)
:w
iex(2)>
BREAK: (a)bort (A)bort with dump (c)ontinue (p)roc info (i)nfo
(l)oaded (v)ersion (k)ill (D)b-tables (d)istribution
^C
~/Source/table_rex misc/test-ci* 32s
nix-shell ❯ MIX_ENV=test iex -S mix
Erlang/OTP 25 [erts-13.2.2.1] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1] [jit]
Interactive Elixir (1.15.0) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> Unicode.EastAsianWidth.east_asian_width_category(36984)
** (UndefinedFunctionError) function Unicode.EastAsianWidth.east_asian_width_category/1 is undefined (module Unicode.EastAsianWidth is not available)
(unicode 1.16.1) Unicode.EastAsianWidth.east_asian_width_category(36984)
iex:1: (file)
iex(1)>