[Buildroot] [PATCH v6 17/28] core/pkg-infra: Fix package file statistics for parallel build
Andreas Naumann
dev at andin.de
Mon Mar 16 21:54:38 UTC 2020
Hi,
On 11.03.20 23:07, Thomas Petazzoni wrote:
> 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.
I'm very glad as I wasnt too happy about this.
regards,
Andreas
>
> Thanks,
>
> Thomas
>
More information about the buildroot
mailing list