You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Default compile flags for nginx-sys doesn't allow to compile ngx crate without manual intervention on gcc 15.1 (Arch Linux rolling)
There's 2 erros to fix:
Default ZLIB_VERSION (1.3.0) doesn't exist on the website anymore. I had to rewrite to 1.3.1
nginx-sys crate compilation fails with the following error:
src/http/v2/ngx_http_v2_filter_module.c:151:36: error: initializer-string for array of ‘unsigned char’ truncates NUL terminator but destination lacks ‘nonstring’ attribute (6 chars into 5 available) [-Werror=unterminated-string-initialization]
src/http/v2/ngx_http_v2_filter_module.c:154:9: error: initializer-string for array of ‘unsigned char’ truncates NUL terminator but destination lacks ‘nonstring’ attribute (13 chars into 12 available) [-Werror=unterminated-string-initialization]
To fix it I had to manually add attribute ((nonstring)) to declaration into .cargo/registry/.../
To Reproduce
cargo init --lib
cargo add ngx
cargo build
Expected behavior
Cargo builds simple library
Your environment
Version of ngx = 0.4.1
Version of Rust = 1.86.0
Version of NGINX = 1.22.0
Arch Linux rolling, gcc version 15.1.1 20250425 (GCC)
Additional context
I'm not sure if I need to send PR to nginx repo with attribute param or to you to change build flags, so feel free to close this issue if it's inappropriate repo.
The text was updated successfully, but these errors were encountered:
Default ZLIB_VERSION (1.3.0) doesn't exist on the website anymore. I had to rewrite to 1.3.1
This is fixed in the dev branch, but we haven't tagged a release for a while.
nginx-sys crate compilation fails with the following error:
Fixed in nginx/nginx#631 and released in nginx 1.28.0. Unfortunately, the current stable release of ngx does not offer any way to work around that other than setting NGX_VERSION=1.28.0.
For the next release, I'm planning to make nginx-sys use a preconfigured external nginx source tree specified with NGINX_SOURCE_DIR/NGINX_BUILD_DIR by default. This solves any non-standard configuration requirements and allows building against patched nginx sources with API changes (e.g. Linux distribution packages).
The change is already available in the master branch if you don't mind git dependencies, and will be released to crates.io in the next couple of months.
Describe the bug
Default compile flags for nginx-sys doesn't allow to compile ngx crate without manual intervention on gcc 15.1 (Arch Linux rolling)
There's 2 erros to fix:
To fix it I had to manually add attribute ((nonstring)) to declaration into .cargo/registry/.../
To Reproduce
Expected behavior
Cargo builds simple library
Your environment
Additional context
I'm not sure if I need to send PR to nginx repo with attribute param or to you to change build flags, so feel free to close this issue if it's inappropriate repo.
The text was updated successfully, but these errors were encountered: