[erlang-questions] Using Dialyzer on Ubuntu 9.10?

8 views
Skip to first unread message

Jeremy Raymond

unread,
Dec 18, 2009, 11:37:34 AM12/18/09
to Erlang-Questions Questions
Hello,

I'm attempting to run dialyzer on my code on Ubuntu 9.10 with the Erlang
version (R13B01) that ships with Ubuntu. Dialyzer tells me I need to build
my plt file. When I attempt to do so by running the command:

dialyzer --build_plt -r
/usr/lib/erlang/lib/{compiler-*,kernel-*,dialyzer-*,erts-*,stdlib-*}/ebin

I get the error message, 'dialyzer: Could not get abstract code for
file...'. Searching online it seems that the debug info has been stripped
out of the beam files of the Erlang shipped with Ubuntu to reduce the size
as per: https://bugs.launchpad.net/ubuntu/+source/erlang/+bug/385093.

Do I need to download/compiler Erlang myself with the debug info to use
dialyzer or am I missing something here (can I find the debug info somewhere
else)?


Thanks,

Jeremy

Michael

unread,
Dec 18, 2009, 11:43:21 AM12/18/09
to erlang-q...@erlang.org
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

does this work ? ...

$ dialyzer --build_plt --apps compiler kernel dialyzer erts stdlib


~Michael

________________________________________________________________
erlang-questions mailing list. See http://www.erlang.org/faq.html
erlang-questions (at) erlang.org

Kostis Sagonas

unread,
Dec 18, 2009, 11:52:07 AM12/18/09
to Erlang-Questions Questions, Jeremy Raymond

I think you should do yourself a favour and scrap the Ubuntu Erlang
package and instead go for installing yourself the source version of
R13B03, which builds .beam files with debug_info in them (as it should).

Besides the ability to run dialyzer on your code, you will end up with a
better/newer Erlang system. The installation process itself should be
trivial.

Kostis

Jeremy Raymond

unread,
Dec 18, 2009, 12:03:47 PM12/18/09
to erlang-q...@erlang.org
No: dialyzer: Unknown option: --apps

Laura Milagros Castro Souto

unread,
Dec 18, 2009, 11:46:34 AM12/18/09
to erlang-q...@erlang.org

Hello Jeremy:

> Do I need to download/compiler Erlang myself with the debug info to use
> dialyzer or am I missing something here (can I find the debug info
> somewhere else)?

I run myself into exactly the same situation a few weeks ago. I might be
mistaken but I think you need to either download the sources and compile
Erlang yourself (with the proper configuration), or else download the .deb files
from another distribution which may be packaged with different compilation
options. The latter is what I did, specifically Debian package files.

Regards,

--
Laura M. Castro
MADS Group - Computer Science Department
University of A Corunna
http://www.madsgroup.org/staff/laura/index_en.html

signature.asc

Jeremy Raymond

unread,
Dec 18, 2009, 1:14:33 PM12/18/09
to lca...@udc.es, erlang-q...@erlang.org
I've successfully downloaded, compiled, and installed R13B03. Dialyzer is
currently building the plt file.

The Ubuntu default Erlang install is located at:
/usr/{bin, lib/erlang, etc}
and the version I built myself goes to
/usr/local/{bin, lib/erlang, etc}
so there's no conflict on the install.

In the future when I download a newer Erlang version, compile it and install
it again, do I need to manually delete the old install (if I want the same
location) or will the new version do the right thing on make install and
just overwrite the current install?


Thanks,

Jeremy


2009/12/18 Laura Milagros Castro Souto <lca...@udc.es>

Bernard Duggan

unread,
Dec 18, 2009, 1:25:37 PM12/18/09
to Jeremy Raymond, erlang-q...@erlang.org
Jeremy Raymond wrote:
> I've successfully downloaded, compiled, and installed R13B03. Dialyzer is
> currently building the plt file.
>
> The Ubuntu default Erlang install is located at:
> /usr/{bin, lib/erlang, etc}
> and the version I built myself goes to
> /usr/local/{bin, lib/erlang, etc}
> so there's no conflict on the install.
>
I'd strongly recommend removing the packaged install unless you have a
really good reason to keep it, because otherwise at some point I'll
guarantee you that that parallel installation will trip you up.

