XCode 13 无法生成 profdata 文件
多年来,我们一直在 PR 管道中使用以下代码,并且它有效。
xcodebuild -sdk iphoneos -configuration dev -workspace MyProject.xcworkspace -scheme MyProject_Mu -destination 'platform=iOS Simulator,name=iPhone 8' test -derivedDataPath DerivedData CODE_SIGNING_ALLOWED=NO
通常,上述代码在文件夹:DerivedData/Build/ProfileData/41E444A5-D124-4222-82C2-EB33DCDBF2FC/.profraw
和.profdata
>
直到最近,我们的托管代理从 XCode 12
升级到 XCode 13
,上面的代码仅生成.profraw
并以下面的错误结束
warning: DerivedData/Build/ProfileData/41E444A5-D124-4222-82C2-EB33DCDBF2FC/B8590BD3-CF44-4308-95CF-20FBFFEF3568-24496.profraw: Failed to uncompress data (zlib)
error: No profiles could be merged.
我们甚至尝试运行此代码,希望这能解决问题:
xcrun llvm-profdata merge DerivedData/Build/ProfileData/*/*.profraw -output generated.profdata
但它不起作用。我们得到了同样的错误
warning: DerivedData/Build/ProfileData/41E444A5-D124-4222-82C2-EB33DCDBF2FC/B8590BD3-CF44-4308-95CF-20FBFFEF3568-24496.profraw: Failed to uncompress data (zlib)
error: No profiles could be merged.
现在我们的 PR 管道被卡住了,我们无法工作,因为需要这个脚本来生成单元测试覆盖率数据。而且管道总是出故障。
We have always been using the following code in our PR pipeline for years and it worked.
xcodebuild -sdk iphoneos -configuration dev -workspace MyProject.xcworkspace -scheme MyProject_Mu -destination 'platform=iOS Simulator,name=iPhone 8' test -derivedDataPath DerivedData CODE_SIGNING_ALLOWED=NO
Normally, the above code generated .profraw
and .profdata
at folder: DerivedData/Build/ProfileData/41E444A5-D124-4222-82C2-EB33DCDBF2FC/
Until recently, our hosted agent upgraded from XCode 12
to XCode 13
, the above code generates only the .profraw
and ends with the error below
warning: DerivedData/Build/ProfileData/41E444A5-D124-4222-82C2-EB33DCDBF2FC/B8590BD3-CF44-4308-95CF-20FBFFEF3568-24496.profraw: Failed to uncompress data (zlib)
error: No profiles could be merged.
We even tried to run this code hoping this would fix the issue:
xcrun llvm-profdata merge DerivedData/Build/ProfileData/*/*.profraw -output generated.profdata
But it does not work. We get the same error
warning: DerivedData/Build/ProfileData/41E444A5-D124-4222-82C2-EB33DCDBF2FC/B8590BD3-CF44-4308-95CF-20FBFFEF3568-24496.profraw: Failed to uncompress data (zlib)
error: No profiles could be merged.
Now our PR pipeline is stuck and we can't work because this script is needed to generate unit test coverage data. And the pipeline is always failing.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我通过将
GCC_INSTRUMENT_PROGRAM_FLOW_ARCS
设置为 NO 解决了该问题。由于某种原因,LLVM 分析工具添加的额外代码会干扰代码覆盖率。我不确定这是否是预期的行为;如果我有任何进一步的信息,我将提交错误并跟进。I solved the issue by setting
GCC_INSTRUMENT_PROGRAM_FLOW_ARCS
to NO. For some reason the extra code added by LLVM profiling instrumentation is interfering with the code coverage. I am not sure if this is the expected behavior; I will file a bug and follow up if I have any further information.