erldocs / erldocs

Generate documentation for Erlang projects in the format of erldocs.com
erldocs.com
MIT License
58 stars 10 forks source link

{undef,[{docgen_otp_specs,module,[...]}]} in OTP 18.2 #49

Closed NobbZ closed 8 years ago

NobbZ commented 8 years ago

I don't know if this also happens with other 18.x, but with the latest OTP from erlang-solutions for ubuntu and debian it does happen.

I compiled erldocs from master (f042748) using the aforementioned erlang version. When I want to use it like ./erldocs . I do get the trace in this gist for every single file in the project. This example is the last block of output when trying to run erldocs in its own sourcedirectory.

fenollp commented 8 years ago

I am not sure how ESL distributes erlang on Debian. I compile from source using kerl or use Homebrew.

First make sure you have the erl_docgen app (which should be shipped with OTP). Your trace says docgen_otp_spes:module/2 is not found, which I can't replicate:

0 erldocs master λ find /usr/local -name docgen_otp_specs.erl
/usr/local/Cellar/erlang/18.2.1/lib/erlang/lib/erl_docgen-0.4.1/src/docgen_otp_specs.erl

Then cd into erldocs and run make test

NobbZ commented 8 years ago

As you can see, it is inplace:

% find /usr/lib/erlang -name '*docgen*'
/usr/lib/erlang/lib/erl_docgen-0.4.1
/usr/lib/erlang/lib/erl_docgen-0.4.1/src/docgen_otp_specs.erl
/usr/lib/erlang/lib/erl_docgen-0.4.1/src/docgen_edoc_xml_cb.erl
/usr/lib/erlang/lib/erl_docgen-0.4.1/src/docgen_xmerl_xml_cb.erl

Also this is in the code-path as far as I can see:

1> io:format("~p~n", [code:get_path()]).
[..., "/usr/lib/erlang/lib/erl_docgen-0.4.1", ...] % stripped

edit: Just tried make test, after a clean. As expected, erldocs is compiled first, then I do get output similar to the one above and make complains about errors.

NobbZ commented 8 years ago

I just left my laptop alone for a while and used evm to install 18.2. compiling and running tests using that do work.

Further testing shows that the version used to compile seems irrelevant. Regardless of which one I use for compiling, when I am running systems erlang, then I get the error described above, when I switch to evm's 18.2 everything works fine.

So it seems as if the escript isn't as self-contained as it should be. Or am I missing something on self-contained?

fenollp commented 8 years ago

Escripts are not supposed to contain OTP releases. You have an issue with ESL-packaged Erlang on your laptop, unrelated to erldocs.