[erlang-questions] Setting the proper source in a module compiled via compile:forms

José Valim <>
Thu Mar 22 21:33:54 CET 2012


>
> Sorry, I missed that point. The -file declarations are for getting the
> correct debugging info and compiler error messages. The source entry in
> module_info is a different thing. Looking in compile.erl, it seems that if
> you compile from forms, the source file is always set to "" (and then
> later, a call to dirname() turns this into ".", which is then passed to
> absname() before it is sent to beam_asm, so that's why you get your current
> directory). Perhaps you could patch compile.erl and submit your change to
> ?


Thanks for the reply.
I will work on a patch, what do you think about compile:forms(Forms,
[{source,"path/to/source"]}) as API?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20120322/d7dcf87e/attachment.html>


More information about the erlang-questions mailing list