构建目标随机失败,没有明显错误。为什么? [英] Build targets fail at random with no apparent error. Why?

查看:65
本文介绍了构建目标随机失败,没有明显错误。为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我们的构建系统(基于MSBuild 14.0)并行化以使用40核机器之后,我开始得到一堆随机故障,例如


73:2>完成建筑项目"... \Drivers\UsnTracker \UsnTracker.vcxproj" (PreBuildEvent; BuildGenerateSources target(s)) - FAILED。


没有先前明显的原因 - 日志中没有失败的目标。在所有这些情况下,此项目的先前实例(此处执行为(73))确实成功构建并且确实包括此处提到的所有目标。所有这些都被标记为"以前
成功运行"然而,在这个失败的实例(73:2)中,最终结果是"失败"。违背所有期望。这种情况在看似随机的时间发生,每次都有不同的项目(但有些项目很可能)。  


然后构建系统声称存在"0错误"。即使发生了这种情况,但是有些项目不会构建,因为根据失败的目标也会将FAILED传播到它们中。


为想要查看的人附加日志。感谢任何指示。 


开始记录:https://drive.google.com/file/d/0B-R6hVAMpxwxVG5HYnoteDBuU2c/view?usp=sharing


日志结束:https://drive.google.com/file/d/0B-R6hVAMpxwxU3RHYXlzZmV1SU0/view?usp=sharing (注意"0错误",即使提到了失败)

解决方案

您好Ondrej Dobias,


感谢您在此发帖。


>>> 构建目标随机失败,没有明显错误。为什么?


我在日志中并行化您的构建系统后发现某些目标被忽略,您是否曾尝试禁用并行或尝试一次在解决方案中构建项目,然后检查构建
日志。您可以将MSBuild项目构建输出详细程度(在Visual Studio的选项/项目和解决方案/构建和运行设置区域中)设置为"诊断"。或"细节"。如果可能,尝试重新启动Visual Studio,PC和清洁解决方案,
然后重建所有。




After parallelizing our build system (based on MSBuild 14.0) to use a 40 core machine, I've started getting a bunch random failures such as

73:2>Done Building Project "...\Drivers\UsnTracker\UsnTracker.vcxproj" (PreBuildEvent;BuildGenerateSources target(s)) -- FAILED.

with no prior apparent cause - there are no failing targets in the log. In all such cases, previous instance of this project (here executed as (73)) did get built sucessfully and did include all targets mentioned here. All of them were also marked as "previously ran successfully" in this failing instance (73:2), however, the end result is "FAILED" against all expectations. This happens at seemingly random times and with different projects each time (yet with high probability on some of them).  

The build system then claims there are "0 Error(s)" even if this happens, however some projects do not get built since depending on failing targets propagates the FAILED into them as well.

Attaching the logs for whoever would like to have a look. Appreciate any pointers. 

Start of log: https://drive.google.com/file/d/0B-R6hVAMpxwxVG5HYnoteDBuU2c/view?usp=sharing

End of log: https://drive.google.com/file/d/0B-R6hVAMpxwxU3RHYXlzZmV1SU0/view?usp=sharing  (note "0 errors" even with mentioned failures)

解决方案

Hi Ondrej Dobias,

Thanks for posting here.

>>>Build targets fail at random with no apparent error. Why?

I found some targets are ignored after parallelizing your build system in the log, have you ever try to disable parallel or try build the projects in the solution one at a time, then check the build log. You can  set the MSBuild project build output verbosity (in Visual Studio's Options / Projects and Solutions / Build and Run setting area) to "Diagnostic" or "Detail". If possible, try to restart Visual Studio, PC and clean solution, then rebuild all.


这篇关于构建目标随机失败,没有明显错误。为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