Commit graph

2760 commits

Author SHA1 Message Date
Manoj Srivastava
9bdb51d726
[document-jobserver-fds]: Reword the manual page
While the wording included in the manual page was not verbatim copying
from the source material, it was perhaps not distinct enough. The
manual page is not a copy/edit of the source material anymore, being
rewritten using different words and flow.

Signed-off-by: Manoj Srivastava <srivasta@debian.org>
2016-03-11 17:27:10 -08:00
Manoj Srivastava
1794349e4a
[master]: Document jobserver implementation
Update the man page with details on the internal --jobserver-fds
 option, and the jobserver pipe used to handle -j correctly in
 recursive make invocations.

 Based on details gleaned from:
 http://make.mad-scientist.net/papers/jobserver-implementation/

  forwarded this bug to upstream bug reporting system.
  (Closes: #781416).

Signed-off-by: Manoj Srivastava <srivasta@debian.org>
2016-03-11 14:19:32 -08:00
Manoj Srivastava
65f9fbec3e
Merge branch 'document-jobserver-fds' 2016-03-11 14:15:15 -08:00
Manoj Srivastava
a6a581b6d5
[document-jobserver-fds]: Update the man page
Update the man page with details on the internal --jobserver-fds
option, and the jobserver pipe used to handle -j correctly in
recursive make invocations.

Based on details gleaned from:
http://make.mad-scientist.net/papers/jobserver-implementation/

Signed-off-by: Manoj Srivastava <srivasta@debian.org>
2016-03-11 14:08:52 -08:00
Manoj Srivastava
d23f13df1c
[master]: Cherry pick fix from upstream
Bug fix: "-q fails for recursive makes", thanks to David Bremner
 (Closes: #766140).

Signed-off-by: Manoj Srivastava <srivasta@debian.org>
2016-03-09 16:11:41 -08:00
Manoj Srivastava
40fc88d763
Merge branch 'fix-recursive-make-q' 2016-03-09 16:09:34 -08:00
Paul Smith
dc92144e62
[SV 47151] Exit with 1 when checking recursive make -q
* job.h (struct child): New bit to mark recursive command lines.
* job.c (start_job_command): Set the recursive command line bit.
(reap_children): If the child is a recursive command and it exits
with 1 during question mode, don't print an error and exit with 1.
* tests/scripts/options/dash-q: Add a regression test.
2016-03-09 16:09:14 -08:00
Paul Smith
14b2d7effb * job.c (exec_command): [SV 47365] Show error on exec failure. 2016-03-09 00:18:57 -05:00
Paul Smith
85c788572d [SV 46261] Use pselect() for jobserver where supported.
* Makefile.am, configure.ac: Check for pselect() and sys/select.h.
* main.c (main): Block SIGCHLD if we have pselect() support.
* posixos.c (jobserver_acquire): If we support pselect() then use
it to query the jobserver pipe, while also listening for SIGCHLD.
Also pselect() supports a timeout so avoid alarm() calls.
2016-03-08 23:40:46 -05:00
Paul Smith
8164c8ab3d Clean up some compiler warnings.
* commands.c, commands.h: Use unsigned char for flags.
* dir.c: Use time_t and size_t, and char for a boolean value.
* job.c: Use unsigned and char.
* read.c: Return a signed type since -1 is a valid return code.
2016-03-08 23:40:46 -05:00
Paul Smith
fb7a7adc8a Extract jobserver implementation into OS-specific files.
* os.h, posixos.c, w32/w32os.c: New files implementing jobserver.
* job.c, job.h, main.c, makeint.h: Move content to new files.
* w32/include/sub_proc.h, w32/subproc/sub_proc.c: Ditto.
* Makefile.am: Build and package OS-specific files.
* build_w32.bat, make_msvc_net2003.vcproj, README.W32.template:
Update for new files, and clean up the build.
* POTFILES.in, maintMakefile, NMakefile.template: Ditto.
* w32/subproc/build.bat: Delete as unused.
2016-03-08 23:40:46 -05:00
Paul Smith
4f8be4bb28 [SV 46261] Add more EINTRLOOP wrappers.
This cannot be a perfect solution because there are always other
possible places EINTR can happen, including external libraries
such as gettext, Guile etc.
2016-03-08 00:31:47 -05:00
Paul Smith
e2b39edc22 * strcache.c (add_hugestring): [SV 46832] Support huge strings.
The strcache was limited to strings of length 65535 or less,
because the length is kept in an unsigned short.  To support
huge strings add a new simple linked list, which we don't try
to hash.
2016-02-29 01:35:02 -05:00
Paul Smith
8530d77c68 * strcache.c (add_string): [SV 47071] Handle huge initial string.
If the very first string added to the string cache is more than
half the maximum size, we failed when moving the only strcache
buffer to the full list.
2016-02-29 01:35:02 -05:00
Paul Smith
89e18c12eb [SV 47151] Exit with 1 when checking recursive make -q
* job.h (struct child): New bit to mark recursive command lines.
* job.c (start_job_command): Set the recursive command line bit.
(reap_children): If the child is a recursive command and it exits
with 1 during question mode, don't print an error and exit with 1.
* tests/scripts/options/dash-q: Add a regression test.
2016-02-29 01:33:50 -05:00
Paul Smith
bccd01354b * main.c (define_makeflags): Add parens to avoid GCC warning. 2016-02-29 01:32:12 -05:00
Paul Smith
5f9d341160 * tests/scripts/features/archives: Handle deterministic archives.
Newer versions of binutils allow ar to be compiled to generate
"deterministic archives" by default: in this mode no timestamp
information is generated in the static archive, which utterly
breaks GNU make's archive updating capability.  Debian and Ubuntu
have turned this feature on by default in their distributions
which causes the regression tests to fail.

Update the regression tests to check for the availability of the
"U" option to ar which disables deterministic archives and allows
GNU make's archive support to work properly again.
2016-02-29 01:31:16 -05:00
Paul Smith
798ebd241b Update Copyright statements for the new year. 2016-02-28 12:55:20 -05:00
Paul Smith
4db6d0c694 * doc/make.texi: [SV 47163] Fix typo in 'ifdef' documentation. 2016-02-28 12:41:41 -05:00
Paul Smith
b754a35df7 * doc/make.texi: [SV 35455] Add more uses for Empty Recipes. 2016-02-28 12:35:15 -05:00
Manoj Srivastava
1ff168fdf4
Satisfiable cross build dependencies
libbsd-resource-perl is only needed for running tests.  Bug fix:
"make-dfsg has unsatisfiable cross build dependendencies in a
bootstrap setting: libbsd-resource-perl", thanks to Helmut Grohne
(Closes: #812725).

Signed-off-by: Manoj Srivastava <srivasta@debian.org>
2016-02-14 21:15:41 -08:00
Manoj Srivastava
db65ba64e9
Reduce max open FDs during fail fopen testing
While increasing the timeout is a solution, it still did not work for
the slower architectures. Reducing the maximum open file descriptor
limits (only while testing) to try and get the the time under control.

Signed-off-by: Manoj Srivastava <srivasta@debian.org>
2016-01-23 16:10:42 -08:00
Manoj Srivastava
6d11573bf5
Merge branch 'test-fopenfail-timeout-fix'
Signed-off-by: Manoj Srivastava <srivasta@debian.org>
2016-01-23 16:07:45 -08:00
Manoj Srivastava
fa309b954f
[test-fopen-fail]: Reduce the maximum open file descriptors
The test to recirsively open files until the open file descriptor
limit is reachewd unfortunately times out on slower machines, causing
build failures. This commit tries to reduce the maximum open file
descriptors to reduce the taime tofailure.

Signed-off-by: Manoj Srivastava <srivasta@debian.org>
2016-01-23 16:05:57 -08:00
Manoj Srivastava
5acd74f0dd
[master]: Increase fopen fail test timeout
Make has a test where we Recurse infinitely until we run out of open
files, and ensure we fail with a non-zero exit code., On some machines
the default time out was inadequate, since the test did not run till
conclusion. Doubling it did not have any effect. Quadrupling the
timeout worked.

Signed-off-by: Manoj Srivastava <srivasta@debian.org>
2016-01-22 02:01:16 -08:00
Manoj Srivastava
ec29ef9688
[master]L Handle NULL retirns from ttyname
Cherry pick a fix from upstream

Signed-off-by: Manoj Srivastava <srivasta@debian.org>
2016-01-22 00:37:52 -08:00
Paul Smith
e96a75f457
* main.c (main): [SV 43434] Handle NULL returns from ttyname(). 2016-01-22 00:35:34 -08:00
Manoj Srivastava
552ba95828 Merge branch 'upstream' 2016-01-18 22:21:53 -08:00
Manoj Srivastava
d791b866f9 Merge branch 'development-4.1' into upstream 2016-01-18 22:18:43 -08:00
Manoj Srivastava
f8a4b24632 [master]: Redo the handling of changed ar behaviour
Also added a NEWS file, since there is a change in the behaviour of
ar, and thus make.

Signed-off-by: Manoj Srivastava <srivasta@debian.org>
2016-01-18 16:11:09 -08:00
Manoj Srivastava
3e6bddb89d Merge branch 'ar-deterministic-fixes' 2016-01-18 15:12:22 -08:00
Jérémy Bobbio
fd6099b066 Issue a warning when we detect a "deterministic" archive
binutils will create archive with timestamps set to 0 when running in
"deterministic" mode. As make will always try to update such members,
let's notify users with a warning.
2016-01-18 14:47:04 -08:00
Jérémy Bobbio
ac65603b52 Make ar_member_date compatible with archives with timestamps set to 0
ar_scan() scanning function uses 0 to indicate that scanning should continue.
This made ar_member_date() unable to differentiate when it was unable to find
the requested member from a member with a timestamp set to 0.

We thus change its prototype to have its return value indicate if it has been
able to find the requested member. The timestamp is set through the newly given
pointer.
2016-01-18 14:47:04 -08:00
Manoj Srivastava
e1d70aa10b Merge branch 'test-fopenfail-timeout-fix' 2016-01-18 14:35:17 -08:00
Manoj Srivastava
a762ad95ae [test-fopenfail-timeout-fix]: Use a less intrusive means of setting longer timeouts for fopen.
Signed-off-by: Manoj Srivastava <srivasta@debian.org>
2016-01-18 14:34:37 -08:00
Manoj Srivastava
96a5f92b09 Merge branch 'upstream' into test-fopenfail-timeout-fix
Signed-off-by: Manoj Srivastava <srivasta@debian.org>

# Conflicts:
#	tests/test_driver.pl
2016-01-18 14:30:33 -08:00
Manoj Srivastava
dbcb5835e3 Fix test issues with ar in deterministic mode
The ar program in the binutils package in Debian is now configured
with --enable-deterministic-archives. This change makes the archives
reproducible, by setting the UID, GID, and timestamp to 0. However,
when dealing with archives created with the libxx(*.o) style rules,
make needs the timestamp of the file in order to decide to update it
or not. With the current deterministic behavior of ar, the timestamp
is always 0 and make fails to build, failing 7 out of 10 archive
tests.Since make seems to depend on timestamps for this rule it makes
sense to always pass on the -U flag for the test suite

This commit makes the minimal changes to make the test suite pass
whether or not ar defaults to using deterministic mode.

There is some online discussion:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=798804
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=798913
https://bugzilla.redhat.com/show_bug.cgi?id=1195883

Signed-off-by: Manoj Srivastava <srivasta@debian.org>
2016-01-18 14:04:24 -08:00
Manoj Srivastava
a1da9d9fdd Revert "[fix-ar-deterministic]: Fix issues with ar operating in deterministic mode"
This reverts commit 355fd6b5ba.

A better approach is being pursued
2016-01-17 22:34:41 -08:00
Manoj Srivastava
0e15d5c2e7 Merge remote-tracking branch 'refs/remotes/dgit/dgit/sid' into dgit/sid 2016-01-16 23:54:15 -08:00
Manoj Srivastava
7e054fba25 [master]: Fixes for backwards incompatible ar behaviour
It looks like the ar program in the binutils package in debian is now
configured with --enable-deterministic-archives. However, when dealing
with archive members, make needs the timestamp of the file in order to
decide to update it or not. With the current deterministic behavior of
ar, the timestamp is always 0. This change in ar introduced a behavior
that is not backward compatible and forces the use of the option U

make fails to build, failing 7 out of 10 archive tests.Since make seems
t depend on timestamps to handle rebuilds of archives correctly, it
makes sense to always pass on the -U flag, and depend on a version of ar
that supports it.

Should this U option be included in a Makefile, older versions of ar
would reject it and fail.

Signed-off-by: Manoj Srivastava <srivasta@debian.org>
2016-01-16 22:44:57 -08:00
Manoj Srivastava
103b171579 Import make-dfsg_4.1.orig.tar.gz
[dgit import orig make-dfsg_4.1.orig.tar.gz]
2016-01-16 22:37:08 -08:00
Manoj Srivastava
7e834c2c8b Merge branch 'fix-ar-deterministic-mode' 2016-01-16 14:06:55 -08:00
Manoj Srivastava
355fd6b5ba [fix-ar-deterministic]: Fix issues with ar operating in deterministic mode
It looks like the ar program in the binutils package in debian is now
configured with --enable-deterministic-archives. However, when dealing
with archive members, make needs the timestamp of the file in order to
decide to update it or not. With the current deterministic behavior of
ar, the timestamp is always 0. This change in ar introduced a behavior
that is not backward compatible and forces the use of the option U

make fails to build, failing 7 out of 10 archive tests.Since make seems
t depend on timestamps to handle rebuilds of archives correctly, it
makes sense to always pass on the -U flag, and depend on a version of ar
that supports it.

Should this U option be included in a Makefile, older versions of ar
would reject it and fail.

There is some online discussion:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=798804
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=798913
https://bugzilla.redhat.com/show_bug.cgi?id=1195883

Signed-off-by: Manoj Srivastava <srivasta@debian.org>
2016-01-16 12:55:37 -08:00
Manoj Srivastava
8e9d488f79 [master]: Make the binary packages M-A: Allowed
From: Helmut Grohne
it is doubtful wheter we can actually go
m-a:foreign. soon someone will come along and point out that the
"load" directive is not architecture agnosting and he'd be right.

the advantages are:
1) it's trivial to implement
2) after (cross)build-essential depends on make:any a large swath of
   things will just work
3) it's something that works today.