> In the future when I download a newer Erlang version, compile it and install
> it again, do I need to manually delete the old install (if I want the same
> location) or will the new version do the right thing on make install and
> just overwrite the current install?
>

You don't really need to manually delete it (at least not in my
empirical experience), but what you'll find is that the
/usr/local/lib/erlang/lib directory will continue to acquire more and
more subdirectories, since they're named by the version of the library,
so the new ones won't overwrite the old ones. Erlang will always
correctly select the newest one, so it's more of a tidiness issue than
any problem with functionality.

I don't have a nice solution for this, unfortunately - there doesn't
seem to be an 'uninstall' make target...anyone got a suggestion?

Cheers,

Bernard

Jeremy Raymond

unread,
Dec 18, 2009, 1:43:45 PM12/18/09
to Bernard Duggan, erlang-q...@erlang.org
I was keeping the packaged install because I have other installed packages
(couchdb) dependent upon it.

Lovei Laszlo

unread,
Dec 19, 2009, 5:50:09 AM12/19/09
to Erlang-Questions Questions
Kostis Sagonas wrote:

> Jeremy Raymond wrote:
>>
>> Do I need to download/compiler Erlang myself with the debug info to use
>> dialyzer or am I missing something here (can I find the debug info
>> somewhere
>> else)?
>
> I think you should do yourself a favour and scrap the Ubuntu Erlang
> package and instead go for installing yourself the source version of
> R13B03, which builds .beam files with debug_info in them (as it should).

Why does Dialyzer not support building plt from source code? It would be
an easy solution to install the packaged OTP sources and generate the
plt from them.

> Besides the ability to run dialyzer on your code, you will end up with a
> better/newer Erlang system. The installation process itself should be
> trivial.

You have a point here, but using packaged software has its own
advantages too, and Erlang packages in Debian are getting better and
better. (Maybe there will be packages built with debug_info sometime,
who knows.)


Laszlo

Zoltan Lajos Kis

unread,
Dec 19, 2009, 5:57:18 AM12/19/09
to Erlang-Questions Questions
I still believe the best of both worlds would be to package a pre-built
plt along with Erlang.
But I have no idea how packaging works, so this might be less trivial
than it sounds...

Regards,
Zoltan.

Kostis Sagonas

unread,
Dec 19, 2009, 6:05:00 AM12/19/09
to Erlang-Questions Questions, Lovei Laszlo
Lovei Laszlo wrote:
> Kostis Sagonas wrote:
>> Jeremy Raymond wrote:
>>>
>>> Do I need to download/compiler Erlang myself with the debug info to use
>>> dialyzer or am I missing something here (can I find the debug info
>>> somewhere
>>> else)?
>>
>> I think you should do yourself a favour and scrap the Ubuntu Erlang
>> package and instead go for installing yourself the source version of
>> R13B03, which builds .beam files with debug_info in them (as it should).
>
> Why does Dialyzer not support building plt from source code?

It does. But I doubt that the Ubuntu erlang package includes the source
code for libs.

> It would be
> an easy solution to install the packaged OTP sources and generate the
> plt from them.
>
>> Besides the ability to run dialyzer on your code, you will end up with
>> a better/newer Erlang system. The installation process itself should
>> be trivial.
>
> You have a point here, but using packaged software has its own
> advantages too, and Erlang packages in Debian are getting better and
> better. (Maybe there will be packages built with debug_info sometime,
> who knows.)

In Debian yes. In Ubuntu not. Apparently, the Ubuntu people who
decided distributing erlang without debug_info do not fully understand
the consequences of their action (and their excuse is lame). Somebody
who cares about Ubuntu should tell them.

Kostis

Lovei Laszlo

unread,
Dec 19, 2009, 6:29:40 AM12/19/09
to erlang-questions
Kostis Sagonas írta:

> Lovei Laszlo wrote:
>>
>> Why does Dialyzer not support building plt from source code?
>
> It does.

That's great, how can I do that? "dialyzer --src --build_plt" says "Byte
code compiled with debug_info is needed to build the PLT" (at least
versions 1.9.2 and 2.1.0).

