Using single script files and Mix.install on Windows

I am using Elixir for a simple script that I wanted to use as a single file script rather than a full mix project. My simplified script looks like this:

Mix.install([ 
  :req, 
  {:toml, "~> 0.7.0"},
  {:elixir_uuid, "~> 1.2"}
])

IO.puts("?")

If I delete the Mix.install parts the script runs to completion. On my Mac the script runs fine without deleting anything. On windows though, the script just ends without doing anything of interest.

Is Windows support just too poor or am I doing something wrong here?

I’ve had no problems with them.

How are you running it?

I am doing

C:\Users\tallakt>elixir test.exs
==> elixir_uuid
Compiling 1 file (.ex)
warning: use Bitwise is deprecated. import Bitwise instead
  lib/uuid.ex:2: UUID (module)


C:\Users\tallakt>elixir --version
Erlang/OTP 26 [erts-14.0.2] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [jit:ns]

Elixir 1.15.4 (compiled with Erlang/OTP 26)

C:\Users\tallakt>

Could it be that I am running on Arm Windows (using Mac and Parallels)?

I also see now I am getting a erl_crash_dump startig with the lines

=erl_crash_dump:0.5
Mon Oct 23 22:29:33 2023
Slogan: Runtime terminating during boot ({badarg,[{ets,lookup_element,[elixir_modules,Elixir.MIME,2],[{_}]},{elixir_module,data_tables,1,[{_},{_}]},{Elixir.Kernel.Typespec,deftypespec,6,[{_},{_}]},{Elixir.Inspect.Integer,__impl__,1,[]},{Elixir.Inspect,impl_for,1,[{_},{_}]},{Elixir.Inspect,inspect,2,[{_},{_}]},{Elixir.Inspect.Algebra,container_each,6,[{_},{_}]},{Elixir.Inspect.Algebra,container_doc,6,[{_},{_}]}]})
System version: Erlang/OTP 26 [erts-14.0.2] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [jit:ns]
Taints: asn1rt_nif,crypto
Atoms: 26864
Calling Thread: scheduler:1

And it installs perfectly on an Intel machine

How are you installing OTP on your arm windows? I would suggest building it from source, as this seems to be a problem related to some nifs.

1 Like

I had a look. It looks like an option, but it could not be feasible in our organization due to the complexities involved, and to support this single script