Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure to build when /etc/resolv.conf is missing (e.g. with Mock) #1546

Open
dvershinin opened this issue Mar 31, 2021 · 0 comments · May be fixed by #1547
Open

Failure to build when /etc/resolv.conf is missing (e.g. with Mock) #1546

dvershinin opened this issue Mar 31, 2021 · 0 comments · May be fixed by #1547

Comments

@dvershinin
Copy link

In general, the build is 100% failing when /etc/resolv.conf is absent. See error below.

A specific way to reproduce this is to build a Tengine package with Mock.

Mock allows building RPMs in a clean environment. However, Tengine build fails because it relies on /etc/resolv.conf and the
related define is not set because the file is not present:

In file included from src/core/ngx_core.h:55,
                 from src/core/ngx_resolver.c:9:
src/core/ngx_resolver.c: In function 'ngx_resolver_create':
src/core/ngx_resolver.c:283:41: error: 'NGX_RESOLVER_FILE' undeclared (first use in this function); did you mean 'T_NGX_RESOLVER_FILE'?
     ngx_str_t default_file = ngx_string(NGX_RESOLVER_FILE);
                                         ^~~~~~~~~~~~~~~~~
src/core/ngx_string.h:40:38: note: in definition of macro 'ngx_string'
 #define ngx_string(str)     { sizeof(str) - 1, (u_char *) str }
                                      ^~~
src/core/ngx_resolver.c:283:41: note: each undeclared identifier is reported only once for each function it appears in
     ngx_str_t default_file = ngx_string(NGX_RESOLVER_FILE);
                                         ^~~~~~~~~~~~~~~~~
src/core/ngx_string.h:40:38: note: in definition of macro 'ngx_string'
 #define ngx_string(str)     { sizeof(str) - 1, (u_char *) str }
                                      ^~~

How to reproduce it

  1. install mock in an RPM distro
  2. attempt to build RPM for Tengine
  3. build always fails with error above because /etc/resolv.conf is not there, and thus NGX_RESOLVER_FILE is undefined

Alternative way reproduce it

  1. Delete /etc/resolve.conf
  2. attempt to build normally
  3. build fails same as above

PR with fixes will follow.

@dvershinin dvershinin changed the title Failure to build when /etcv/resolv.conf is missing (e.g. with Mock) Failure to build when /etc/resolv.conf is missing (e.g. with Mock) Mar 31, 2021
@dvershinin dvershinin linked a pull request Mar 31, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant