Forum > General
Lazbuild concurrency issue
Wallaby:
I use lazbuild to compile my app for multiple platforms. To speed up the process, I want to invoke several instances of lazbuild in parallel. On any modern multi-core machine, this dramatically decreases build time. For example, if building for one platform takes 30 seconds, building for four platforms sequentially takes 2 minutes. However, running four instances of lazbuild on multiple cores compiles everything in 35 seconds.
The issue is concurrency. In my LPI file, I have something like this:
--- Code: XML [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---<UnitOutputDirectory Value="$(TestDir)\lib\$(TargetCPU)-$(TargetOS)" />
This ensures all PPUs and related files go to a separate directory for each platform and don't conflict with each other during parallel builds. However, the problem is that lazbuild recompiles the project resources and updates the RES file in the project folder. This leads to concurrency issues as multiple processes try to update the same file, resulting in failed builds or broken project resources.
Is there a way to rebuild project resources to UnitOutputDirectory or a similar location, so multiple instances of lazbuild do not conflict with each other? Perhaps this could be a lazbuild improvement.
MarkMLl:
--- Quote from: Wallaby on June 14, 2024, 04:07:23 am ---However, the problem is that lazbuild recompiles the project resources and updates the RES file in the project folder.
--- End quote ---
That's definitely worth raising a bug report for, particularly if you can demonstrate that it's the only issue in that area.
MarkMLl
Thaddy:
I thought that lazbuild itself is already multi-threaded or multi-thread capable?
MarkMLl:
--- Quote from: Thaddy on June 14, 2024, 09:13:57 am ---I thought that lazbuild itself is already multi-threaded or multi-thread capable?
--- End quote ---
But this is about potentially-clashing temporary files, so appears to have been overlooked.
MarkMLl
JuhaManninen:
--- Quote from: Thaddy on June 14, 2024, 09:13:57 am ---I thought that lazbuild itself is already multi-threaded or multi-thread capable?
--- End quote ---
Lazarus IDE and AFAIK also LazBuild can compile required packages of a project in parallel.
The IDE can compile many buildmodes sequentially at one go, and they can be used for different platforms.
If temporary files and other issues can be solved, those buildmodes could be compiled in parallel.
Then this same system could be used by LazBuild.
Navigation
[0] Message Index
[#] Next page