fix(coverage): force DISABLE_HOOK cache var to fix fresh-configure crash#774
Conversation
Previous fix set DISABLE_HOOK as a normal variable, but coost's subdirectory has its own cmake_minimum_required(VERSION 3.12), causing CMP0077 to fall back to OLD where option() ignores normal variables and overwrites the cache with OFF on fresh configure. Coost 子目录自带 cmake_minimum_required(VERSION 3.12), 进入子作用域后 CMP0077 退化为 OLD, option() 会无视父级 normal 变量并覆写 cache, 导致 全新配置时 _CO_DISABLE_HOOK 编译宏缺失, 测试退出阶段 coost hook 触发 SIGSEGV, 覆盖率从 ~80% 跌至 ~32%。改用 set(... CACHE BOOL ... FORCE) 强制写 cache, option() 见到已存在值不再覆盖。 Log: 修复全新配置时 coost hook 未禁用导致覆盖率崩溃 Influence: 全新 clone 后跑 test-prj-running.sh 不再出现测试退出段错误, 覆盖率从 ~32% 恢复至 ~80.6%; 增量构建行为不变。
There was a problem hiding this comment.
Sorry @pengfeixx, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
deepin pr auto review★ 总体评分:95分■ 【总体评价】
■ 【详细分析】
■ 【改进建议代码示例】 # 当前代码已为最佳实践,无需进一步修改。
if(DOTEST OR BUILD_TESTS)
set(DISABLE_HOOK ON CACHE BOOL "disable hooks for system APIs" FORCE)
endif() |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: lzwind, pengfeixx The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/forcemerge |
|
This pr force merged! (status: unstable) |
Previous fix set DISABLE_HOOK as a normal variable, but coost's subdirectory has its own cmake_minimum_required(VERSION 3.12), causing CMP0077 to fall back to OLD where option() ignores normal variables and overwrites the cache with OFF on fresh configure.
Coost 子目录自带 cmake_minimum_required(VERSION 3.12), 进入子作用域后 CMP0077 退化为 OLD, option() 会无视父级 normal 变量并覆写 cache, 导致 全新配置时 _CO_DISABLE_HOOK 编译宏缺失, 测试退出阶段 coost hook 触发 SIGSEGV, 覆盖率从 ~80% 跌至 ~32%。改用 set(... CACHE BOOL ... FORCE) 强制写 cache, option() 见到已存在值不再覆盖。
Log: 修复全新配置时 coost hook 未禁用导致覆盖率崩溃
Influence: 全新 clone 后跑 test-prj-running.sh 不再出现测试退出段错误, 覆盖率从 ~32% 恢复至 ~80.6%; 增量构建行为不变。