]> git.ipfire.org Git - thirdparty/coreutils.git/commit
build: avoid racy failure of "make -jN install"
authorJim Meyering <meyering@fb.com>
Wed, 23 Nov 2016 05:33:58 +0000 (21:33 -0800)
committerJim Meyering <meyering@fb.com>
Wed, 23 Nov 2016 15:35:56 +0000 (07:35 -0800)
commit477a1e8ed493132e3741c5830c4bd30e19820951
tree300b3c88ed65b99a313d80708673f1bbd52e0302
parentfb82445ea07b3d8c7b76f2ea0df204ef7b7f36f3
build: avoid racy failure of "make -jN install"

Installing with -j2 or greater could result in a failure like
  /bin/sh: line 29: /P/bin/install: Permission denied
when /P/bin/install specifies your PATH-selected install program.
This would arise because we're using "install" to install all
man/*.1 files, and that command would run concurrently with the one
that installs "/P/bin/install" itself.  We would run this command:
"src/ginstall src/ginstall /P/bin/install", and it would result
in intervals during which the destination file does not exist,
is empty or incomplete and not executable.  We addressed this
problem long ago for installation of actual binaries by telling the
installation rules to use our just-built bin/ginstall (only when not
cross-compiling) rather than the PATH-resolved "install" program.
This change is to do the same for those .1 files.
* src/local.mk (INSTALL): Override automake's default of something
like "INSTALL = /P/bin/install -c".
(INSTALL_PROGRAM): Now that we set INSTALL, there is no longer any
need to set this derived variable.  Its default definition,
"INSTALL_PROGRAM = ${INSTALL}" does what we require.
Improved by Eric Blake.
src/local.mk