You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Albin Stigö <al...@gmail.com> on 2011/12/08 15:14:26 UTC

Building without debug symbols

Hi,

I'm trying build a version of couchdb to embed with a mac app I'm
writing, so I'd like it to be as small as possible.

Is there an easy way of building it without any debug symbols?

Any other ideas for making it as small as possible are very welcome!

Cheers,
Albin

Re: Building without debug symbols

Posted by Jens Alfke <je...@couchbase.com>.
On Dec 8, 2011, at 11:17 AM, Albin Stigö wrote:

> I actually meant stripping the erlang .beam files as apparently you
> can save up to 50% space this way… 

Oh! Here’s the command we use to do this in building Couchbase Mobile:

	erl -noinput -eval 'erlang:display(beam_lib:strip_release("."))' -s init stop

where “.” is the path to the Erlang root directory, i.e. the one containing subdirectories for all the apps/packages.

Also, make sure to use the “+compressed” parameter to erlc, which will gzip the .beam files.

—Jens


Re: Building without debug symbols

Posted by Albin Stigö <al...@gmail.com>.
Hi,

> The ‘strip’ tool will remove debug symbols. You can run it manually, or configure the target settings in Xcode to do it — IIRC, in the ‘Deployment’ section you have to enable Deployment Postprocessing and Strip Linked Product.

I actually meant stripping the erlang .beam files as apparently you
can save up to 50% space this way... But I didn't know about the nm
tool so I will definitely keep that in mind :-)

> Also, as I said recently on the mobile-couchbase list, I’ve got an unfinished project to build > Couchbase Mobile on Mac OS X as a dynamic-linked framework. If someone else wants to > take it over and get it running again, I’ll gladly share the branch.

I'm not sure I'm hardcare enough for that hacking but I would be nice
if you could put it up somewhere and see if someone picks it up!

Right now I'm trying to walk down the same path as wings3d. Just
copying erlang runtime systems necessary files into the bundle and
using NSTask to spawn a process. I think also the the mac app version
of couchbase single server does this. Then I can just use the standard
couchdb build.

--Albin

On Thu, Dec 8, 2011 at 6:42 PM, Jens Alfke <je...@couchbase.com> wrote:
>
> On Dec 8, 2011, at 6:14 AM, Albin Stigö wrote:
>
> I'm trying build a version of couchdb to embed with a mac app I'm
> writing, so I'd like it to be as small as possible.
> Is there an easy way of building it without any debug symbols?
>
> The ‘strip’ tool will remove debug symbols. You can run it manually, or configure the target settings in Xcode to do it — IIRC, in the ‘Deployment’ section you have to enable Deployment Postprocessing and Strip Linked Product.
>
> The ‘nm’ tool is very useful for checking that you’ve eliminated unnecessary symbols.
>
> Also, as I said recently on the mobile-couchbase list, I’ve got an unfinished project to build Couchbase Mobile on Mac OS X as a dynamic-linked framework. If someone else wants to take it over and get it running again, I’ll gladly share the branch.
>
> —Jens

Re: Building without debug symbols

Posted by Jens Alfke <je...@couchbase.com>.
On Dec 8, 2011, at 6:14 AM, Albin Stigö wrote:

I'm trying build a version of couchdb to embed with a mac app I'm
writing, so I'd like it to be as small as possible.
Is there an easy way of building it without any debug symbols?

The ‘strip’ tool will remove debug symbols. You can run it manually, or configure the target settings in Xcode to do it — IIRC, in the ‘Deployment’ section you have to enable Deployment Postprocessing and Strip Linked Product.

The ‘nm’ tool is very useful for checking that you’ve eliminated unnecessary symbols.

Also, as I said recently on the mobile-couchbase list, I’ve got an unfinished project to build Couchbase Mobile on Mac OS X as a dynamic-linked framework. If someone else wants to take it over and get it running again, I’ll gladly share the branch.

—Jens