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/react-native-worklets@0.8.1.../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/react-native-worklets@0.8.1.../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.
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
Steps to Reproduce
pnpm install.Logs / Error Output
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.