bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Regression on Cygwin: Problems with parallel make in 4.4


From: Paul Smith
Subject: Re: Regression on Cygwin: Problems with parallel make in 4.4
Date: Fri, 24 Feb 2023 11:29:09 -0500
User-agent: Evolution 3.46.4 (by Flathub.org)

On Thu, 2023-02-23 at 16:17 -0500, Ken Brown wrote:
> Sorry, I spoke too soon.  I just went back to my original use case,
> in which I used the TeX Live "Build" script instead of directly
> invoking make, and I again got the jobserver warning.

Thanks for the info.

TL;DR: this is not an error in make :)

This warning is happening because the freetype2 configure script itself
is invoking make.

So the freetype2/Makefile contains this rule:

  ft-config:
        rm -rf ft-build
        $(MKDIR_P) ft-build
        cd ft-build && \
          CC='$(CC)' CONFIG_SITE=/dev/null CONFIG_SHELL='$(SHELL)' \
          $(SHELL) $(abs_srcdir)/$(FREETYPE_TREE)/configure \
            $(config_args) --disable-shared \
            --without-bzip2 \
            --without-brotli \
            --without-harfbuzz \
            --without-png \
            --without-zlib \
            --prefix=$(abs_builddir)/ft-install \
            --libdir=$(abs_builddir) \
            --includedir=$(abs_builddir)
        echo timestamp >ft-config

This rule does not appear to invoke make (doesn't contain $(MAKE) or
${MAKE}) and it does not use a "+" prefix, so make believes that this
recipe is not a recursive make invocation, and it disables the
jobserver before invoking this recipe.

But we can see from the output that the recursive make invocation
happens in the configure script:

  /usr/bin/mkdir -p ft-build
  cd ft-build && \
    CC='gcc' CONFIG_SITE=/dev/null CONFIG_SHELL='/bin/sh' \
    /bin/sh 
/home/kbrown/src/texlive/test.x86_64/Work/libs/freetype2/../../../libs/freetype2/freetype-src/configure
 \
       --disable-shared \
      --without-bzip2 \
      --without-brotli \
      --without-harfbuzz \
      --without-png \
      --without-zlib \
      
--prefix=/home/kbrown/src/texlive/test.x86_64/Work/libs/freetype2/ft-install \
      --libdir=/home/kbrown/src/texlive/test.x86_64/Work/libs/freetype2 \
      --includedir=/home/kbrown/src/texlive/test.x86_64/Work/libs/freetype2
  Copying documentation assets
  cp: cannot stat 
'/home/kbrown/src/texlive/test.x86_64/libs/freetype2/freetype-src/docs/markdown':
 No such file or directory
  Copying `modules.cfg'
  Generating `Makefile'
  make[4]: Entering directory 
'/home/kbrown/src/texlive/test.x86_64/Work/libs/freetype2/ft-build'
  make[4]: not recursive -2,-2
  make[4]: warning: jobserver unavailable: using -j1.  Add '+' to parent make 
rule.

So, if you go get the freetype2/configure script and investigate its
contents, you'll find this:

  CFG=$CFG $MAKE setup unix

This invokes make, and it's THIS invocation of make which is printing
that message, and the message is absolutely correct: the jobserver WAS
de-activated because the "recipe" (the thing that invoked configure)
was not a recursive invocation.

You have a number of options here:

- You can ignore the message since it doesn't make any difference.

- You can add a "+" prefix to the configure script in the ft-config
target's recipe in the freetype2/Makefile to explicitly tell make that
this recipe is a recursive make.

You can add a spurious reference to "$(MAKE)", like:

  ft-config:
        rm -rf ft-build
        $(MKDIR_P) ft-build
        cd ft-build && : '$(MAKE)' && \
                       ^^^^^^^^^^^^^^
          CC='$(CC)' CONFIG_SITE=/dev/null CONFIG_SHELL='$(SHELL)' \
          $(SHELL) $(abs_srcdir)/$(FREETYPE_TREE)/configure \
            ...
        echo timestamp >ft-config

to implicitly tell make that this recipe is a recursive make.

- You can remove all the MAKEFLAGS before you invoke configure:

  ft-config:
        rm -rf ft-build
        $(MKDIR_P) ft-build
        cd ft-build && : '$(MAKE)' && \
          CC='$(CC)' CONFIG_SITE=/dev/null CONFIG_SHELL='$(SHELL)' \
          MAKEFLAGS= $(SHELL) $(abs_srcdir)/$(FREETYPE_TREE)/configure \
          ^^^^^^^^^^
            ...
        echo timestamp >ft-config

- You could also file a bug against freetype2 and suggest that they
themselves unset MAKEFLAGS in their configure script, since it's very
unusual for a configure script to invoke make:

  CFG=$CFG MAKEFLAGS= $MAKE setup unix

This issue is one of the reasons we switched to named pipes: in that
mode there's no need to pass resources (like open file descriptors) to
sub-makes, and so we don't have to disable them.  We can just assume
that only a sub-make will parse the MAKEFLAGS and open the named pipe.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]