[OE-core] [PATCH 1/1] ncurses_6: Fix an install race condition

Bystricky, Juro juro.bystricky at intel.com
Fri Mar 11 16:35:11 UTC 2016


The patch patches an .awk file that is used to create several Makefiles.
The original code looks something like this:

install install.libs install.includes ::
               install files

So we see that install.libs and install.includes do exactly the same thing.

Given our ncurses recipe installs explicitly both targets:

“make install.libs install.includes “ the race is obvious.

So one way to fix it would be to prepend
.NOTPARALLEL install.libs install.includes

This would solve the race, but some files would be installed twice.
The other way, (the one implemented by the patch) is to create Makefiles containing:

install.libs :: ;

install install.includes::
               install files

This way the files are installed only once, and we can use parallel make.
So as long as we install explicitly install.libs and install.includes (and we do) , ncurses should
install the way they were meant to.
I believe there would be no race if we used a simple  “ make install”, but this would
probably install additional components we don’t care about.
Yes, ncurses is weird. They rely heavily on the ‘::’ rules, so rules for each target
are scattered in various places so it is not obvious to see the big picture when it comes to
dependencies.




From: Burton, Ross [mailto:ross.burton at intel.com]
Sent: Friday, March 11, 2016 1:36 AM
To: Bystricky, Juro <juro.bystricky at intel.com>
Cc: OE-core <openembedded-core at lists.openembedded.org>; Juro Bystricky <jurobystricky at hotmail.com>
Subject: Re: [OE-core] [PATCH 1/1] ncurses_6: Fix an install race condition

Hi Juro,

On 11 March 2016 at 02:07, Juro Bystricky <juro.bystricky at intel.com<mailto:juro.bystricky at intel.com>> wrote:
+As both targets install identical files. The remedy is to either prevent
+parallel make of install.libs and install.includes, or ensure only one
+target installs the files.
+The second approch will only work if we always install both libs and
+includes (which we do).

Wouldn't an upstreamable fix be to make install.includes the target that actually does something, and then have install depend on that?  Considering install.libs and install.includes are separate rules, surely install.libs in the header makefile should do nothing?  (ncurses is weird...)

Have you checked the other makefiles for the same problem?

Ross
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20160311/cddff8fe/attachment-0002.html>


More information about the Openembedded-core mailing list