[erlang-questions] int:find_src/2, shell:try_source/2 ignore the obvious place to find source files?

Roger Lipscombe roger@REDACTED
Tue May 30 16:45:41 CEST 2017


When compiling some Erlang source files with mix, I discovered that it
leaves out the abstract_code chunk.

This means that rr(Mod) -- implemented in shell:read_file_records/2 --
falls through to shell:try_source/2, which looks in the "CInf" chunk. It
then uses the 'options'.'outdir' value and attempts to recreate the source
path from that.

That is: given the following:

[{options, [{outdir, "/home/roger/Source/foo/bar/_build/dev/lib/baz/ebin"},
           {i,"include"}]},
 {version,"7.0.4"},
 {source,"/home/roger/Source/foo/bar/baz/src/quux.erl"}]

...it'll look for
"/home/roger/Source/foo/bar/_build/dev/lib/baz/ebin/quux.erl" and
"/home/roger/Source/foo/bar/_build/dev/lib/baz/src/quux.erl", which don't
exist.

int:find_src/2 does the same.

It seems to me that the correct behaviour would be to use the 'source'
property, if present...?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20170530/ace35427/attachment.htm>


More information about the erlang-questions mailing list