Commit graph

2760 commits

Author SHA1 Message Date
Manoj Srivastava
484dd2fed4
bug(race): Disable inheritance of jobserver FDs for recursive make
Closes: #963335

Signed-off-by: Manoj Srivastava <srivasta@debian.org>
2020-06-30 00:58:56 -07:00
Kevin Buettner
9cfd45525a
[SV 58232] Disable inheritance of jobserver FDs for recursive make
A parent make will invoke a sub-make with close-on-exec disabled for
the jobserver pipe FDs.  Force close-on-exec to be to be enabled in
the sub-make so the pipe is not always passed to child jobs.

I have a test case which, when invoked with a suitable -j switch,
will hang if the recipe inherits the jobserver pipe.  This test case
was inspired by a real world case in which testing GDB on Fedora
would hang due to some poorly written test GDB cases having been
passed the jobserver file descriptors.

* src/posixos.c (jobserver_parse_auth): Call fd_noinherit() for
jobserver pipe descriptors.

Copyright-paperwork-exempt: yes
(cherry picked from commit d79fe162c009788888faaf0317253b6f0cac7092)
Signed-off-by: Manoj Srivastava <srivasta@debian.org>
2020-06-30 00:55:43 -07:00
Manoj Srivastava
cd6a65e8b8
fix(includes) Fix ordering if include dirs
There has been a long standind bug where INCLUDE_DIRS /usr/include is
included twice.  The more important problem is it is before the
/usr/local/include. This commit fixes the ordering. So now
/usr/local/include comes before /usr/include, which it should, but
this is a change in behaviour.

Closes: #493523

Signed-off-by: Manoj Srivastava <srivasta@debian.org>
2020-06-05 19:02:00 -07:00
Manoj Srivastava
8245101cae
Merge branch 'fix-inddir-order' 2020-06-05 18:57:08 -07:00
Manoj Srivastava
13da404446
fix(includedir) Fix ordering if include dirs
There has been a long standind bug where INCLUDE_DIRS /usr/include is
included twice.  The more important problem is it is before the
/usr/local/include.

  This commit fixes the ordering.

Signed-off-by: Manoj Srivastava <srivasta@debian.org>
2020-06-05 18:56:11 -07:00
Manoj Srivastava
f92a9948a9
fix(links): Fix broken symlinks
Bug fix: "Broken symlinks: /usr/bin/gmake,
/usr/share/man/man1/gmake.1.gz", thanks to Peter Wienemann
I forgot that we must use absolute pathnames,

Closes: #961860

Signed-off-by: Manoj Srivastava <srivasta@debian.org>
2020-06-04 22:01:29 -07:00
Manoj Srivastava
522734144b
feat(new): New upstream version
This is a new upstream minor version of Make. There are a few backward
incompatible changes.

Signed-off-by: Manoj Srivastava <srivasta@debian.org>
2020-05-20 17:42:53 -07:00
Manoj Srivastava
2973170ddd
Merge branch 'multiarch-patch' 2020-05-20 13:46:13 -07:00
Manoj Srivastava
75d371a6b3
Merge branch 'upstream' into multiarch-patch 2020-05-20 13:44:31 -07:00
Manoj Srivastava
e8c31c876c
Merge branch 'fix-ar-deterministic-mode' 2020-05-20 13:39:04 -07:00
Manoj Srivastava
c5c6719e1b
Merge branch 'upstream' into fix-ar-deterministic-mode 2020-05-20 13:36:42 -07:00
Manoj Srivastava
c7951ebf05
Merge branch 'document-jobserver-fds' 2020-05-20 13:31:27 -07:00
Manoj Srivastava
fceb9a9784
Merge branch 'upstream' into document-jobserver-fds 2020-05-20 13:29:09 -07:00
Manoj Srivastava
26b68bab5f
Merge branch 'ar-deterministic-fixes' 2020-05-20 13:25:39 -07:00
Manoj Srivastava
91d0da6a03
Merge branch 'upstream' into ar-deterministic-fixes 2020-05-20 13:24:28 -07:00
Manoj Srivastava
aa918f40e2
Merge branch 'add-usr-local-lib-to-search-for-debian' 2020-05-20 13:20:29 -07:00
Manoj Srivastava
5223888679
Merge branch 'upstream' into add-usr-local-lib-to-search-for-debian 2020-05-20 13:16:57 -07:00
Manoj Srivastava
fdf55c4c77
Merge branch 'upstream' 2020-05-20 13:13:02 -07:00
Manoj Srivastava
98047acd38 GNU Make release 4.3
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEslCKkBAviuOxKgCQ3qzKrtt4E3oFAl4k14cACgkQ3qzKrtt4
 E3qBsw/+KSJCFc6Igmdsw73GZz1N2l/ufzxCuYSiUDPYBFfut8h2AmtqlLkAuDni
 jtSJAnFZKG6pT9jjpGDf9gXZi1BU9Bwc1SAWY5CAecUbgY790hhatvKVCLLndEoy
 Hl2Kq6IVgUuas7+mLse4LxnCdUuof9xO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RxzLikt8kLfbqogBDMbRvgR9JGXKPiROpOB0zJk25OIDok8uCfRs9cWIy
 NsRpB3GqEw==
 =PiwC
 -----END PGP SIGNATURE-----

Merge tag '4.3' into upstream

GNU Make release 4.3
2020-05-20 13:00:47 -07:00
Manoj Srivastava
a371164325 New upstream version 4.3 2020-05-20 12:58:10 -07:00
Manoj Srivastava
eb7793c3de
Merge branch 'master' into dgit/sid 2020-05-04 19:59:21 -07:00
Manoj Srivastava
3b423d83e8 [master]: Ack NMUs, no actual changes here.
Signed-off-by: Manoj Srivastava <srivasta@debian.org>
2020-05-03 18:56:07 -07:00
Rob Browning
1ab7305f68 Record make-dfsg (4.2.1-1.3) in archive suite sid 2020-04-24 18:02:33 -07:00
Rob Browning
11b91fbea7 make-dfsg (4.2.1-1.3) unstable; urgency=medium
* Non-maintainer upload.
  * Build against guile-3.0; drop 1.8 and 2.0. (Closes: 885213)

[dgit import package make-dfsg 4.2.1-1.3]
2020-04-24 18:02:33 -07:00
Paul Smith
f430a65ccb GNU Make release 4.3
* NEWS: Update for the release
* configure.ac: New release number
* doc/make.texi: New edition number
2020-01-19 17:04:52 -05:00
Paul Smith
c30da63fd2 * configure.ac (guile): Check for Guile 3.0 installations 2020-01-19 17:04:52 -05:00
Paul Smith
3fb7312e9f * src/job.c (sh_cmds): [SV 57625] Update builtin shell command list 2020-01-19 17:04:52 -05:00
Paul Smith
dd6adfa454 Resolve some documentation issues
* doc/make.texi (Interrupts): [SV 46193] Recommend defensive recipes
* doc/make.texi: [SV 49262] Clarify interaction of prerequisites and
non-terminal match-anything rules.
2020-01-19 17:04:52 -05:00
Paul Smith
3b5e47b2e2 [SV 40657] Reinstate old behavior for suffix rules with prereqs
POSIX says that suffix rules cannot have prerequisites, but after
making this change we observed a number of makefiles "in the wild"
that were relying on this behavior and failed.

For .POSIX: makefiles, obey POSIX.  Otherwise preserve the old
behavior.  However, generate a warning so users know this is a
problem.  In a future version we will change all behavior to be
POSIX-conforming.

* NEWS: describe the change
* src/rule.c (convert_to_pattern): If posix_pedantic don't make a
pattern rule if prereqs exist.  Otherwise show a warning.
* tests/scripts/features/suffixrules: Add tests for the new behavior
including .POSIX vs. non-.POSIX.
2020-01-19 17:04:52 -05:00
Dmitry Goncharov
4e277f6fbd * tests/test_driver.pl: Enhance error messages 2020-01-05 10:46:58 -05:00
Paul Smith
ec946d7e21 * doc/make.texi: Change the GFDL to an Appendix 2020-01-04 13:24:39 -05:00
Paul Smith
16d06006a4 * NEWS: Clarify authorship of new features. 2020-01-04 13:24:39 -05:00
Paul Smith
b774aebffa Enable compilation with C90 compilers
* configure.ac: Try compiling Guile headers: they don't work with C90.
* maintMakefile: Simplify config checks via target-specific variables.
* src/makeint.h: Use ATTRIBUTE rather than defining __attribute__,
as that causes compile issues with system headers.
(ENUM_BITFIELD): Don't use enum bitfields in ANSI mode.
* src/main.c: Use ATTRIBUTE instead of __attribute__.
* src/job.h: Ditto.
* src/file.c: Don't define variables inside for loops.
* src/rule.c: Ditto.
* src/dep.h (SI): Only use static inline in non-ANSI mode.
2020-01-04 13:23:23 -05:00
Paul Smith
06de697268 * bootstrap: Update to the latest gnulib version 2020-01-03 15:44:13 -05:00
Paul Smith
fdfe0446b6 Release GNU make 4.2.93
* NEWS: Update the release and date
* configure.ac: Update the release number
2020-01-03 02:08:59 -05:00
Paul Smith
12b14f0484 Update copyright statements for 2020 2020-01-03 02:08:59 -05:00
Paul Smith
4e12a5fa45 Support the .EXTRA_PREREQS special variable
Initial implementation by Christof Warlich <cwarlich@gmx.de>

