phusion / passenger

A fast and robust web server and application server for Ruby, Python and Node.js
https://www.phusionpassenger.com/
MIT License
5k stars 547 forks source link

fix passenger-install-nginx-module pcre2.h compile check #2549

Closed sudoudaisuke closed 4 months ago

sudoudaisuke commented 4 months ago

Hello.

pcre2.h requires the definition of PCRE2_CODE_UNIT_WIDTH. The current code will always raise an error. The pcre_is_installed? method always returns false and always downloads pcre.tar.gz.

/usr/include/pcre2.h:971:2: error: #error PCRE2_CODE_UNIT_WIDTH must be defined before including pcre2.h.
  971 | #error PCRE2_CODE_UNIT_WIDTH must be defined before including pcre2.h.
      |  ^~~~~
/usr/include/pcre2.h:972:2: error: #error Use 8, 16, or 32; or 0 for a multi-width application.
  972 | #error Use 8, 16, or 32; or 0 for a multi-width application.
      |  ^~~~~

NGINX code sets PCRE2_CODE_UNIT_WIDTH to 8. https://github.com/nginx/nginx/blob/e734df6664e70f118ca3140bcef6d4f1750fa8fa/src/core/ngx_regex.h#L18

sudoudaisuke commented 4 months ago

@CamJN I fixed and signed it.