[Windows] CMake build fails with "build.ninja still dirty" due to long path limit (CMAKE_OBJECT_PATH_MAX) using pnpm in a Monorepo
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 45/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- android, cmake, cpp, react-native
调研方向
Start with the Android CMakeLists.txt and the CMAKE_OBJECT_PATH_MAX warning described in the issue. Reproduce on Windows in a pnpm workspace with cd android && ./gradlew clean build, then inspect how the generated object paths reach the 250-character limit. Done means the Android build completes without the Ninja manifest error, or the Windows and pnpm monorepo limitation is documented.
由索引模型根据 Issue 内容生成。
描述
Description
When building the Android project on Windows inside a pnpm monorepo workspace, the build consistently fails with a ninja: error: manifest 'build.ninja' still dirty after 100 tries error.
This is caused by CMake's 250-character limit (CMAKE_OBJECT_PATH_MAX). Because pnpm creates a deeply nested virtual store structure (e.g., .pnpm/react-native-worklets@...), CMake flattens this long absolute path into the object file name (e.g., C_..._JSIWorkletsModuleProxy.cpp.o). The combined length easily exceeds the OS/CMake limit, preventing Ninja from successfully writing and tracking the compiled files.
Environment
- OS: Windows (10/11) with Registry Long Paths Enabled
- Package Manager: pnpm (Workspace / Monorepo setup)
- Library Version: 12.6.0
- React Native Version: 0.81.5
Steps to Reproduce
- Initialize a React Native project on Windows inside a pnpm workspace.
- Add this library as a dependency.
- Run
pnpm install. - Trigger the Android build (e.g., cd android && ./gradlew clean build).
- Observe the CMake warning followed by the Ninja infinite loop error.
Logs / Error Output
CMake Warning in CMakeLists.txt:
The object file directory
C:/<project>/node_modules/.pnpm/[email protected].../node_modules/react-native-worklets/android/.cxx/Debug/324x203h/arm64-v8a/CMakeFiles/worklets.dir/./
has 191 characters. The maximum full path to an object file is 250 characters (see CMAKE_OBJECT_PATH_MAX). Object file
C:/<project>/node_modules/.pnpm/[email protected].../node_modules/react-native-worklets/Common/cpp/worklets/NativeModules/JSIWorkletsModuleProxy.cpp.o
cannot be safely placed under this directory. The build may not work correctly.
ninja: error: manifest 'build.ninja' still dirty after 100 tries
Proposed Solution / Feature Request
Could the CMakeLists.txt for the Android build be updated to handle long paths more gracefully on Windows? Some other React Native libraries solve this by configuring CMake to output object files into a hashed directory structure (using CMAKE_OBJECT_PATH_MAX workarounds or altering CMAKE_CXX_COMPILER outputs) instead of flattening the entire absolute path.
Alternatively, if there is a known setup guide for Windows + pnpm monorepo users, adding it to the documentation would be highly appreciated.
- 主要语言
- C++
- 星标
- 792
- 派生
- 65
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
margelo/react-native-worklets-core 的其他 Issue
-
难度 5/5 一周以上 新手友好度 35/100
margelo/react-native-worklets-core#271 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 35/100
margelo/react-native-worklets-core#269 · 2 个 reaction ·
-
难度 3/5 1-2 天 新手友好度 35/100
margelo/react-native-worklets-core#268 · 2 条评论 ·
-
难度 3/5 1-2 天 新手友好度 72/100
margelo/react-native-worklets-core#267 · 1 条评论 · 1 个 reaction ·
-
难度 3/5 1-2 天 新手友好度 45/100
margelo/react-native-worklets-core#266 · 1 条评论 · 2 个 reaction ·
查看 margelo/react-native-worklets-core 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
CachyOS/New-Cli-Installer#50 ·
-
难度 1/5 1-3 小时 新手友好度 90/100
Qiskit/qiskit-aer#2482 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
content good first issue
难度 1/5 1 小时以内 新手友好度 95/100
cpinitiative/usaco-guide#6699 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
codepointerapp/codepointer#231 ·