* NEWS: Announce the new feature.
* doc/make.texi (Other Special Variables): Document .EXTRA_PREREQS.
* src/dep.h (struct dep): New flag to note extra prereq deps.
* src/filedef.h (expand_extra_prereqs): Declare a function to expand
the value of .EXTRA_PREREQS.
* src/file.c (expand_extra_prereqs): Given a struct variable lookup
of .EXTRA_PREREQS, convert it into a list of deps and for each one
make sure it has a struct file and has the new flag set.
(snap_file): A new function invoked by hash_map that will perform
per-file operations: set up second expansion, intermediate, and also
.EXTRA_PREREQS.  Manage circular dependencies by ignoring them.
(snap_deps): Defer per-file operations until the end.  Look up the
global .EXTRA_PREREQS and pass it along to snap_file for each file.
* src/implicit.c (struct patdeps): Remember the extra prereqs flag.
(pattern_search): Transfer extra prereqs flag settings into the
matched pattern rule.
* src/rule.h (snap_implicit_rules): Rename count_implicit_rules to
snap_implicit_rules since we now do more than count.
* src/rule.c (snap_implicit_rules): As we walk through all the pattern
rules, add in any global .EXTRA_PREREQS to the dep list.  Ensure we
take them into account for the max number of prereqs and name length.
* src/main.c (main): Add extra-prereqs to .FEATURES.
Call the renamed snap_implicit_rules.
* tests/scripts/variables/EXTRA_PREREQS: Add tests.
2020-01-03 02:08:59 -05:00
Paul Smith
e56243fe57 * tests/scripts/features/patternrules: Use Windows-compatible quoting 2020-01-03 02:08:59 -05:00
Paul Smith
7449abfe1b * tests/test_driver.pl: Compute full path to Perl interpreter 2020-01-03 02:08:59 -05:00
Paul Smith
53b9770b40 * tests/scripts/features/exec: Don't use $ENV in the description 2020-01-03 02:08:59 -05:00
Paul Smith
766baeef0a * src/makeint.h: Add a declaration for memrchr() 2020-01-03 02:08:59 -05:00
Paul Smith
ee204c78f2 * NEWS: Remove info about disabled /proc/loadavg usage. 2019-12-27 01:42:25 -05:00
Paul Smith
e64674b718 [SV 57022] Avoid posix_spawn which fails asynchronously
Avoid using posix_spawn implementations that fail asynchronously when
the spawned program can't be invoked: this means instead of getting
an error such as "No such file or directory" we get just "Exit 127".

Original implementation of the configure.ac macro provided by
Martin Dorey <martin.dorey@hds.com>

Original implementation of the regression tests provided by
Dmitry Goncharov <dgoncharov@users.sf.net>

* configure.ac: Test whether posix_spawn fails asynchronously.  In a
cross-compilation environment, assume that it does not.  If we detect
that it does, fall back to fork/exec.
* tests/scripts/features/exec: Add regression tests for different
shebang invocation methods.
2019-12-27 01:37:17 -05:00
Paul Smith
564fb212a7 [SV 56655] Allow pattern expansion to contain spaces
* src/dep.h: Add a new flag PARSEFS_ONEWORD
* src/read.c (parse_file_seq): If PARSEFS_ONEWORD is given, treat the
entire incoming string as a single pattern.
* src/implicit.c (pattern_search): Pass PARSEFS_ONEWORD when parsing
patterns for wildcards.
* tests/scripts/features/patternrules: Add a new test.
2019-12-26 18:39:56 -05:00
Ben Wijen
30cc10093b * src/misc.c (spin): On WINDOWS32 use Sleep() instead of sleep() 2019-12-18 09:05:40 -05:00
Ben Wijen
69c5a2128b * bootstrap.bat: Fix typo in batch file name 2019-12-18 09:05:40 -05:00
Paul Smith
577dd1ff6d * src/config.h.W32.template: [SV 57152] MinGW32 doesn't support d_type 2019-12-18 09:05:40 -05:00
Jouke Witteveen
86f2f8bcb5 [SV 54161] Fix second expansion of $* for paths
If the stem matches a path containing a directory not just a
filename, make sure the second expansion of $* in the
prerequisites matches $* in the recipe.  This requires using
$(*F) when replacing % in the first expansion to preserve the
simple filename.

* src/implicit.c (pattern_search): If lastslash is set prepend
the directory onto the stem.  Then use $(*F) when expanding %.
* tests/scripts/features/se_implicit: Add a test case
2019-12-18 09:05:17 -05:00
Jouke Witteveen
c72205b28b * src/implicit.c (pattern_search): Set lastslash correctly
If filename contained multiple slashes lastslash is wrongly set to 0.
* configure.ac: Check for the GNU memrchr() extension function.
* src/misc.c (memrchr): Supply memrchr() if not available.
2019-12-17 15:06:28 -05:00
Jouke Witteveen
057e33d6b5 * src/implicit.c (pattern-search): Remove unneeded 'dir' variable 2019-12-17 15:06:28 -05:00