Opened 4 years ago

Closed 4 years ago

#2067 closed defect (fixed)

bug nginx build_module Cannot specify nginx version

Reported by: gamewii6666@… Owned by: Andrei Belov
Priority: minor Milestone:
Component: nginx-package Version: 1.18.x
Keywords: centos8 Cc:
uname -a: Linux rpm 4.18.0-193.19.1.el8_2.x86_64
nginx -V: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-openssl=/usr/local/openssl --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-cc-opt='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fPIC' --with-ld-opt='-Wl,-z,relro -Wl,-z,now -pie'

Description

error
./build_module.sh -v 1.18.0 --force-dynamic https://github.com/google/ngx_brotli.git

===> Building nginx-module-brotli package
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.f0pezd
+ umask 022
+ cd /root/rpmbuild/BUILD
+ cd /root/rpmbuild/BUILD
+ rm -rf nginx-module-brotli-1.18.0
+ /usr/bin/mkdir -p nginx-module-brotli-1.18.0
+ cd nginx-module-brotli-1.18.0
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ tar --strip-components=1 -zxf /root/rpmbuild/SOURCES/nginx-1.18.0.tar.gz
tar (child): /root/rpmbuild/SOURCES/nginx-1.18.0.tar.gz: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
error: Bad exit status from /var/tmp/rpm-tmp.f0pezd (%prep)

ok

./build_module.sh --force-dynamic https://github.com/google/ngx_brotli.git

Change History (22)

comment:1 by Andrei Belov, 4 years ago

Owner: set to Andrei Belov
Status: newassigned

comment:2 by Andrei Belov, 4 years ago

Status: assignedaccepted

comment:3 by Andrei Belov, 4 years ago

Component: nginx-modulenginx-package
Version: 1.19.x1.18.x

comment:4 by Andrei Belov, 4 years ago

Resolution: fixed
Status: acceptedclosed

Thanks for reporting this. A few recent changes to the stable-1.18 branch fixed the issue:

$ ./build_module.sh -v 1.18.0 --force-dynamic https://github.com/google/ngx_brotli.git
[..]
build_module.sh: INFO: Module binaries created
/tmp/build_module.sh.20222/pkg-oss/rpm/BUILD/nginx-module-brotli-1.18.0/objs/ngx_brotli-debug.so
/tmp/build_module.sh.20222/pkg-oss/rpm/BUILD/nginx-module-brotli-1.18.0/objs/ngx_http_brotli_static_module-debug.so
/tmp/build_module.sh.20222/pkg-oss/rpm/BUILD/nginx-module-brotli-1.18.0/objs/ngx_http_brotli_static_module.so
/tmp/build_module.sh.20222/pkg-oss/rpm/BUILD/nginx-module-brotli-1.18.0/objs/ngx_http_brotli_filter_module.so
/tmp/build_module.sh.20222/pkg-oss/rpm/BUILD/nginx-module-brotli-1.18.0/objs/ngx_brotli.so
/tmp/build_module.sh.20222/pkg-oss/rpm/BUILD/nginx-module-brotli-1.18.0/objs/ngx_http_brotli_filter_module-debug.so
build_module.sh: INFO: Module packages created
'/tmp/build_module.sh.20222/pkg-oss/rpm/RPMS/x86_64/nginx-module-brotli-1.18.0-1.fc32.ngx.x86_64.rpm' -> '/home/defan/build-module-artifacts/nginx-module-brotli-1.18.0-1.fc32.ngx.x86_64.rpm'
'/tmp/build_module.sh.20222/pkg-oss/rpm/RPMS/x86_64/nginx-module-brotli-debuginfo-1.18.0-1.fc32.ngx.x86_64.rpm' -> '/home/defan/build-module-artifacts/nginx-module-brotli-debuginfo-1.18.0-1.fc32.ngx.x86_64.rpm'
build_module.sh: INFO: Removing /tmp/build_module.sh.20222

$ find ~/build-module-artifacts/
/home/defan/build-module-artifacts/
/home/defan/build-module-artifacts/nginx-module-brotli-1.18.0-1.fc32.ngx.x86_64.rpm
/home/defan/build-module-artifacts/nginx-module-brotli-debuginfo-1.18.0-1.fc32.ngx.x86_64.rpm

comment:5 by levlove4@…, 4 years ago

Resolution: fixed
Status: closedreopened

in reply to:  5 comment:6 by Andrei Belov, 4 years ago

Resolution: fixed
Status: reopenedclosed

Replying to levlove4@…:
the issue is believed to be fixed - please provide additional details if you have reopened this one intentionally. TIA!

comment:7 by gamewii6666@…, 4 years ago

Resolution: fixed
Status: closedreopened

comment:8 by gamewii6666@…, 4 years ago

Which version are you using
build_module.sh
Can you link me? I use the same version to run

in reply to:  8 comment:9 by Andrei Belov, 4 years ago

Replying to gamewii6666@…:

Which version are you using
build_module.sh
Can you link me? I use the same version to run

This one (latest one in the default branch) should be always used:
http://hg.nginx.org/pkg-oss/file/default/build_module.sh

It will contain all the required changes as we improve the pkg-oss project over time.

comment:10 by gamewii6666@…, 4 years ago

I also use this version
But halfway through the compilation, he popped up an error message that there is no file
What information should I give?

Do you still need to install an additional kit?

in reply to:  10 comment:11 by Andrei Belov, 4 years ago

Replying to gamewii6666@…:

