]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
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)
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

index c5898cca1c0363ef77da7cdbcd34965f3ea84d10..36dfa4e3023f7b675b2c54358b5812e1dbc31925 100644 (file)
@@ -649,4 +649,4 @@ cu_install_program = @INSTALL_PROGRAM@
 else
 cu_install_program = src/ginstall
 endif
-INSTALL_PROGRAM = $(cu_install_program)
+INSTALL = $(cu_install_program) -c