Closed benoitc closed 12 years ago
Though I can see why it might be useful to not have the build fail when the dnssd app isn't core to the parent app, I'm not sure that this is the place to prevent the build failure.
rebar's dynamic configuration could be used in this app or it's parent to prevent the failure.
If it's possible to set an environment variable from the parent app (eg: DNSSD_ERLANG_FAIL_AT_RUNTIME
) I'm okay with providing an off by default workaround here that would let the build proceed, application:start(dnssd)
succeed and make all the operations return {error, missing_lib}
.
How does that sound?
I ignored this configuration settings. Maybe it's enough. Having "{error, missing_lib}" error would be definitely helpful anyway :)
If you still need this I can probably get to it at the end of this week. Just to be clear here's what I'm planning on doing:
winbuild.escript
into rebar.config.script
rebar.config.script
to check if the environment variable DNSSD_ERLANG_FAIL_AT_RUNTIME
is present and if so check if the requisites are available. If they're not remove the port_specs and define DNSSD_LIB_MISSING
for the Erlang compilerapplication:start(dnssd)
to succeed and for the ops to return {error, missing_lib}
if DNSSD_LIB_MISSING
is defined
Actually when you try to install on a machine where avahi isn't installed, the build of the application embedding dnssd_erlang will stop totally.
I think there could be a way to detect if the lib is not there and provide a dummy app that would return error on initially to have some lazy build. Maybe using a rebar plugin ?
Other way would be building it against static libs but i'm not sure it's actually possible.