From: Jim Meyering Date: Wed, 23 Nov 2016 05:33:58 +0000 (-0800) Subject: build: avoid racy failure of "make -jN install" X-Git-Tag: v8.26~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=477a1e8e;p=thirdparty%2Fcoreutils.git 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. --- diff --git a/src/local.mk b/src/local.mk index c5898cca1c..36dfa4e302 100644 --- a/src/local.mk +++ b/src/local.mk @@ -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