mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
c37d49492b
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
39 lines
1.3 KiB
Makefile
39 lines
1.3 KiB
Makefile
# Copyright (c) Facebook, Inc. and its affiliates.
|
|
#
|
|
# This source code is licensed under the MIT license found in the
|
|
# LICENSE file in the root directory of this source tree.
|
|
|
|
LOCAL_PATH := $(call my-dir)
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
LOCAL_MODULE := rrc_switch
|
|
|
|
LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/androidswitch/react/renderer/components/androidswitch/*.cpp)
|
|
|
|
LOCAL_C_INCLUDES := $(LOCAL_PATH)/androidswitch/
|
|
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/androidswitch/
|
|
|
|
LOCAL_CFLAGS := \
|
|
-DLOG_TAG=\"Fabric\"
|
|
|
|
LOCAL_CFLAGS += -fexceptions -frtti -std=c++14 -Wall
|
|
|
|
LOCAL_STATIC_LIBRARIES :=
|
|
|
|
LOCAL_SHARED_LIBRARIES := libfbjni libreact_codegen_rncore libreactnativeutilsjni libreact_render_componentregistry libreact_render_uimanager libyoga libfolly_futures glog libfolly_json libglog_init libreact_render_core libreact_render_debug libreact_render_graphics librrc_view
|
|
|
|
include $(BUILD_SHARED_LIBRARY)
|
|
|
|
$(call import-module,fbjni)
|
|
$(call import-module,folly)
|
|
$(call import-module,fbgloginit)
|
|
$(call import-module,glog)
|
|
$(call import-module,react/renderer/componentregistry)
|
|
$(call import-module,react/renderer/core)
|
|
$(call import-module,react/renderer/debug)
|
|
$(call import-module,react/renderer/graphics)
|
|
$(call import-module,react/renderer/components/view)
|
|
$(call import-module,react/renderer/uimanager)
|
|
$(call import-module,yogajni)
|