> But I doubt that the Ubuntu erlang package includes the source
> code for libs.

Well, it doesn't, but at least there is a separate erlang-src package
which contains all the sources. (So much for preserving disk
space/bandwidth by excluding debug_info...)


Laszlo

Mikael Magnusson

unread,
Dec 19, 2009, 10:10:49 AM12/19/09
to Erlang-Questions Questions
On Sat, 2009-12-19 at 13:05 +0200, Kostis Sagonas wrote:
> Lovei Laszlo wrote:
> > Kostis Sagonas wrote:
> >> Besides the ability to run dialyzer on your code, you will end up with
> >> a better/newer Erlang system. The installation process itself should
> >> be trivial.
> >
> > You have a point here, but using packaged software has its own
> > advantages too, and Erlang packages in Debian are getting better and
> > better. (Maybe there will be packages built with debug_info sometime,
> > who knows.)
>
> In Debian yes. In Ubuntu not. Apparently, the Ubuntu people who
> decided distributing erlang without debug_info do not fully understand
> the consequences of their action (and their excuse is lame). Somebody
> who cares about Ubuntu should tell them.
>
> Kostis
>

According to the change logs the patch that disables debug info in
Ubuntu 9.10 was inherited from Debian:

http://packages.debian.org/changelogs/pool/main/e/erlang/erlang_13.b.2.1-dfsg-1/changelog
http://changelogs.ubuntu.com/changelogs/pool/main/e/erlang/erlang_13.b.1-dfsg-2ubuntu1/changelog

/Mikael

Jeremy Raymond

unread,
Dec 19, 2009, 12:25:59 PM12/19/09
to Mikael Magnusson, Erlang-Questions Questions
You're right - it looks like it was taken out in Debian in 1:13.b.1-dfsg-2
but restored in 1:13.b.1-dfsg-6:

* Restored debug info in beam files for default build. It's better to use
more space than to ship broken modules (debugger, dialyzer)...

However Ubuntu (obviously) is still without them. I posted a question on the
Ubuntu bug related to this asking if they've included them anywhere else as
an alternative as they discussed this in the issue.

Jeremy

Jeremy Raymond

unread,
Dec 19, 2009, 12:34:09 PM12/19/09
to Mikael Magnusson, Erlang-Questions Questions
I've submitted a bug against Ubuntu to see if they'll put the debug info
back in. Feel free to tag this issue as 'affecting you' if interested.

https://bugs.launchpad.net/ubuntu/+source/erlang/+bug/498558

<https://bugs.launchpad.net/ubuntu/+source/erlang/+bug/498558>Jeremy

Lovei Laszlo

unread,
Dec 19, 2009, 4:00:56 PM12/19/09
to erlang-questions
Tobias Lindahl wrote:
> 2009/12/19 Lovei Laszlo <lo...@elte.hu>:

>> Why does Dialyzer not support building plt from source code?
> Actually it does. You just need to provide the --src to do this.

I believe you that it is capable to support it, but it doesn't do so.
The "--src" and "--build_plt" options are simply not accepted together.
(I have tried it before asking, really.)

> The problem, however, is that you also need to provide all includes,
> defines and such that exists in the Makefiles.

Thanks, this explains all.

Elliot Murphy

unread,
Dec 19, 2009, 11:54:30 PM12/19/09
to Kostis Sagonas, erlang-q...@erlang.org, Lovei Laszlo
2009/12/19 Kostis Sagonas <kos...@cs.ntua.gr>:

> Lovei Laszlo wrote:
>> You have a point here, but using packaged software has its own advantages
>> too, and Erlang packages in Debian are getting better and better. (Maybe
>> there will be packages built with debug_info sometime, who knows.)

Hi Lovei!

I made a PPA with the Ubuntu Erlang package rebuilt with debug info a
few minutes ago.
https://edge.launchpad.net/~erlang-dev/+archive/ppa
If you go to that page it will explain how to add the PPA to your
Ubuntu system, you should then be able to update and get a rebuilt
erlang package installed that included debug info.

I have no experience using Dialyzer myself, so I haven't confirmed
that the package works although I expect it to. If you or someone else
can confirm that the package works and actually contains the debug
info I'd appreciate that.

> In Debian yes.  In Ubuntu not.  Apparently, the Ubuntu people who decided
> distributing erlang without debug_info do not fully understand the
> consequences of their action (and their excuse is lame).  Somebody who cares
> about Ubuntu should tell them.

Wow Kostis that's a rather rude comment. What is the lame excuse that
you are talking about? From my firsthand knowledge of the situation in
both Debian and Ubuntu as it evolved (and speaking as the manager of
the dev team that petitioned to have Erlang included in the default
Ubuntu install), the Ubuntu developers do understand the consequences,
which are that building a smaller runtime made the erlang packages
small enough that we could fit them and CouchDB onto the LiveCD and
ship CouchDB installed by default for all desktop Ubuntu installs. I
realize this creates an inconvenience for Erlang developers who aren't
building Erlang from source, and just never got around to setting up
an alternate PPA. I do care about making Erlang development easy on
Ubuntu (although I am not an official Ubuntu developer), which is why
I'm working on setting up this PPA at 11:45 PM on a saturday night.

Jeremy, although I first noticed this discussion because of following
erlang-questions, I really appreciate you submitting that bug report
to Ubuntu and including all the details. I think the bug should be
closed as wontfix, and I hope the PPA that I set up helps solve the
problem. In fact, I'm open to working on getting newer releases of
Erlang into that or a similar PPA to make life even better for people
who are doing erlang development work on Ubuntu. My full response in
the bug is available here:
https://bugs.edge.launchpad.net/ubuntu/+source/erlang/+bug/498558/comments/2

--
Elliot Murphy | https://launchpad.net/~statik/

Jeremy Raymond

unread,
Dec 20, 2009, 11:12:32 AM12/20/09
to Elliot Murphy, Kostis Sagonas, erlang-q...@erlang.org, Lovei Laszlo
I've installed the Erlang packages with the erlang-dev ppa and the dialyzer
is happy. I'd love to see the newer Erlang releases available also as you
suggest in the bug comments. Is this much work to do?

Also where would one locate the general information about the Ubuntu Erlang
packages? I'd be great if the info on adding the Erlang dev ppa were
available wherever the normal documentation is for this. Had these ppa been
available earlier where would I have looked to know of it's existence? Where
can I get info on updates?

Thanks a lot. Your quick responses and support on this are much appreciated!

Elliot Murphy

unread,
Dec 21, 2009, 10:53:11 PM12/21/09
to Jeremy Raymond, erlang-q...@erlang.org
On Sun, Dec 20, 2009 at 11:12 AM, Jeremy Raymond <jera...@gmail.com> wrote:
> I've installed the Erlang packages with the erlang-dev ppa and the dialyzer
> is happy. I'd love to see the newer Erlang releases available also as you
> suggest in the bug comments. Is this much work to do?

A bit of work, but worth it I think, especially since all the work
Sergei is doing in debian can be reused.

In the last day or two Sergei uploaded r13b3 to debian. Tonight i
merged that to Ubuntu Lucid, and asked for a review (since I'm not an
Ubuntu developer I can propose changes but they have to be reviewed
and uploaded by an Ubuntu core dev).

I also built r13b3 for Karmic (9.10), and it's testbuilding in my
personal PPA now:
https://edge.launchpad.net/~statik/+archive/ppa/+packages
If that works ok it can be copied to the erlang-dev PPA I showed you earlier.

> Also where would one locate the general information about the Ubuntu Erlang
> packages? I'd be great if the info on adding the Erlang dev ppa were
> available wherever the normal documentation is for this. Had these ppa been
> available earlier where would I have looked to know of it's existence? Where
> can I get info on updates?

Thats a good question. I just created https://wiki.ubuntu.com/Erlang
with some basic info on it, you are welcome to extend this page as you
see fit.

> Thanks a lot. Your quick responses and support on this are much appreciated!

I'm happy to help. None of us working on Ubuntu have time to do
everything we want to do, so it's always nice to be able to fix
something quickly and help make things better. Since so much cool
software is being written in Erlang now, we definitely need more
people to learn how to package Erlang software for both Debian and
Ubuntu - if anyone wants to get involved, it would be most welcome.

-elliot

Reply all
Reply to author
Forward
0 new messages