Closed
worker测试目标缺失eventhandler直接依赖声明导致部件级独立构建失败 #2531
jizaiyiAdd on  28 days agoClosed at  27 days ago
jizaiyi
jizaiyi
28 days ago Create

问题背景

!2699 门禁(2026-10-29,dayu200_tdd 部件级独立构建路径)失败于:

worker.h:39: fatal error: 'event_handler.h' file not found
失败单元: test_worker.o(worker 测试目标,arm32 设备工具链,indep 环境)

根因

worker 测试目标在设备分支定义 ENABLE_WORKER_EVENTHANDLER 宏(!2693 为 ODR 对齐所加,正确且必要),使 worker.h include event_handler.h。但测试目标自身未直接声明 eventhandler:libeventhandler 依赖——全量构建下该头文件路径经 worker_static 的传递依赖获得(宽容通过);部件级独立构建(indep)按【直接声明】供给预编译 innerapi 包,测试目标 include 集中无 eventhandler → 编译失败。

修复

worker/test/BUILD.gn 设备分支 external_deps 补充 "eventhandler:libeventhandler" 直接声明(1 行 + 注释)。

验证

  • 全量构建:rk3568 设备版 test_worker_unittest 构建成功(依赖解析/编译/链接通过)
  • indep 路径验证:本修复合入后由 !2699 重触发门禁承载(其纯测试改动将走部件级路径)

关联

  • 上游问题链:!2693 引入宏对齐(全量可过)→ !2697 发现 indep 宏汤问题并加守卫 → 本次暴露测试目标直接依赖缺失(第二颗雷)
likedislike
openharmony_ci
openharmony_ciCollaborators
28 days ago Comments:

感谢提交Issue!关于Issue的交互操作,请访问OpenHarmony社区支持命令清单。如果有问题,请联系 [@weng-changcheng](https://gitcode.com/weng-changcheng) [@xliu-huanwei](https://gitcode.com/xliu-huanwei) [@gong_19901](https://gitcode.com/gong_19901) 。如果需要调整订阅PR、Issue的变更状态,请访问链接。


Thanks for submitting the issue. For more commands, please visit OpenHarmony Command List. If you have any questions, please refer to committer gitcode for help. If you need to change the subscription of a Pull Request or Issue, please visit the link.

likedislike
openharmony_ciopenharmony_ciCollaborators
28 days ago Added label: waiting_for_assign
jizaiyijizaiyi
28 days ago Associated pull request
openharmony_ciopenharmony_ciCollaborators
27 days ago Close issue
openharmony_ciopenharmony_ciCollaborators
27 days ago changed custom state from 待办的 to 已完成