Compile Elixir from source on OpenBSD

Hello, I have Erlang-OTP 26 installed from source and now I’m trying to compile Elixir (1.15) from source on OpenBSD.

I followed this instructions : Provisioning script to compile elixir on OpenBSD 6.6 · GitHub

when I do gmake clean test I get :

==> elixir (ex_unit)
warning: the VM is running with native name encoding of latin1 which may cause Elixir to malfunction as it expects utf8. Please ensure your locale is set to UTF-8 (which can be verified by running "locale" in your shell)
Excluding tags: [windows: true]

.......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

  1) test invokes at_exit callbacks (Kernel.CLI.AtExitTest)
     test/elixir/kernel/cli_test.exs:206
     Assertion with == failed
     code:  assert elixir(fixture_path("at_exit.exs") |> to_charlist) == "goodbye cruel world with status 1\n"
     left:  "warning: the VM is running with native name encoding of latin1 which may cause Elixir to malfunction as it expects utf8. Please ensure your locale is set to UTF-8 (which can be verified by running \"locale\" in your shell)\ngoodbye cruel world with status 1\n"
     right: "goodbye cruel world with status 1\n"
     stacktrace:
       test/elixir/kernel/cli_test.exs:207: (test)

.....................

  2) test can be invoked multiple times (Kernel.CLI.RPCTest)
     test/elixir/kernel/cli_test.exs:170
     Assertion with == failed
     code:  assert elixir(
              ~c"--name #{node}@127.0.0.1 --rpc-eval #{node} \"IO.puts :foo\" --rpc-eval #{node} \"IO.puts :bar\""
            ) == "foo\nbar\n"
     left:  "warning: the VM is running with native name encoding of latin1 which may cause Elixir to malfunction as it expects utf8. Please ensure your locale is set to UTF-8 (which can be verified by running \"locale\" in your shell)\nfoo\nbar\n"
     right: "foo\nbar\n"
     stacktrace:
       test/elixir/kernel/cli_test.exs:173: (test)

....

  3) test fails on missing write access to .beam file (Kernel.CLI.CompileTest)
     test/elixir/kernel/cli_test.exs:264
     Assertion with == failed
     code:  assert elixirc(compilation_args) == ""
     left:  "warning: the VM is running with native name encoding of latin1 which may cause Elixir to malfunction as it expects utf8. Please ensure your locale is set to UTF-8 (which can be verified by running \"locale\" in your shell)\n"
     right: ""
     stacktrace:
       test/elixir/kernel/cli_test.exs:267: (test)

...........................................................

  4) test invokes command on remote node (Kernel.CLI.RPCTest)
     test/elixir/kernel/cli_test.exs:161
     Assertion with == failed
     code:  assert rpc_eval("IO.puts :ok") == "ok\n"
     left:  "warning: the VM is running with native name encoding of latin1 which may cause Elixir to malfunction as it expects utf8. Please ensure your locale is set to UTF-8 (which can be verified by running \"locale\" in your shell)\nok\n"
     right: "ok\n"
     stacktrace:
       test/elixir/kernel/cli_test.exs:162: (test)

.........................................................................................................................................................................................................................................................................................................................................................................................................

  5) test fails on wrong arguments (Kernel.CLI.RPCTest)
     test/elixir/kernel/cli_test.exs:180
     Assertion with == failed
     code:  assert elixir(~c"--name #{node}@127.0.0.1 --rpc-eval") == "--rpc-eval : wrong number of arguments\n"
     left:  "warning: the VM is running with native name encoding of latin1 which may cause Elixir to malfunction as it expects utf8. Please ensure your locale is set to UTF-8 (which can be verified by running \"locale\" in your shell)\n--rpc-eval : wrong number of arguments\n"
     right: "--rpc-eval : wrong number of arguments\n"
     stacktrace:
       test/elixir/kernel/cli_test.exs:183: (test)

.............

  6) test compiles code (Kernel.CLI.CompileTest)
     test/elixir/kernel/cli_test.exs:224
     Assertion with == failed
     code:  assert elixirc(~c"#{context.fixture} -o #{context.tmp_dir}") == ""
     left:  "warning: the VM is running with native name encoding of latin1 which may cause Elixir to malfunction as it expects utf8. Please ensure your locale is set to UTF-8 (which can be verified by running \"locale\" in your shell)\n"
     right: ""
     stacktrace:
       test/elixir/kernel/cli_test.exs:225: (test)

.....................................................hend=0x00000db2209c4b68
stop=0x00000db2209c4ad0
htop=0x00000db2209c4ad8
heap=0x00000db2209c3858
beam/erl_gc.c, line 726: <0.11234.0>: Overrun stack and heap
Abort trap (core dumped) 
gmake: *** [Makefile:276: test_stdlib] Error 134

The problems seem to come from encoding but my output for locale show than my locales are on UTF-8 :

LANG=fr_FR.UTF-8
LC_COLLATE="fr_FR.UTF-8"
LC_CTYPE="fr_FR.UTF-8"
LC_MONETARY="fr_FR.UTF-8"
LC_NUMERIC="fr_FR.UTF-8"
LC_TIME="fr_FR.UTF-8"
LC_MESSAGES="fr_FR.UTF-8"
LC_ALL=fr_FR.UTF-8
2 Likes

Hi Guru2, and welcome to the forums,

I woudl try leaving LC_ALL empty LC_ALL=

More info Always got "Please ensure your locale is set to UTF-8" · Issue #3548 · elixir-lang/elixir · GitHub

I have been there and the only way for me to solve it was setting this variable empty.

2 Likes

Thank you :slight_smile: but the errors are still there with LC_ALL= or with unset LC_ALL

Is it that LANG=fr_FR.UTF-8 is same than LANG="fr_FR.UTF-8" ?

I have some var value with “” and other without

$ locale
LANG=fr_FR.UTF-8
LC_COLLATE="fr_FR.UTF-8"
LC_CTYPE="fr_FR.UTF-8"
LC_MONETARY="fr_FR.UTF-8"
LC_NUMERIC="fr_FR.UTF-8"
LC_TIME="fr_FR.UTF-8"
LC_MESSAGES="fr_FR.UTF-8"
LC_ALL=

looks good to me.
Here’s the output of mine.

$ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

You can switch to en_US.UTF-8 and move back from there to fr_FR to rule things out.

EDIT: I’m running Linux though.

my output

$ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_ALL=

Same errors, I think the problem come from OpenBSD or my Shell ?

Do you restart your shell after the changes in locale?

try export LC_CTYPE="fr_FR.UTF-8" before running your gmake command.
I read this is important for OpenBSD

Do you restart your shell after the changes in locale?

No I had not restart

try export LC_CTYPE="fr_FR.UTF-8" before running your gmake command. I read this is important for OpenBSD

Same issue unfortunatly