I also use this version
But halfway through the compilation, he popped up an error message that there is no file
What information should I give?

Please provide full terminal output starting from the build_module.sh invocation.

Do you still need to install an additional kit?

What do you mean under "additional kit" here?

comment:12 by gamewii6666@…, 4 years ago

I mean package
example :gcc

in reply to:  12 comment:13 by Andrei Belov, 4 years ago

Replying to gamewii6666@…:

I mean package
example :gcc

The build_module.sh cares about installing all the prerequisite packages.

Would you mind to provide requested output of the script demonstrating the issue?

comment:14 by gamewii6666@…, 4 years ago

I can provide script
What didn’t work last time was this version
http://hg.nginx.org/pkg-oss/file/e32806b3d04c/build_module.sh
This version can be built but cannot be installed
http://hg.nginx.org/pkg-oss/file/tip/build_module.sh

But I found out that the script was updated 6 hours ago yesterday
I re-downloaded the script again, which caused new problems
Below are the script parameters under my
./build_module.sh -v 1.18.0 https://github.com/openresty/headers-more-nginx-module.git

It can run normally but an error occurs when installing rpm
The following is the error message of the installation

Package nginx-module-headersmore-debuginfo-1:1.18.0-1.el8.ngx.x86_64 is already installed.
Error:

Problem: conflicting requests

  • nothing provides nginx-r1.18.0 needed by nginx-module-headersmore-1:1.18.0-1.el8.ngx.x86_64

(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

Why is nginx-r1.18.0

Last edited 4 years ago by gamewii6666@… (previous) (diff)

comment:15 by Andrei Belov, 4 years ago

Status: reopenedaccepted

Thanks for double-checking, the issue is confirmed. We will work on a solution.

comment:16 by Andrei Belov, 4 years ago

Please update nginx package to the 1.18.0-2 version and you should be able to install module packages built with the latest version of build_module.sh script.

The latest nginx package does have the required tag (nginx-r1.18.0):

$ rpm -q --provides nginx
config(nginx) = 1:1.18.0-2.el8.ngx
nginx = 1:1.18.0-2.el8.ngx
nginx(x86-64) = 1:1.18.0-2.el8.ngx
nginx-r1.18.0
webserver

Your module package should have the same tag in "requires" list:

$ rpm -q --requires nginx-module-headersmore | grep "^nginx"
nginx-r1.18.0

comment:17 by gamewii6666@…, 4 years ago

The following is the result of rpm -q --provides nginx

config(nginx) = 1:1.18.0-1.el8.ngx
nginx = 1:1.18.0-1.el8.ngx
nginx(x86-64) = 1:1.18.0-1.el8.ngx
webserver

I think I found the possible reason
This is build_module.sh bug
nginx 1.18.0-2 was released on 29-Oct-2020
I used build_module.sh at the time of 29-Oct-2020
But the version of nginx I installed was nginx 1.18.0-1, which was the latest version (before 29-Oct-2020 install)
build_module.sh should be a script -v can choose the specified version but cannot choose the small version
That is, when using build_module.sh, you must first confirm which version of nginx you specify is the latest version, so as not to cause the rpm unable to be installed.

Version 1, edited 4 years ago by gamewii6666@… (previous) (next) (diff)

comment:18 by Andrei Belov, 4 years ago

Resolution: fixed
Status: acceptedclosed

in reply to:  18 ; comment:19 by gamewii6666@…, 4 years ago

Resolution: fixed
Status: closedreopened

It is found that the compiled RPM file name is 1.18.0-1 instead of 1.18.0-2

Last edited 4 years ago by gamewii6666@… (previous) (diff)

in reply to:  19 comment:20 by Andrei Belov, 4 years ago

Replying to gamewii6666@…:

It is found that the compiled RPM file name is 1.18.0-1 instead of 1.18.0-2

This shouldn't be an issue as the resulting packages do have correct dependency tags.

This is happening because of the following assumption:
http://hg.nginx.org/pkg-oss/file/default/build_module.sh#l328

(i.e. build_module.sh always takes the first tag for specified version instead of looking for the latest available one - in case of 1.18.0 this must be 1.18.0-2; we will address this item separately)

Could you please confirm that you are able to install module packages built with current version of build_module.sh with nginx/1.18.0-2?

comment:21 by gamewii6666@…, 4 years ago

The rpm file can be installed normally
Can be installed normally on nginx 1.18.0-2
It's just that the display is still 1.18.0-1

in reply to:  21 comment:22 by Andrei Belov, 4 years ago

Resolution: fixed
Status: reopenedclosed

Replying to gamewii6666@…:

The rpm file can be installed normally
Can be installed normally on nginx 1.18.0-2

Good then, I'm closing this one as fixed.

JFTR, proper tag detection was introduced here:
http://hg.nginx.org/pkg-oss/rev/a7fe5eda85b9

It's just that the display is still 1.18.0-1

That's totally ok, every 3rd-party module package built with the build_module.sh script will always have revision 1, see "rev" and "MODULE_RELEASE" references here:
http://hg.nginx.org/pkg-oss/file/default/build_module.sh#l375
http://hg.nginx.org/pkg-oss/file/default/build_module.sh#l404

If you would like to bump revisions in your own environment, please consider creating and maintaining your own module makefile - this one could be a good starting point:
http://hg.nginx.org/pkg-oss/file/default/debian/Makefile.module-njs

Note: See TracTickets for help on using tickets.