Opened 6 years ago

Closed 6 years ago

Last modified 13 months ago

#1736 closed defect (invalid)

Cannot build dynamic modules: "Can't open auto/module"

Reported by: istanev93@… Owned by:
Priority: blocker Milestone:
Component: nginx-module Version: 1.14.x
Keywords: dynamic, module, nginx, configure, compile, dynamic module Cc:
uname -a: Linux ubuntu 4.15.0-45-generic #48-Ubuntu SMP Tue Jan 29 16:28:13 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
nginx -V: N/A; I am trying to build a nginx dynamic module

Description

I have a simple dynamic module config script like so:

ngx_module_type="HTTP"
ngx_module_name="ngx_http_my_module"
ngx_module_srcs="$ngx_addon_dir/ngx_http_my_module.c"
. auto/config
ngx_addon_name="ngx_http_my_module"

I run sudo -H ./configure --with-compat --add-dynamic-module=../ngx_http_my_module from within the nginx source (~/Desktop/nginx-1.14.2). However, I get the following error:

configuring additional dynamic modules
adding module in ../ngx_http_remote_attestation_module
./configure: 4: .: Can't open auto/module

I have checked that this auto/module is present and readable. I have been following the guides on the Nginx site, so I don't know why it would error like this. Any ideas?

Change History (5)

comment:1 by Maxim Dounin, 6 years ago

Resolution: invalid
Status: newclosed

In the provided config sample you use . auto/config instead of correct . auto/module. It is not expected to work and will complain that auto/config is not found.

The configure output you've provided is clearly unrelated and refers to ngx_http_remote_attestation_module module instead, as well as complains about auto/module. If the auto/module complain is indeed correct, it may indicate that the config script in question is broken and, for example, changes the current directory, so the auto/module script cannot be found. Either way it doesn't looks like an nginx bug, but rather a problem in your module config script.

For further questions, please use mailing lists instead.

comment:2 by istanev93@…, 6 years ago

Resolution: invalid
Status: closedreopened

Hi mdounin,

This was a copy-paste error as I was trying to change some stuff for this report.

The config is:

ngx_module_type="HTTP"
ngx_module_name="ngx_http_my_module"
ngx_module_srcs="$ngx_addon_dir/ngx_http_my_module.c"
. auto/module
ngx_addon_name="ngx_http_my_module"

The output is:

configuring additional dynamic modules
adding module in ../ngx_http_my_module
./configure: 4: .: Can't open auto/module

It doesn't look like a problem with the config script because it was copied from the Nginx blog regarding building your own dynamic module.

comment:3 by istanev93@…, 6 years ago

Please close this ticket, I have solved the issue.
Possibly some encoding problem when copy-pasting the code from the web.
I re-typed everything by hand for my config file and now it compiles successfully.

comment:4 by Maxim Dounin, 6 years ago

Resolution: invalid
Status: reopenedclosed

comment:5 by stephencoxmail@…, 13 months ago

For anyone coming across this, check that your line endings are LF and not CRLF

Note: See TracTickets for help on using tickets.