Welcome! Log In Create A New Profile

Advanced

Re: Out-of-tree module building (PoC) for Linux Distro's.

Maxim Dounin
September 30, 2019 03:56PM
Hello!

On Mon, Sep 30, 2019 at 11:46:02AM -0700, Auke Kok wrote:

> Hi folks,
>
> In Clear Linux OS, we generally prefer to build DSO modules separately
> from the server code. We do this for e.g. php modules using `phpize`.
>
> For nginx, this is 3/4 of the way there, except it fails on the last
> part - modules instructions clearly indicate that modules, with all
> their dependencies, need to build together. But in reality, there is no
> technical reason for this.
>
> For Clear Linux therefore, I've come up with the following approach and
> it works really well, and therefore I'd like this to be considered as a
> PoC for possible inclusion/consideration so other distributions can
> benefit from the simplicity that it offers to Linux distributions.
>
> https://github.com/clearlinux-pkgs/nginx-mainline/blob/master/0003-Add-nginx-module-build-install-script.patch
>
> Now, this script is mostly still a terrible hack. I'm not properly
> fetching the nginx module names for instance. However, the method of
> installing header files saves us from having to include nginx source
> code in *every* nginx module, which will prevent lots of problems later on.
>
> Obviously a permanent solution would be for the module build system to
> properly -I/usr/include/nginx instead of copying headers, as well.

Building nginx module requires nginx source code. You can,
however, build nginx modules independently - that is, without
building other modules (except when there are dependencies), and
even nginx itself. There is a special "modules" target in the
top-level Makefile as generated by configure, which builds all the
modules configured in a particular source tree, but not nginx
itself - and it looks like you are aware of this make target.

The most important part to make sure that nginx and independently
built modules will work together is to keep configure arguments
compatible between builds. Most simple solution is to use
`--with-compat` configure flag when building nginx itself and all
the modules.

There are no plans to make it possible to build modules without
nginx source code. It is believed that nginx source code is small
enough to make little to no difference with dedicated "header
files only" install, and we don't want to bother with maintaining
such an install.

Note well that simply using all *.h files might not be enough.
For example, building with Sun C compiler uses *.il files for
assembler code.

--
Maxim Dounin
http://mdounin.ru/
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

Out-of-tree module building (PoC) for Linux Distro's.

Auke Kok 67 September 30, 2019 02:40PM

Re: Out-of-tree module building (PoC) for Linux Distro's.

Maxim Dounin 29 September 30, 2019 03:56PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 93
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready