Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#1548 closed defect (invalid)

build problem with make 4.2.1

Reported by: dinama@… Owned by:
Priority: major Milestone:
Component: other Version:
Keywords: Cc:
uname -a: Linux pbox 4.16.7_1 #1 SMP PREEMPT Fri May 4 11:42:50 UTC 2018 x86_64 GNU/Linux
nginx -V: any version
make -v
GNU Make 4.2.1

Description

can't compile any version of nginx with make 4.2.1

example:

> cd /tmp
> wget http://nginx.org/download/nginx-1.14.0.tar.gz
> tar -xvzf ./nginx-1.14.0.tar.gz
> cd nginx-1.14.0
> ./configure
> make
make -f objs/Makefile
make[1]: Entering directory '/tmp/nginx-1.14.0'
make[1]: *** No rule to make target '	src/core/ngx_config.h', needed by 'objs/src/core/nginx.o'.  Stop.
make[1]: Leaving directory '/tmp/nginx-1.14.0'
make: *** [Makefile:8: build] Error 2

because in obj/Makefile headers on variable CORE_DEPS without new line separators

CORE_DEPS = src/core/nginx.h \  src/core/ngx_config.h \ src/core/ngx_core.h \   src/core/ngx_log.h 

Attachments (3)

con (4.9 KB ) - added by dinama@… 7 years ago.
Makefile (37.6 KB ) - added by dinama@… 7 years ago.
autoconf.err (15.8 KB ) - added by dinama@… 7 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 by Maxim Dounin, 7 years ago

Just checked, and nginx compiles fine with GNU make 4.2.1, at least on FreeBSD. The problem is likely elsewhere. Please provide more details on your OS. In particular:

  • Which Linux distribution it is? Please show lsb_release -a output if available.
  • Please show configure output (and make sure it doesn't end up in an error).

If objs/Makefile indeed contains no newline separators in CORE_DEPS, it might be something with either shell or sed. Please provide more details on these as well.

Last edited 7 years ago by Maxim Dounin (previous) (diff)

by dinama@…, 7 years ago

Attachment: con added

by dinama@…, 7 years ago

Attachment: Makefile added

by dinama@…, 7 years ago

Attachment: autoconf.err added

in reply to:  1 comment:2 by dinama@…, 7 years ago

configure out, Makefile, and autoconf.err see in attachments

voidlinux latest update, sed 4.5, bash 4.4.19

Replying to mdounin:

Just checked, and nginx compiles fine with GNU make 4.2.1, at least on FreeBSD. The problem is likely elsewhere. Please provide more details on your OS. In particular:

  • Which Linux distribution it is? Please show lsb_release -a output if available.
  • Please show configure output (and make sure it doesn't end up in an error).

If objs/Makefile indeed contains no newline separators in CORE_DEPS, it might be something with either shell or sed. Please provide more details on these as well.

comment:3 by Maxim Dounin, 7 years ago

Resolution: invalid
Status: newclosed

As far as I see, Void Linux uses Dash as /bin/sh shell, and it was recently updated to Dash 0.5.10. And it indeed produces broken Makefile. Switching to either Bash or previous Dash version (0.5.9.1) fixes the problem.

This seems to be a bug in Dash 0.5.10, it fails to properly handle single-quoted strings. Per POSIX, all characters within single quotes have to be preserved, yet Dash 0.5.10 removes \<newline> constructs:

$ cat test
foo='x\
y'
echo "$foo"
$ dash-0.5.10 test
xy
$ dash-0.5.9.1 test
x\
y
$ bash test
x\
y

Broken by this commit.

To fix things, consider switching back to Dash 0.5.9.1. Using Bash as /bin/sh might be an option too.

in reply to:  3 comment:4 by dinama@…, 7 years ago

Thank you!
Simple temporary resolution for voidlinux:

xbps-alternatives -s bash

Replying to mdounin:

As far as I see, Void Linux uses Dash as /bin/sh shell, and it was recently updated to Dash 0.5.10. And it indeed produces broken Makefile. Switching to either Bash or previous Dash version (0.5.9.1) fixes the problem.

This seems to be a bug in Dash 0.5.10, it fails to properly handle single-quoted strings. Per POSIX, all characters within single quotes have to be preserved, yet Dash 0.5.10 removes \<newline> constructs:

$ cat test
foo='x\
y'
echo "$foo"
$ dash-0.5.10 test
xy
$ dash-0.5.9.1 test
x\
y
$ bash test
x\
y

Broken by this commit.

To fix things, consider switching back to Dash 0.5.9.1. Using Bash as /bin/sh might be an option too.

Note: See TracTickets for help on using tickets.