tokers / zstd-nginx-module

Nginx modules for the Zstandard compression
BSD 2-Clause "Simplified" License
196 stars 23 forks source link

Fails to compile with zstd 1.5.2 #16

Open SuperSandro2000 opened 1 year ago

SuperSandro2000 commented 1 year ago
nginx> sed -e "s|%%PREFIX%%|/nix/store/kcqvlq3iaqbizbdh3h1yi81lwia4kwnv-nginx-1.23.3|" \
nginx>  -e "s|%%PID_PATH%%|/var/log/nginx/nginx.pid|" \
nginx>  -e "s|%%CONF_PATH%%|/nix/store/kcqvlq3iaqbizbdh3h1yi81lwia4kwnv-nginx-1.23.3/conf/nginx.conf|" \
nginx>  -e "s|%%ERROR_LOG_PATH%%|/var/log/nginx/error.log|" \
nginx>  < man/nginx.8 > objs/nginx.8
nginx> /nix/store/jz2zs0bdi1lgzg2lwjmm9zp6cy0480in-zstd/filter/ngx_http_zstd_filter_module.c: In function 'ngx_http_zstd_filter_create_cstream':
nginx> /nix/store/jz2zs0bdi1lgzg2lwjmm9zp6cy0480in-zstd/filter/ngx_http_zstd_filter_module.c:611:9: error: 'ZSTD_initCStream_usingCDict' is deprecated [-Werror=deprecated-declarations]
nginx>   611 |         rc = ZSTD_initCStream_usingCDict(cstream, zlcf->dict);
nginx>       |         ^~
nginx> In file included from /nix/store/jz2zs0bdi1lgzg2lwjmm9zp6cy0480in-zstd/filter/ngx_http_zstd_filter_module.c:11:
nginx> /nix/store/aa63djs8jjy64zc7jm145d3kr49jm8jl-zstd-1.5.2-dev/include/zstd.h:2256:8: note: declared here
nginx>  2256 | size_t ZSTD_initCStream_usingCDict(ZSTD_CStream* zcs, const ZSTD_CDict* cdict);
nginx>       |        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
nginx> cc1: all warnings being treated as errors
nginx> make[1]: *** [objs/Makefile:1906: objs/addon/filter/ngx_http_zstd_filter_module.o] Error 1
nginx> make[1]: *** Waiting for unfinished jobs....
nginx> make[1]: Leaving directory '/build/nginx-1.23.3'
nginx> make: *** [Makefile:10: build] Error 2

https://github.com/facebook/zstd/blob/v1.5.2/lib/zstd.h#L2247-L2277

tokers commented 1 year ago

@SuperSandro2000 Hi, would you like to submit a PR to let this module be compatible with zstd 1.5.2?

SuperSandro2000 commented 1 year ago

My c++ knowledge is very basic and I could easily do a mistake in the migration.

calvin2021y commented 1 year ago

more than half year passed, any plan on fix this ?

tokers commented 1 year ago

@calvin2021y @SuperSandro2000 Could you try the branch on https://github.com/tokers/zstd-nginx-module/pull/28?

SuperSandro2000 commented 1 year ago

nixpkgs is using zstd version 1.5.5 now which does not trigger this bug anymore but I can try fetching the patch while creating the update to 0.1.0 to see if it compiles.

tokers commented 1 year ago

@SuperSandro2000 You can try 0.1.1 release as I merged the patch already :).