Module :epp_dodger is not available

:wave: Getting this error when trying to compile an empty project with the x509 dependency, I have OTP and Elixir compiled from source so I may be missing something but not sure what it is.

== Compilation error in file lib/x509/asn1.ex ==
** (UndefinedFunctionError) function :epp_dodger.parse_file/1 is undefined (module :epp_dodger is not available)
    :epp_dodger.parse_file(~c"/usr/local/lib/erlang/lib/public_key-1.14/include/OTP-PUB-KEY.hrl")
    lib/x509/asn1/oid_import.ex:19: X509.ASN1.OIDImport.get_oids/1
    lib/x509/asn1.ex:84: (module)
could not compile dependency :x509, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile x509 --force", update it with "mix deps.update x509" or clean it with "mix deps.clean x509"

It’s weird because the :epp_dodger module is available in iex:

❯ iex
Erlang/OTP 26 [erts-14.0] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [jit:ns]

Interactive Elixir (1.15.0-rc.1) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> :epp_dodger.
format_error/1        parse/1               parse/2               parse/3               parse_file/1
parse_file/2          parse_form/2          parse_form/3          quick_parse/1         quick_parse/2
quick_parse/3         quick_parse_file/1    quick_parse_file/2    quick_parse_form/2    quick_parse_form/3
tokens_to_string/1

I believe the reason is x509 is missing :syntax_tools in :extra_applications in its mix.exs.

1 Like

Oh I see thank you. I’ll open up a PR to fix it. It seems that it only triggered with Elixir 1.15.

PS: nevermind I guess there is already one up Add syntax_tools to extra_applications to fix compilation on Elixir 1.15 by michallepicki · Pull Request #53 · voltone/x509 · GitHub

1 Like

Does anyone know how to specify a compile-time only dependency in a way that makes the 1.15 compiler happy, but doesn’t include it in releases?

Though I don’t know if you can do this for Erlang bits :person_shrugging:

@wojtekmach submitted an alternative fix that programmatically loads the OTP application at compile-time with Mix.ensure_application/1

1 Like

@wojtekmach 's fix was published as part of v0.8.7. Thanks everyone for your input!

1 Like