Given the unreliability of using system libraries, nginx really does do
it right by building its own PCRE, OpenSSL, and zlib. However, lots of
extraneous stuff gets built for these items (such as manpages). This
drastically increases nginx build time, particularly for the OpenSSL
part.
Just try building nginx repeatedly for debugging purposes, and watching
those openssl manpage installations scroll by again and again, eating
precious iops and wall-clock time for no reason whatsoever—complete
waste!
If the nginx make system ran configure on its libraries to omit the all
stuff nginx doesn’t actually need, this would not waste resources, and
would significantly speed up build times. Really, nginx should tell
configure to just build the static libraries.
Mr. Sysoev, in the long term, the cumulative time you would save
yourself on test builds would probably more than make up for the time
you spend fixing this.
I agree with your comments. This might be useful, though, even if Igor
does make the changes you suggest:
If you’re debugging your own code for a module, then all you need to do
is run the installation once for each nginx version / openssl version
etc (including your module’s config file). On subsequent tests of your
module, do this:
compile your module’s code into an object file, making sure that the
path to the ngx headers ($ngx_src_dir/objs) that were generated in the
first compilation is in your include path
build a new nginx binary from all the object files that were created
in the first compilation (the list of which you see at the end of the
compilation process - though it might be easiest just to use ‘find’ to
generate the list automatically), plus the new object file in (1)
This reduces the compilation time to typically less than a second.
On Sun, Dec 13, 2009 at 06:20:30PM -0500, kyleb wrote:
Given the unreliability of using system libraries, nginx really does do it right by building its own PCRE, OpenSSL, and zlib. However, lots of extraneous stuff gets built for these items (such as manpages). This drastically increases nginx build time, particularly for the OpenSSL part.
I do not know the way to disable building OpenSSL mans: there is no such
option.
Just try building nginx repeatedly for debugging purposes, and watching those openssl manpage installations scroll by again and again, eating precious iops and wall-clock time for no reason whatsoever—complete waste!
If the nginx make system ran configure on its libraries to omit the all stuff nginx doesn’t actually need, this would not waste resources, and would significantly speed up build times. Really, nginx should tell configure to just build the static libraries.
Mr. Sysoev, in the long term, the cumulative time you would save yourself on test builds would probably more than make up for the time you spend fixing this.