From 477a1e8ed493132e3741c5830c4bd30e19820951 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Tue, 22 Nov 2016 21:33:58 -0800 Subject: 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/local.mk b/src/local.mk index c5898cca1..36dfa4e30 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 -- cgit v1.2.3-54-g00ecf