the single downside is that if we ever determine that m-a:foreign is
better, the move will be a bit painful.

Signed-off-by: Manoj Srivastava <srivasta@debian.org>
2016-01-16 02:43:45 -08:00
Manoj Srivastava
c6229f2395 [master]: Demote the make packages priorities
make is now priority optional, along with gcc, floex and
bison. make-guile, which conflicts with it, is now priority extra.

Bug fix: "Neither make nor make-guile should be standard", thanks to
Josh Triplett (Closes: #761301).

Bug fix: "make instead of make-guile should be standard", thanks to
Joey Hess (Closes: #762017).

Signed-off-by: Manoj Srivastava <srivasta@debian.org>
2016-01-16 02:43:41 -08:00
Manoj Srivastava
2b2890cdcc [master]: Fix manpage typos
Bug fix: "Typos in manpage", thanks to Josh Triplett
   (Closes: #763147).

Signed-off-by: Manoj Srivastava <srivasta@debian.org>
2016-01-16 02:43:38 -08:00
Manoj Srivastava
6592ff6f78 [master]: Packaging cleanups.
Signed-off-by: Manoj Srivastava <srivasta@debian.org>
2016-01-16 02:43:25 -08:00
Manoj Srivastava
bb74c00b29 Merge branch 'upstream'
Signed-off-by: Manoj Srivastava <srivasta@debian.org>

# Conflicts:
#	NEWS
#	read.c
#	tests/test_driver.pl
2016-01-16 02:26:46 -08:00
Manoj Srivastava
bd8a0ad047 Imported Upstream version 4.1 2016-01-16 02:25:59 -08:00
Manoj Srivastava
c90659504c [master]: Remove the new build directories.
Signed-off-by: Manoj Srivastava <srivasta@debian.org>
2016-01-16 02:24:59 -08:00