Skip to content

config: Fix ngx_module_type #51

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 20, 2016
Merged

config: Fix ngx_module_type #51

merged 1 commit into from
Oct 20, 2016

Conversation

Whissi
Copy link
Contributor

@Whissi Whissi commented Oct 19, 2016

Since commit 37182ce the module was always build as dynamic module.
Probably because following a bad skeleton [1].

With this change we will only build a dynamic module when requested. Otherwise
we will fall back to static build.

Link: https://trac.nginx.org/nginx/ticket/1115
Gentoo-Bug: https://bugs.gentoo.org/593450
Fixes: #50

@Whissi
Copy link
Contributor Author

Whissi commented Oct 19, 2016

Please wait for upstream response in ticket https://trac.nginx.org/nginx/ticket/1115 before merging.

@masterzen
Copy link
Owner

@Whissi can you ping me in this PR or the original bug when we get a definitive answer in the Nginx ticket?

@Whissi
Copy link
Contributor Author

Whissi commented Oct 19, 2016

Yep.

Since commit 37182ce the module was not present in static builds
because due to an invalid "ngx_module_type" the module was not added to
objs/ngx_modules.c.

This commit will fix the problem by setting the correct module type
"HTTP_FILTER" [Link 1].

Link 1: https://www.nginx.com/resources/wiki/extending/new_config/#key-ngx_module_type
Gentoo-Bug: https://bugs.gentoo.org/593450
Fixes: masterzen#50
@Whissi
Copy link
Contributor Author

Whissi commented Oct 20, 2016

OK, I was wrong. Nginx upstream closed my ticket as invalid. The problem wasn't that the check was invalid (the check was correct; the only purpose of the check was to determine if the "new" build system/script can be used or not), the problem was that an invalid ngx_module_type was set.

auto/module runs

    eval ${ngx_module_type}_MODULES=\"\$${ngx_module_type}_MODULES \
                                      $ngx_module_name\"

so the set value FILTER caused the module to be registered in the FILTER_MODULES variable.

However that's an unsupported type (see https://www.nginx.com/resources/wiki/extending/new_config/#key-ngx_module_type for supported types), i.e. the auto/modules script only honors

    modules="$modules $HTTP_MODULES $HTTP_FILTER_MODULES \
             $HTTP_AUX_FILTER_MODULES $HTTP_INIT_FILTER_MODULES"

with the result that the module was never recorded in objs/ngx_modules.c (however the module was built at all because the source files were added to NGX_ADDON_SRCS).

The first proposed patch worked because it ensured that the old code was used which used the correct module type (see

HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES ngx_http_uploadprogress_module"
).

I updated the PR; This can now be finally merged :)

@Whissi Whissi changed the title config: Only build as dynamic module when really requested config: Fix ngx_module_type Oct 20, 2016
@masterzen
Copy link
Owner

@Whissi many thanks for the explanations and this PR!
Merging.

@masterzen masterzen merged commit afb2d31 into masterzen:master Oct 20, 2016
@pgaertig
Copy link

pgaertig commented Dec 19, 2016

@masterzen thanks for the merge, would it be fine to release 0.9.3? I try to avoid dependency on live master branch in my nginx build script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants