|
|
Subscribe / Log in / New account

GNU make 4.3 released

GNU make 4.3 is out. New features include explicit grouped targets, a new .EXTRA_PREREQS variable, the ability to specify parallel builds in the makefile itself, and more. There are also a couple of backward-incompatible changes; see the announcement for details.


From:  Paul Smith <psmith-AT-gnu.org>
To:  info-gnu-AT-gnu.org, bug-make-AT-gnu.org
Subject:  GNU make 4.3 released!
Date:  Sun, 19 Jan 2020 17:42:52 -0500
Message-ID:  <ae5b755160516bdd7f17437f35959189300c2a1e.camel__38747.3725759023$1579473970$gmane$org@gnu.org>
Cc:  coordinator-AT-translationproject.org
Archive-link:  Article

    --------------------------------------------------------------------
    GNU make is a tool which controls the generation of executables and
    other non-source files of a program from the program's source files.

    You can learn more at: http://www.gnu.org/software/make/
    --------------------------------------------------------------------

The next stable release of GNU make, 4.3, is available now for download:

    d5c40e7bd1e97a7404f5d3be982f479a  make-4.3.tar.lz (1.3M)
    fc7a67ea86ace13195b0bce683fd4469  make-4.3.tar.gz (2.3M)

You can obtain a copy from:           http://ftp.gnu.org/gnu/make/
You can choose a nearby mirror:       http://ftpmirror.gnu.org/make/
A list of mirror sites is available:  http://www.gnu.org/order/ftp.html

- NEWS ----------------------------------------------------------------

Version 4.3 (19 Jan 2020)

A complete list of bugs fixed in this version is available here:

https://sv.gnu.org/bugs/index.php?group=make&report_i...

