Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

Support building ngx_pagespeed as a dynamic module #1115

Merged
merged 1 commit into from Feb 16, 2016

Conversation

oschaaf
Copy link
Member

@oschaaf oschaaf commented Feb 10, 2016

As of 1.9.11, nginx supports loading dynamic modules
This change makes us support building ngx_pagespeed.so

Fixes #1116

@PiotrSikora
Copy link
Contributor

This looks very wrong to me, this patch:

  1. always compilies both modules as static modules, even when compiling as a dynamic modules (using --add-dynamic-module),
  2. misuses ngx_module_order, which doesn't work with filters running after current filter, only earlier ones.

See: google/ngx_brotli@86998c6

@oschaaf oschaaf force-pushed the oschaaf-trunk-tracking-dynamic-modules branch from 87ef771 to 297cee1 Compare February 10, 2016 20:06
@oschaaf
Copy link
Member Author

oschaaf commented Feb 10, 2016

@PiotrSikora Updated and force pushed. This will need to be rebased, but does this look better?

@PiotrSikora
Copy link
Contributor

@oschaaf: looks good, but it seems that you also need to modify config.make in order to pass --std=c++11 when compiling with clang, otherwise it doesn't build.

Also, ngx_http_brotli_filter_module and ngx_http_gzip_filter_module should switch places.

@oschaaf oschaaf force-pushed the oschaaf-trunk-tracking-dynamic-modules branch from 297cee1 to 1748d93 Compare February 11, 2016 12:58
@oschaaf oschaaf changed the title dynamic-modules: changes to support building dynamic modules Support building ngx_pagespeed as a dynamic module Feb 11, 2016
else
module=ngx_http_range_header_filter_module
# config.make is not executed for dynamic modules
CFLAGS="$CFLAGS -Wno-c++11-extensions"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PiotrSikora config.make is not executed for dynamic modules, see https://github.com/nginx/nginx/blob/master/auto/make#L436

So this is the best I can come up with to allow us to build ngx_pagespeed.so with clang

@oschaaf
Copy link
Member Author

oschaaf commented Feb 11, 2016

@PiotrSikora Comments addressed & force pushed

if [ $ngx_module_link != DYNAMIC ]; then
# ngx_module_order doesn't work with static modules,
# so we must re-order filters here.
HTTP_FILTER_MODULES=`echo $HTTP_FILTER_MODULES \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style: this module uses $(...) for shell commands, so we should be consistent about it.

@PiotrSikora
Copy link
Contributor

@oschaaf: thanks, LGTM (other than the stuff that I commented on, which can be mostly ignored).

As of 1.9.11, nginx supports loading dynamic modules
This change makes us support building ngx_pagespeed.so

Fixes #1116
@oschaaf oschaaf force-pushed the oschaaf-trunk-tracking-dynamic-modules branch from 1748d93 to 09f5388 Compare February 13, 2016 22:39
@oschaaf
Copy link
Member Author

oschaaf commented Feb 13, 2016

@PiotrSikora Thanks for reviewing! I updated to address your latest comments.

@crowell
Copy link
Contributor

crowell commented Feb 16, 2016

@oschaaf is this ready to merge?

@oschaaf
Copy link
Member Author

oschaaf commented Feb 16, 2016

@crowell yes

@crowell
Copy link
Contributor

crowell commented Feb 16, 2016

LGTM, backported and tested on master.

crowell added a commit that referenced this pull request Feb 16, 2016
…c-modules

 Support building ngx_pagespeed as a dynamic module
@crowell crowell merged commit d959f01 into trunk-tracking Feb 16, 2016
@oschaaf oschaaf deleted the oschaaf-trunk-tracking-dynamic-modules branch July 5, 2016 06:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants