Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

erts application not found on master #12431

Closed
jeremyjh opened this issue Feb 27, 2023 · 6 comments
Closed

erts application not found on master #12431

jeremyjh opened this issue Feb 27, 2023 · 6 comments

Comments

@jeremyjh
Copy link
Contributor

Elixir and Erlang/OTP versions

elixir --version
Erlang/OTP 25 [erts-13.1.4] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [jit:ns]

Elixir 1.15.0-dev (1324ca7) (compiled with Erlang/OTP 24)

Operating system

MacOS

Current behavior

I get an error about not being able to find erts application and core Erlang modules are missing:

iex -S mix
iex(1)> Application.ensure_started(:erts)
{:error, {~c"no such file or directory", ~c"erts.app"}}
iex(2)> :prettpr.text('hello')
** (UndefinedFunctionError) function :prettpr.text/1 is undefined (module :prettpr is not available)
    :prettpr.text(~c"hello")
iex(2)>

This was originally reported in jeremyjh/dialyxir#478

Expected behavior

With the same version of OTP in Elixir 1.14.3 I get the expected output:

iex(8)> :prettypr.text('hi')
{:text, [2, 104, 105]}
iex(9)> Application.ensure_started(:erts)
:ok
iex(10)>
@josevalim
Copy link
Member

Hi @jeremyjh, thank you for the report!

:prettypr is part of the syntax_tools application, which you must add to your extra_applications in your mix.exs.

@josevalim
Copy link
Member

PR sent here: jeremyjh/dialyxir#479

Note I didn't test it. :)

@jeremyjh
Copy link
Contributor Author

Thanks! I also needed to add erts to extra_applications but this works.

@josevalim
Copy link
Member

you should not need to add erts to extra applications. but note that prettyptr is not an application.

@jeremyjh
Copy link
Contributor Author

If I do not add erts as an extra application, I get an error when I try to add it to the PLT:

Unknown application :erts

And then I get all kinds of dialyzer errors on those functions:

/home/build/elixir/lib/elixir/lib/application.ex:0:unknown_function
Function :erlang.get_module_info/1 does not exist.
________________________________________________________________________________
/home/build/elixir/lib/elixir/lib/application.ex:0:unknown_function
Function :erlang.get_module_info/2 does not exist.

@josevalim
Copy link
Member

Hrm, interesting. So yeah, ship it. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants