Support automatic dependency generation for Erlang packages

Bug #392383 reported by James Henstridge
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
erlang (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: erlang

When working to reduce the dependency list for the couchdb and rabbitmq-server packages, I did it by reading the source code then trial and error. This is time consuming and may need to be repeated as the upstream source changes.

It would be nice if the dependencies could be automatically generated, similar to how dh_shlibdeps does for C/C++ libraries. The module dependency information is encoded in the compiled BEAM files, so we should be able to determine which packages provide the given modules.

Revision history for this message
James Henstridge (jamesh) wrote :

The attached script can resolve the external dependencies of a directory tree of BEAM files to the Debian packages that provide those dependencies.

Example output for couchdb:

    $ ./get-erlang-deps.py /usr/lib/couchdb/erlang/lib
    WARNING: could not find module fdsrv
    erlang-base required to for modules erlang, init, application, code, erl_ddll, error_logger, file, gen_tcp, inet, inet_parse, os, c, calendar, dict, erl_parse, erl_scan, ets, filelib, filename, gb_trees, gen_event, gen_server, io, io_lib, lists, math, proc_lib, proplists, queue, random, regexp, string, supervisor, timer
    erlang-crypto required to for modules crypto
    erlang-inets required to for modules httpd_util
    erlang-ssl required to for modules ssl
    erlang-tools required to for modules make
    erlang-xmerl required to for modules xmerl_ucs

And for rabbitmq-server:

    $ ./get-erlang-deps.py /usr/lib/erlang/lib/rabbitmq_server-1.5.5
    erlang-base required to for modules erlang, init, prim_inet, application, disk_log, error_logger, file, gen_tcp, inet, inet_db, inet_parse, net_adm, net_kernel, os, rpc, alarm_handler, sasl_report_file_h, dict, error_logger_file_h, ets, filelib, filename, gen_event, gen_server, io, io_lib, lists, proc_lib, qlc, queue, regexp, sets, string, supervisor, sys, timer
    erlang-mnesia required to for modules mnesia
    erlang-os-mon required to for modules cpu_sup, os_mon
    erlang-ssl required to for modules ssl_base64
    erlang-tools required to for modules cover, fprof

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.