nginx-shib / nginx-http-shibboleth

Shibboleth auth request module for nginx
https://github.com/nginx-shib/nginx-http-shibboleth/wiki
Other
209 stars 27 forks source link

./build_module.sh from Nginx fails to compile repo into modules.tgz #42

Closed jacobkennedy7 closed 2 years ago

jacobkennedy7 commented 2 years ago

When trying to build the module using pkg-oss, the output is a modules.tgz file that is corrupt. Steps to reproduce:

  1. Download build_module.sh from Nginx (link above)
  2. Run ./build_module.sh -v 1.20.1 https://github.com/nginx-shib/nginx-http-shibboleth

Notes: OS: Debain 11 Bullseye Nginx: v1.20.1 installed Output from script:

DISCLAIMER DISCLAIMER DISCLAIMER DISCLAIMER DISCLAIMER DISCLAIMER DISCLAIMER

 This script is provided as a demonstration of how to use the NGINX pkg-oss
 tooling to compile and package a dynamic module for NGINX and NGINX Plus.
 It will produce an installable package with the correct dependency on the
 NGINX version used for the build so that upgrades will not lead to mismatch
 between NGINX and the module. When using this script please bear in mind:
  - It will not work for every module, check for module prerequisites.
  - The installable packages are not intended for redistribution.
  - Seamless upgrades with dependency matching require a yum/apt repository.

build_module.sh: INFO: testing sudo
build_module.sh: INFO: checking for dependent packages
Get:1 file:/opt deb/ InRelease
Ign:1 file:/opt deb/ InRelease
Get:2 file:/opt deb/ Release
Ign:2 file:/opt deb/ Release
Get:3 file:/opt deb/ Packages
Ign:3 file:/opt deb/ Packages
Get:4 file:/opt deb/ Translation-en_US
Ign:4 file:/opt deb/ Translation-en_US
Get:5 file:/opt deb/ Translation-en
Ign:5 file:/opt deb/ Translation-en
Get:3 file:/opt deb/ Packages
Ign:3 file:/opt deb/ Packages
Get:4 file:/opt deb/ Translation-en_US
Ign:4 file:/opt deb/ Translation-en_US
Get:5 file:/opt deb/ Translation-en
Ign:5 file:/opt deb/ Translation-en
Get:3 file:/opt deb/ Packages
Ign:3 file:/opt deb/ Packages
Get:4 file:/opt deb/ Translation-en_US
Ign:4 file:/opt deb/ Translation-en_US
Get:5 file:/opt deb/ Translation-en
Ign:5 file:/opt deb/ Translation-en
Get:3 file:/opt deb/ Packages [417 B]
Get:4 file:/opt deb/ Translation-en_US
Ign:4 file:/opt deb/ Translation-en_US
Get:5 file:/opt deb/ Translation-en
Ign:5 file:/opt deb/ Translation-en
Get:4 file:/opt deb/ Translation-en_US
Ign:4 file:/opt deb/ Translation-en_US
Get:5 file:/opt deb/ Translation-en
Ign:5 file:/opt deb/ Translation-en
Get:4 file:/opt deb/ Translation-en_US
Ign:4 file:/opt deb/ Translation-en_US
Get:5 file:/opt deb/ Translation-en
Ign:5 file:/opt deb/ Translation-en
Get:4 file:/opt deb/ Translation-en_US
Ign:4 file:/opt deb/ Translation-en_US
Get:5 file:/opt deb/ Translation-en
Ign:5 file:/opt deb/ Translation-en
Hit:6 http://security.debian.org/debian-security bullseye-security InRelease
Hit:7 http://deb.debian.org/debian bullseye InRelease
Hit:8 https://download.docker.com/linux/debian bullseye InRelease
Hit:9 https://packages.microsoft.com/debian/11/prod bullseye InRelease
Hit:10 http://deb.debian.org/debian bullseye-updates InRelease
Hit:12 https://nginx.org/packages/debian bullseye InRelease
Hit:13 https://packages.sury.org/php bullseye InRelease
Hit:11 https://packages.gitlab.com/gitlab/gitlab-ee/debian bullseye InRelease
Reading package lists... Done
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
build-essential is already the newest version (12.9).
debhelper is already the newest version (13.3.4).
devscripts is already the newest version (2.21.3+deb11u1).
dpkg-dev is already the newest version (1.20.9).
fakeroot is already the newest version (1.25.3-1.1).
gcc is already the newest version (4:10.2.1-1).
xsltproc is already the newest version (1.1.34-4).
lsb-release is already the newest version (11.1.0).
make is already the newest version (4.3-4.1).
mercurial is already the newest version (5.6.1-4).
libssl-dev is already the newest version (1.1.1k-1+deb11u1).
quilt is already the newest version (0.66-2.1).
unzip is already the newest version (6.0-26).
wget is already the newest version (1.21-1+b1).
zlib1g-dev is already the newest version (1:1.2.11.dfsg-2).
libpcre3-dev is already the newest version (2:8.44-2+0~20210301.9+debian11~1.gbpa278ad).
libxml2-utils is already the newest version (2.9.12+dfsg-0+0~20210621.9+debian11~1.gbp43e861).
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
build_module.sh: INPUT: Enter module nickname [shibboleth]:
build_module.sh: INFO: Creating /tmp/build_module.sh.95537 build area
build_module.sh: INFO Downloading module source
--2021-12-09 14:25:54--  https://github.com/nginx-shib/nginx-http-shibboleth
Resolving github.com (github.com)... 140.82.113.4
Connecting to github.com (github.com)|140.82.113.4|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘/tmp/build_module.sh.95537/module.tgz’

/tmp/build_module.sh.95537/module.tgz                                               [ <=>                                                                                                                                                                                                 ] 230.43K  --.-KB/s    in 0.1s

2021-12-09 14:25:54 (1.94 MB/s) - ‘/tmp/build_module.sh.95537/module.tgz’ saved [235956]

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now
mv: missing destination file operand after '/tmp/build_module.sh.95537/shibboleth'
Try 'mv --help' for more information.
/home/superuser
build_module.sh: ERROR: Cannot locate module config file - quitting
davidjb commented 2 years ago

Support questions related to pkg-oss are out-of-scope for this issue tracker.

That said, pkg-oss assumes a URL is a tarball by default so hence the error. It will clone a git repo if you point the script at the git URL instead:

./build_module.sh -v 1.20.1 https://github.com/nginx-shib/nginx-http-shibboleth.git

See https://hg.nginx.org/pkg-oss/file/tip/build_module.sh#l260.