* WARNING: Backward-incompatibility!
  Number signs (#) appearing inside a macro reference or function invocation
  no longer introduce comments and should not be escaped with backslashes:
  thus a call such as:
    foo := $(shell echo '#')
  is legal.  Previously the number sign needed to be escaped, for example:
    foo := $(shell echo '\#')
  Now this latter will resolve to "\#".  If you want to write makefiles
  portable to both versions, assign the number sign to a variable:
    H := \#
    foo := $(shell echo '$H')
  This was claimed to be fixed in 3.81, but wasn't, for some reason.
  To detect this change search for 'nocomment' in the .FEATURES variable.

* WARNING: Backward-incompatibility!
  Previously appending using '+=' to an empty variable would result in a value
  starting with a space.  Now the initial space is only added if the variable
  already contains some value.  Similarly, appending an empty string does not
  add a trailing space.

* NOTE: Deprecated behavior.
  Contrary to the documentation, suffix rules with prerequisites are being
  treated BOTH as simple targets AND as pattern rules.  Further, the
  prerequisites are ignored by the pattern rules.  POSIX specifies that in
  order to be a suffix rule there can be no prerequisites defined.  In this
  release if POSIX mode is enabled then rules with prerequisites cannot be
  suffix rules.  If POSIX mode is not enabled then the previous behavior is
  preserved (a pattern rule with no extra prerequisites is created) AND a
  warning about this behavior is generated:
    warning: ignoring prerequisites on suffix rule definition
  The POSIX behavior will be adopted as the only behavior in a future release
  of GNU make so please resolve any warnings.

* New feature: Grouped explicit targets
  Pattern rules have always had the ability to generate multiple targets with
  a single invocation of the recipe.  It's now possible to declare that an
  explicit rule generates multiple targets with a single invocation.  To use
  this, replace the ":" token with "&:" in the rule.  To detect this feature
  search for 'grouped-target' in the .FEATURES special variable.
  Implementation contributed by Kaz Kylheku <kaz@kylheku.com>

* New feature: .EXTRA_PREREQS variable
  Words in this variable are considered prerequisites of targets but they are
  not added to any of the automatic variable values when expanding the
  recipe.  This variable can either be global (applies to all targets) or
  a target-specific variable.  To detect this feature search for 'extra-prereqs'
  in the .FEATURES special variable.
  Implementation contributed by Christof Warlich <cwarlich@gmx.de>

* Makefiles can now specify the '-j' option in their MAKEFLAGS variable and
  this will cause make to enable that parallelism mode.

* GNU make will now use posix_spawn() on systems where it is available.
  If you prefer to use fork/exec even on systems where posix_spawn() is
  present, you can use the --disable-posix-spawn option to configure.
  Implementation contributed by Aron Barath <baratharon@caesar.elte.hu>

* Error messages printed when invoking non-existent commands have been cleaned
  up and made consistent.

* The previous limit of 63 jobs under -jN on MS-Windows is now
  increased to 4095.  That limit includes the subprocess started by
  the $(shell) function.

* A new option --no-silent has been added, that cancels the effect of the
  -s/--silent/--quiet flag.

* A new option -E has been added as a short alias for --eval.

* All wildcard expansion within GNU make, including $(wildcard ...), will sort
  the results.  See https://savannah.gnu.org/bugs/index.php?52076

* Interoperate with newer GNU libc and musl C runtime libraries.

* Performance improvements provided by Paolo Bonzini <pbonzini@redhat.com>

GNU make Developer News

* Import the GNU standard bootstrap script to replace the hand-rolled
  "make update" method for building code from a GNU make Git repository.

* Rework the source distribution to move source files into the src/*
  subdirectory.  This aligns with modern best practices in GNU.

* Replace local portability code with Gnulib content.  Unfortunately due to a
  problem with Gnulib support for getloadavg, this forces a requirement on
  Automake 1.16 or above in order to build from Git.  See README.git.

- Log -----------------------------------------------------------------

Aron Barath (4):
      * src/makeint.h: Use pid_t to store PIDs, of int.
      * configure.ac: Check for spawn.h and posix_spawn()
      * configure.ac: Check for posix_spawnattr_setsigmask
      * job.c (child_execute_job): Prefer posix_spawn() over fork()/exec()

Ben Hutchings (1):
      * src/arscan.c (ar_scan): [SV 54395] Allow long names in archives.

Ben Wijen (2):
      * bootstrap.bat: Fix typo in batch file name
      * src/misc.c (spin): On WINDOWS32 use Sleep() instead of sleep()

Bernhard M. Wiedemann (1):
      * src/read.c (parse_file_seq): [SV 52076] Sort wildcard results.

Christian Eggers (1):
      [SV 56449] (Windows) Use slow path if '%' appears in the command

Christoph Schulz (1):
      * main.c (switches): [SV 48809] Accept obsolete jobserver flag.

Dmitry Goncharov (1):
      * tests/test_driver.pl: Enhance error messages

Eli Zaretskii (9):
      Avoid compiler warnings with MinGW runtime 3.22.2
      Update the Guile version tested with the MS-Windows build.
      Only include strings.h in MinGW builds
      * NEWS: Mention the extended support for -jN on MS-Windows.
      [SV 50021] Avoid infloop on MS-Windows with short scripts
      Avoid crashes when SHELL=abcde is specified on the command line
      Fix checking existence of directories on MS-Windows
      Fix MS-Windows MinGW build
      Revert "[SV 56449] (Windows) Use slow path if '%' appears in the command"

Enrique Olaizola (2):
      * tests/run_make_tests.pl: [SV 50902] Find Perl modules
      * read.c (read_all_makefiles): [SV 50909] Add MAKEFILES to strcache

Florian Weimer (1):
      * configure.ac (HAVE_GETTIMEOFDAY): Avoid undeclared exit function.

Jaak Ristioja (2):
      * w32/*/dirent.*: [SV 49111] Remove unused telldir()
      * expand.c (variable_append): [SV 49113] Possible null ptr deref

Jouke Witteveen (3):
      * src/implicit.c (pattern-search): Remove unneeded 'dir' variable
      * src/implicit.c (pattern_search): Set lastslash correctly
      [SV 54161] Fix second expansion of $* for paths

Kaz Kylheku (1):
      [SV 8297] Implement "grouped targets" for explicit rules.

Marc Ullman (1):
      Support more than 63 jobs on MS-Windows

Martin Dorey (2):
      * main.c (main): [SV 49935] Fix uninitialized variable.
      * job.c (child_execute_job): [SV 49938] Avoid spurious GCC warning.

Mike Haboustak (1):
      [SV 28456] Don't override $< when no default rule has been defined

Ola Olsson (1):
      * doc/make.texi: Updated language

Paolo Bonzini (6):
      Use strchr/memmove in collapse_continuations.
      Use strchr for simple case of find_char_unquote.
      Use Jenkins hash.
      Remove MAP_PERCENT as strchr is faster.
      Speedup parsing of functions.
      Do not use STOP_SET for singleton compares.

Paul Eggert (7):
      glob: Do not assume glibc glob internals.
      Pacify Oracle Studio 12.6
      Pacify Oracle Studio 12.6 in init_switches
      Remove useless code in eval
      Port grouped_targets test to Solaris 10
      Pacify Oracle Studio c99
      Port functions/shell test to Solaris 10

Paul Smith (172):
      * Update to pre-release version 4.2.90.
      * README.W32.template: Update the build documentation.
      Resolve issues discovered by static code analysis.
      * maintMakefile: Update default GPG ID for new key.
      * doc/make.texi: [SV 48951] Fix documentation typo.
      * README.template: Clarify some items in the README
      * po/LINGUAS: Added Serbian translation.
      * po/Makevars, makeint.h, debug.h: Add xgettext C format flags.
      Add more GCC warnings to the maintainer build.
      [SV 49116] Check potential null pointer dereference.
      [SV 45477] [SV 49115] Parse DOS/Windows drivespecs correctly.
      [SV 49114] Remove support for the NO_FLOAT compile flag.
      * read.c (get_next_mword): [SV 49865] Make fallthrough explicit.
      * main.c (main): [SV 40234] Show correct error message.
      [SV 20513] Un-escaped # are not comments in function invocations
      Portability changes for the test suite.
      [SV 40236] Handle included file open failures properly.
      * main.c (switches): Add --no-silent to undo -s options.
      * main.c (switches): Add -E as an alias for --eval.
      Add test suite support to Windows
      * doc/make.texi: [SV 50304] Add missing close parenthesis.
      * configure.ac: [SV 50648] Detect Guile 2.2 packages.
      [SV 50300] Use CFLAGS value of "-O1" in POSIX mode.
      Clean up close-on-exec, particularly with jobserver pipes.
      [SV 13651] Handle out-of-memory conditions slightly more gracefully.
      Rename output_tmpfile() to a misc function get_tmpfile()
      * po/LINGUAS: Add support for traditional Chinese (zh_TW)
      * NEWS: Do not insert a space during '+=' if the value is empty.
      * tests/test_driver.pl: Useful error if given an invalid test name.
      [SV 50823] Support filenames containing '$' in MAKEFILE_LIST
      [SV 51159] Use a non-blocking read with pselect to avoid hangs.
      * function.c (shell_completed): [SV 51014] Add signal to .SHELLSTATUS
      [SV 51400] Only unblock fatal signals after child invocation
      * variable.c (create_pattern_var): [SV 51266] Create with xcalloc().
      Remove uses of unnecessary "register" keyword.
      Update copyright statements for 2017.
      Compute load from number of running processes.
      * function.c (func_if): Check the first character of condition.
      * job.c (child_error): Modify error message string.
      * main.c (main): [SV 48274] Allow -j in makefile MAKEFLAGS variable.
      * Makefile.am: Add jhelp.pl to remote test setup.
      Remove unsupported build facilities.
      * tests/scripts/features/output-sync: Revert bad change in 0c5a9f9b92a
      * job.c: Add "command" as a known shell built-in.
      Rework directory structure to use GNU-recommended "src" directory.
      * configure.ac: Support GLIBC glob interface version 2
      * build_w32.bat: Support Visual Studio 17.
      * scripts/copyright-update: Maintainer's script for copyright mgmt
      * all: Update Copyright statements for 2018
      * Makefile.ami, glob/Makefile.ami: Remove obsolete files
      Convert GNU make to use the gnulib portability library
      * function.c(abspath): Use memcpy() to avoid GCC 8.1 warnings
      * maintMakefile: Preserve comments during compilation
      Update regression tests for Windows.
      Resolve most of the Windows Visual Studio warnings.
      Enhance the Basic.mk environment to work with Gnulib
      * src/read.c(unescape_char): Use C comments not C++ comments.
      Queue failed fork() (etc.) to be handled like any other failed job.
      Clean up errors for invalid commands and add regression tests.
      * src/job.c (child_execute_job): Clean up posix_spawn invocation
      * configure.ac: Add --disable-posix-spawn option
      * lib/glob.c (glob_in_dir): [SV 53465] Allow symlinks to directories.
      * tests/scripts/features/archives: [SV 54395] Test long archive names.
      * tests/scripts/functions/wildcard: [SV 52018] Test dangling symlink.
      * src/job.c (reap_children): Fix inverted win/lose message.
      [SV 54233] Preserve higher command_state values on also_make targets.
      * NEWS: Update for the latest changes.
      [SV 40657] Don't create pattern rules for suffix rules with deps.
      * doc/make.text: [SV 54360] Weaken "obsolete" language in the manual.
      * doc/make.texi: [SV 48970] Clarify the value of $?
      * src/main.c (main): Set jobserver permissions before re-execing
      * doc/make.texi (Remaking Makefiles): [SV 52273] Note MAKE_RESTARTS
      Change output_write() to writebuf(), add readbuf() helper.
      * src/arscan.c (ar_member_touch): [SV 54533] Stop \0 in archive headers
      Add developer customizations
      * po/LINGUAS: Add Portuguese translation
      * variable.c (define_variable_in_set): Clear new structs
      Update copyright statements for 2019
      [SV 54740] Ensure .SILENT settings do not leak into sub-makes
      * src/hash.c (jash_string): [SV 54980] Avoid ASAN error
      [SV 54549] Don't free used set_lists during merge
      Update developer customizations
      [SV 46013] Allow recursive variable overrides from Makefiles
      * doc/make.texi: [SV 54116] Document whitespace removal trick.
      * doc/make.texi: [SV 51974] Clarify makefile parsing operations.
      Switch to the gnulib version of strerror()
      * src/read.c (parse_file_seq): Update comments.
      * po/LINGUAS: Add a translation for Bulgarian.
      * scripts/copyright-update: Use git ls-files for controlled files
      * bootstrap: Update from latest gnulib version
      * src/job.c (child_execute_job): Set pid to -1 on posix_spawn failure.
      * src/job.c (construct_command_argv): Remove unused VMS code
      * tests/scripts/misc/general3: Add more tests for SHELL/.SHELLFLAGS
      * tests/scripts/features/archives: [SV 54395] Support non-GNU ar.
      Update maintainer mode to support debug wait points.
      * NEWS: Update for pre-release
      * src/read.c (parse_file_seq): [SV 52076] Don't reverse glob() results.
      * NEWS: Fix incorrect notes.
      * src/dir.c (dir_setup_glob): Initialize unused gl_offs.
      * configure.ac: Remove redundant getloadavg gnulib support
      Don't reset stack size when using posix_spawn()
      * maintMakefile: Use check-local when testing build.sh.
      * tests/scripts/functions/wildcard: Skip dangling symlink test.
      Update to GNU make release candidate 4.2.91
      * tetss/run_make_test.pl: Avoid 'sh -c' for Windows portability.
      * tests/scripts/features/archives: Fix expected long ar name output.
      * README.git: Describe GCC and GNU make requirements
      Show useful errors when posix_spawn() doesn't do so
      * src/job.c (start_job_command) [VMS]: Correct VMS comment.
      * doc/make.tex (Substitution Refs): Clarify patsubst relationship.
      Align child_execute_job among different ports
      * doc/make.texi: Clarify that the jobserver pipe is "blocking"
      * build.template: Rewrite to allow gnulib support.
      * src/makeint.h: Add typedef for mode_t if !HAVE_UMASK
      * src/config.h.W32.template [W32]: Add support for dirent.d_type
      * configure.ac: Check whether struct dirent has a d_type field
      * doc/make.texi (Recipe Execution): Correct example to use $(<[DF])
      [SV 56834] Support local PATH search with posix_spawnp
      * gl/modules/make-glob: Move local glob configure.ac to here
      Rework the creation of build.sh so it's not a template.
      * src/job.c (child_execute_job): Use newer gnulib findprog version.
      * src/job.c (child_execute_job): Use errno from find_in_given_path().
      * tests/test_driver.pl: Remember error for "running" a directory.
      * README.git: [SV 56895] Provide more info about "maintainer mode".
      * tests/config-flags.pm.in: Add USE_SYSTEM_GLOB.
      Refresh the test suite framework implementation.
      * tests/run_make_tests.pl: Create $scriptsuffix for Windows/VMS.
      * NEWS: Update date and clarify -l change.
      * tests/run_make_tests.pl (find_prog): Fix syntax error.
      * tests/run_make_test.pl: Fix support for valgrind.
      * tests/scripts/functions/shell: Detect correct SHELLSTATUS code.
      * src/arscan.c (ar_scan): Restrict length for sscanf of ar_mode.
      [SV 56918] Compute job slots properly on failing command
      * src/job.c (child_execute_job): Allocate space for argv NULL.
      * tests/scripts/function/guile: Valgrind doesn't work with Guile.
      * tests: Convert from File::Spec::Functions to File::Spec.
      * job.c (child_error): Modify error message string.
      * test/test_driver.el (_run_with_timeout): Show error message.
      * tests/scripts/features/vpathplus: Fix output for big-endian systems.
      * src/function.c (func_realpath) [AIX]: Remove trailing slashes.
      * tests/run_make_tests.pl (valid_option): Add missing File::Spec
      * src/hash.c (jhash_string): Don't read past end of string.
      tests: Convert %CONFIG_FLAGS to get_config()
      * tests/scripts/functions/wildcard: Skip slash tests for local glob.
      * Makefile.am (check-regression): Use PERLFLAGS when running Perl
      * doc/make.text (Reading Makefiles): Rewrite to be more clear.
      Release GNU make 4.2.92
      Rename jhelp.pl to thelp.pl and make it a generic test helper.
      * tests/run_make_tests.pl (subst_make_string): Force use of /
      * tests/run_make_tests.pl (set_more_defaults): Fix typo
      * src/job.c (load_too_high): Disable Linux /proc/loadavg for now
      * Makefile.am: Build lzip package instead of bzip2
      * src/config.h.W32.template: [SV 57152] MinGW32 doesn't support d_type
      [SV 56655] Allow pattern expansion to contain spaces
      [SV 57022] Avoid posix_spawn which fails asynchronously
      * NEWS: Remove info about disabled /proc/loadavg usage.
      * src/makeint.h: Add a declaration for memrchr()
      * tests/scripts/features/exec: Don't use $ENV in the description
      * tests/test_driver.pl: Compute full path to Perl interpreter
      * tests/scripts/features/patternrules: Use Windows-compatible quoting
      Support the .EXTRA_PREREQS special variable
      Update copyright statements for 2020
      Release GNU make 4.2.93
      * bootstrap: Update to the latest gnulib version
      Enable compilation with C90 compilers
      * NEWS: Clarify authorship of new features.
      * doc/make.texi: Change the GFDL to an Appendix
      [SV 40657] Reinstate old behavior for suffix rules with prereqs
      Resolve some documentation issues
      * src/job.c (sh_cmds): [SV 57625] Update builtin shell command list
      * configure.ac (guile): Check for Guile 3.0 installations
      GNU Make release 4.3

spagoveanu@gmail.com (1):
      * src/dir.c: Preserve glob d_type field


to post comments

Breakage ahead

Posted Jan 21, 2020 0:05 UTC (Tue) by mirabilos (subscriber, #84359) [Link] (9 responses)

The \# change is likely to introduce breakage… thankfully it only affects an already GNU make-specific feature, but I can imagine people having used it. (Just had a short grep through all debian/rules files I had at hand and could not find it, only one use of \# outside of gmake functions, but that doesn’t exclude the probability.)

The parallelism thing will also be fun… how to enforce an upper limit, or no parallelism… does -j0 (is that even a thing?) or -j1 (perhaps that instead… how *do* you disable parallelism?) take precedence, at least? Running multiple builds in parallel will need the individual builds to not take up too many CPUs…

Breakage ahead

Posted Jan 21, 2020 6:06 UTC (Tue) by madscientist (subscriber, #16861) [Link] (2 responses)

We had months of pre-releases and no reports of anyone having a problem with \#. Of course, that only means that we'll get reports within the week. But some of these quoting/escaping problems are simply to problematic to live: make's syntax is already tricky enough as it is, and trying to allow both old and new behaviors is a huge mess.

Yes, -j set on the command line overrides values set in the makefile. -j1 disables parallelism. -j0 is currently an error and not accepted: "make: the '-j' option requires a positive integer argument"

Breakage ahead

Posted Jan 21, 2020 16:41 UTC (Tue) by mirabilos (subscriber, #84359) [Link]

Indeed ☻ don’t I know that… (followup bugfix releases within the week)

Thanks for the response and information!

Breakage ahead

Posted Jan 21, 2020 18:24 UTC (Tue) by josh (subscriber, #17465) [Link]

Would it be possible to have a built-in option to do -j with the number of processors, to allow documentation and Makefiles to eventually use that instead of assuming the availability of programs like nproc (which doesn't necessarily exist on non-Linux)? Perhaps a -J (capital J) option?

Breakage ahead

Posted Jan 21, 2020 18:31 UTC (Tue) by josh (subscriber, #17465) [Link] (5 responses)

> Running multiple builds in parallel will need the individual builds to not take up too many CPUs…

If you're running multiple builds in parallel, consider running a jobserver. That would allow limiting the combined CPUs used by all the builds, while allowing a build to use more CPUs while another build is using less.

The jobserver protocol isn't hard to implement manually, even if not using make.

Breakage ahead

Posted Jan 21, 2020 19:24 UTC (Tue) by mirabilos (subscriber, #84359) [Link] (2 responses)

No, the scenario is here to have one (physical or virtual, doesn’t matter) machine with multiple CPU cores, running, for example, two instances of a Debian buildd setup (e.g. one for unstable, one for experimental, or, one for 32-bit and one for 64-bit). The actual builds all happen in isolated chroots (not VMs, so the chroots would “see” all CPUs), but must be limited to nproc/2 (in this scenario).

Another example is building stuff on a workstation while using it (with modern GUI apps that use a lot of CPU) at the same time.

Breakage ahead

Posted Jan 21, 2020 23:48 UTC (Tue) by madscientist (subscriber, #16861) [Link] (1 responses)

You should examine GNU make's -l (lowercase L) option. This works in conjunction with -j by checking the load on the system and ensuring that it doesn't get too high. So, make will start a maximum of -j parallel commands, unless the load is higher than specified with -l.

This is all described in the manual: https://www.gnu.org/software/make/manual/html_node/Parall...

Breakage ahead

Posted Jan 22, 2020 2:00 UTC (Wed) by mirabilos (subscriber, #84359) [Link]

Maybe so, but the process of building Debian packages has a well-defined way for the invoker to specify a maximum number of CPUs to use, so this must be supportable.

Breakage ahead

Posted Jan 23, 2020 15:59 UTC (Thu) by StefanBr (guest, #110916) [Link] (1 responses)

> The jobserver protocol isn't hard to implement manually, even if not using make.

Unfortunately, the jobserver protocol is broken.

Job tokens are passed down via inherited file descriptors -

Caveat 1: If the called program is not $(MAKE) (verbatim), the file descriptors are closed on exec (FD_CLOEXEC), and the chain ends there. You can opt-in by adding a '+' in front of your command, but then you have to do that on every elegible command. Hint - none of the common Makefile generators does that.

Caveat 2: If you happen to call make indirectly (e.g. via a script called from the Makefile), unfortunately the '--jobserver-auth=<readfd>,<writefd>' will still be in the MAKEFLAGS env var although make had just closed the corresponding file descriptors. Two things can happen:

a) The fds no longer refer to valid file descriptors - make will detect this
b) The fds have been reused in the meantime - make will find valid file descriptors. If the fd is not readable (e.g. referring to a write end of a pipe), make will start busy looping. If the fd is readable, it will spawn a new job for every byte read (now figure what will happen if it points to a 2 kByte source file ...)

Breakage ahead

Posted Jan 23, 2020 16:16 UTC (Thu) by mirabilos (subscriber, #84359) [Link]

Caveat 3: the Korn shell closes open file descriptors >2 upon running external programs, so if you have any shell scripts in between…

GNU make 4.3 released

Posted Jan 21, 2020 10:18 UTC (Tue) by pm215 (subscriber, #98099) [Link] (1 responses)

Wow, the 'rules with grouped targets' feature is something I've felt was missing from Make for decades -- much appreciation for the work done to specify and implement something to fill that gap!

Grouped targets is this version's killer feature

Posted Jan 22, 2020 14:42 UTC (Wed) by david.a.wheeler (subscriber, #72896) [Link]

I agree. I think "grouped targets" is this version of GNU make's killer feature.

My "make-booster" GNU make package here: https://github.com/david-a-wheeler/make-booster implements a mechanism to do grouped targets that works on all versions of GNU make. But it's much nicer to have the facility built-in.

GNU make 4.3 released

Posted Jan 26, 2020 15:19 UTC (Sun) by felix.s (guest, #104710) [Link] (1 responses)

Enabling parallelism from within the makefile seems like a misfeature. The person writing the makefile is not necessarily the one who knows on what machine the project will be built and therefore will not know the optimal value for the -j option. Right now, I am using a single-core machine, on which doing parallel builds only brings counterproductive overhead; from now on I'd be forced to pass -j1 every time I use make on it, including indirectly.

The -j should only be possible to enable on the command line, for the same reason GCC refuses to honour (the equivalent of) -march=native specified in source code.

(Also, even on multicore machines on which I tried it, when I start make with plain -j, the machine becomes unusable for interactive tasks while make is running, so I usually prefer to pass -j6 anyway. But now a makefile may choose to enable -j by default, setting me up for an unpleasant surprise.)

GNU make 4.3 released

Posted Jan 26, 2020 22:49 UTC (Sun) by mathstuf (subscriber, #69389) [Link]

> But now a makefile may choose to enable -j by default, setting me up for an unpleasant surprise.)

That's clearly a bug. `-j` without a number is basically asking for a dead machine (it means that processes are never counted and whenever make get scheduled again, it's free to fork off even more work). It needs to be combined with the `-l` flag to really be useful.

That said, I do really prefer the default of ninja to default to a `nproc + 2` parallelism level. I hope something like *that* becomes the snippet "everyone" ends up copying.


Copyright © 2020, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds