nginx / nginx/docker-nginx

Can't build third-party form input module

Open
#500 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Shell
Stars
3.5k
Forks
1.8k
Avg merge
42m
Merged PRs (30d)
2

Description

Trying to follow the new instructions to add modules to the Nginx Docker image. The module I need is form input. It depends on the Nginx Development Kit module.

I set this up in the modules/ directory:

# tree ngx_form_input/
ngx_form_input/
├── build-deps
└── source
# cat ngx_form_input/source 
https://github.com/calio/form-input-nginx-module/archive/v0.12.tar.gz
# cat ngx_form_input/build-deps 
libnginx-mod-http-ndk

Then I run:

docker build --build-arg ENABLED_MODULES="ndk ngx_form_input" -t nginx-with-form-input .

It appears to successfully build the development kit (ndk? ngx_devel_kit?), then tries to build the form input module and fails thusly:

adding module in extra/ngxforminput-1.19.6
error: ngx_devel_kit is required to build ngx_form_input; please put it before ngx_form_input.
make: *** [debian/rules:48: config.status.nginx] Error 1
dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2
debuild: fatal error at line 1182:
dpkg-buildpackage -us -uc -ui failed
real 10.21
user 7.61
sys 2.10
make: *** [Makefile:149: module-ngxforminput] Error 29
build_module.sh: ERROR: Build failed
The command '/bin/sh -c set -ex     && apt update     && apt install -y --no-install-suggests --no-install-recommends                 patch make wget mercurial devscripts debhelper dpkg-dev                 quilt lsb-release build-essential libxml2-utils xsltproc                 equivs git g++     && hg clone https://hg.nginx.org/pkg-oss/     && cd pkg-oss     && mkdir /tmp/packages     && for module in $ENABLED_MODULES; do         echo "Building $module for nginx-$NGINX_VERSION";         if [ -d /modules/$module ]; then             echo "Building $module from user-supplied sources";             if [ ! -s /modules/$module/source ]; then                 echo "No source file for $module in modules/$module/source, exiting";                 exit 1;             fi;             if [ -f /modules/$module/build-deps ]; then                 echo "Installing $module build dependencies";                 apt update && apt install -y --no-install-suggests --no-install-recommends $(cat /modules/$module/build-deps | xargs);             fi;             if [ -x /modules/$module/prebuild ]; then                 echo "Running prebuild script for $module";                 /modules/$module/prebuild;             fi;             /pkg-oss/build_module.sh -v $NGINX_VERSION -f -y -o /tmp/packages -n $module $(cat /modules/$module/source);         elif make -C /pkg-oss/debian list | grep -P "^$module\s+\d" > /dev/null; then             echo "Building $module from pkg-oss sources";             cd /pkg-oss/debian;             make rules-module-$module BASE_VERSION=$NGINX_VERSION;             mk-build-deps --install --tool="apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends --yes" debuild-module-$module/nginx-$NGINX_VERSION/debian/control;             make module-$module BASE_VERSION=$NGINX_VERSION;             find ../../ -maxdepth 1 -mindepth 1 -type f -name "*.deb" -exec mv -v {} /tmp/packages/ \;;         else             echo "Don't know how to build $module module, exiting";             exit 1;         fi;     done' returned a non-zero code: 1

Unsure if this problem lies with the module I'm trying to build, or if I'm naming things incorrectly, or what. The development kit seems to be named "ndk" on https://hg.nginx.org/pkg-oss, but the Debian package (as one specifies in the build-deps file) is named "libnginx-mod-http-ndk". Would appreciate if someone can help me understand!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the modules/ngx_form_input/source and modules/ngx_form_input/build-deps files, then trace the module loop and pkg-oss/build_module.sh shown in the Docker build command. Verify how the ndk dependency is named and ordered, and consider the build complete when the image builds successfully with both modules enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, nginx, shell
Domain
build-system, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.