[Buildroot] [PATCH v6 17/28] core/pkg-infra: Fix package file statistics for parallel build

Thomas Petazzoni thomas.petazzoni at bootlin.com
Wed Mar 11 22:07:03 UTC 2020


Hello,

On Mon, 17 Feb 2020 22:23:39 +0100
Andreas Naumann <anaumann at ultratronik.de> wrote:

> When activating top level parallel build, multiple processes may
> try to modify the various *files-list* files in the common build/
> directory at the same time. This can cause racy build failures.
> 
> The fix here is to use flock to ensure exclusive execution of the
> statistics gathering code. For this to work it is assumed that the
> target/staging/host directories are isolated, which is true for
> per-package builds.
> For standard sequential builds, the locking is of course unnecessary
> but no conditional handling is implemented  since the runtime cost is
> expected to be next to nothing.
> 
> For flock to work, the statistics gathering code must be run in a
> single subshell. Otherwise the lockfile descriptor would be closed
> after the subshell (= the Makefile line where it was opened) ends
> and thus the lock would be released before even entering the critical
> code section.
> 
> Signed-off-by: Andreas Naumann <anaumann at ultratronik.de>

This is no longer needed: we have taken a different approach in commit
0e2be4db8ab01d479177a3a187c22525752195ae, where we make the logic
per-package, and collect the overall data in target-finalize.

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


More information about the buildroot mailing list