[PATCH] Install failures from a race condition
Submitted by fed..@..il.com
Assigned to Shared Mime Info group
Link to original bug (#100142)
Description
Created attachment 130150 Avoid install-data-hook race conditions
There is a random failure due to a race condition with install-data-hook. The install command in install-binPROGRAMS can be run twice simultaneously from the "make install-exec-am" and "make install-data-hook" processes, sometimes resulting in the following "make install" failure:
make install-data-hook /usr/bin/install -c update-mime-database '/var/tmp/portage/x11-misc/shared-mime-info-1.4/image//usr/bin' make[3]: Entering directory '/var/tmp/portage/x11-misc/shared-mime-info-1.4/work/shared-mime-info-1.4' /bin/mkdir -p '/var/tmp/portage/x11-misc/shared-mime-info-1.4/image//usr/bin' /usr/bin/install -c update-mime-database '/var/tmp/portage/x11-misc/shared-mime-info-1.4/image//usr/bin' /usr/bin/install: cannot create regular file '/var/tmp/portage/x11-misc/shared-mime-info-1.4/image//usr/bin/update-mime-database': File exists
I've attached a patch that just makes the entire install-data-hook target part of the condition from --enable-update-mimedb. While it's not a complete fix, it will prevent the error from happening in distros' build systems which tend to use --disable-update-mimedb and handle the database separately.
Patch 130150, "Avoid install-data-hook race conditions":
0001-build-Avoid-install-data-hook-race-conditions.patch