mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Work around max path length during source build of RN Android (#30776)
Summary: Building ReactAndroid from source on Windows has recently hit the limitation of maximum path lengths. At build time, during the `:ReactAndroid:buildReactNdkLib` task, the linker tries to access several of the intermediate binaries located deep in the tmp folder hierarchy, eg. ``` D:\r\ReactAndroid\build\tmp\buildReactNdkLib/local/armeabi-v7a/objs/react_render_components_progressbar/D_/r/ReactAndroid/__/ReactCommon/react/renderer/components/progressbar/android/react/renderer/components/progressbar/AndroidProgressBarMeasurementsManager.o ``` **Suggested fix:** for modules such as `react_render_components_progressbar` and `react_render_components_picker`, rename them to `rrc_progressbar` etc. **NOTE**: this assumes that the fix from https://github.com/facebook/react-native/issues/30535 is in place. This regression happened while https://github.com/facebook/react-native/issues/30535 has been pending checkin. **Other mitigations I've tried:** - setting [`LOCAL_SHORT_COMMANDS`](https://developer.android.com/ndk/guides/android_mk#local_short_commands) for the problematic modules or `APP_SHORT_COMMANDS` for the root project. Turns out those commands don't work on the NDK version RN requires, but even after manually applying a [patch ](https://android-review.googlesource.com/c/platform/ndk/+/1126440) to my local copy of the NDK, these flags had no effect. - moving the repo directory higher in the file system tree, and using short directory names `D:\r\...` was not enough - creating virtual drive letters for specific long paths with the [`sust`](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/subst#examples) command is not workable, since they depend on the source folder structure, and get partly generated by the build system, which I can't plug into - just enabling long path support on Windows is not enough, since the compiler toolchain doesn't support them. ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://github.com/facebook/react-native/wiki/Changelog --> [Android] [Fixed] - Fix source build on Windows machines vol. 2 Pull Request resolved: https://github.com/facebook/react-native/pull/30776 Test Plan: Run `.\gradlew installArchives` Before:  Now:  Differential Revision: D26194286 Pulled By: mdvacca fbshipit-source-id: 778b5a0515148e2ace19e7902f74301831ebed94
This commit is contained in:
committed by
Facebook GitHub Bot
parent
9d1e8897e0
commit
c37d49492b
@@ -11,7 +11,7 @@ LOCAL_MODULE := fabricjni
|
||||
|
||||
LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp)
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := libreactconfig libreact_render_components_slider libreact_render_components_progressbar libreact_render_components_switch libreact_render_components_modal libyoga libglog libfb libfbjni libglog_init libfolly_json libfolly_futures libreact_render_mounting libreactnativeutilsjni libreact_utils libreact_render_debug libreact_render_graphics libreact_render_core libreact_render_mapbuffer react_render_componentregistry libreact_render_components_view libreact_render_components_unimplementedview libreact_render_components_root libreact_render_components_scrollview libbetter libreact_render_attributedstring libreact_render_uimanager libreact_render_templateprocessor libreact_render_scheduler libreact_render_animations libreact_render_imagemanager libreact_render_textlayoutmanager libreact_codegen_rncore react_render_components_text libreact_render_components_image react_render_components_textinput react_render_components_picker
|
||||
LOCAL_SHARED_LIBRARIES := libreactconfig librrc_slider librrc_progressbar librrc_switch librrc_modal libyoga libglog libfb libfbjni libglog_init libfolly_json libfolly_futures libreact_render_mounting libreactnativeutilsjni libreact_utils libreact_render_debug libreact_render_graphics libreact_render_core libreact_render_mapbuffer react_render_componentregistry librrc_view librrc_unimplementedview librrc_root librrc_scrollview libbetter libreact_render_attributedstring libreact_render_uimanager libreact_render_templateprocessor libreact_render_scheduler libreact_render_animations libreact_render_imagemanager libreact_render_textlayoutmanager libreact_codegen_rncore rrc_text librrc_image rrc_textinput rrc_picker
|
||||
|
||||
LOCAL_STATIC_LIBRARIES :=
|
||||
|
||||
|
||||
Reference in New Issue
Block a user