Skip to content

Commit 62ef6f5

Browse files
[Main][Windows] Working around Long paths limitation on Windows (#33707)
Co-authored-by: Aleš Pergl <alespergl@users.noreply.github.com> Co-authored-by: Ales Pergl <alpergl@microsoft.com>
1 parent b5f1b26 commit 62ef6f5

File tree

61 files changed

+74
-20
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+74
-20
lines changed

ReactAndroid/build.gradle

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -322,18 +322,9 @@ android {
322322
arguments "--output-sync=none"
323323
}
324324

325-
// Note: On Windows there are limits on number of character in file paths and in command lines
326-
// Ref: https://android.googlesource.com/platform/ndk/+/master/docs/BuildSystemMaintainers.md#Path-Length-Limits
327-
// NDK allows circumventing command line limits using response(RSP) files as inputs using NDK_APP_SHORT_COMMANDS flag.
328-
//
329-
// Windows can support long file paths if configured through registry or by prefixing all file paths with a special character sequence
330-
// The latter requires changes in NDK. And there are tools in NDK (AR) which is not able to handle long paths (>256) even after setting the registry key.
331-
// The new architecutre source tree is too deep, and the object file naming conventions in NDK makes the matters worse, by producing incredibly long file paths.
332-
// Other solutions such as symlinking source code etc. didn't work as expected, and makes the build scripts complicated and hard to manage.
333-
// This change temporarily works around the issue by placing the temporary build outputs as short a path as possible within the project path.
325+
// Fix for windows limit on number of character in file paths and in command lines
334326
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
335-
arguments "NDK_OUT=${rootProject.projectDir.getParent()}\\.cxx",
336-
"NDK_APP_SHORT_COMMANDS=true"
327+
arguments "NDK_APP_SHORT_COMMANDS=true"
337328
}
338329
}
339330
}

ReactAndroid/src/main/java/com/facebook/hermes/instrumentation/Android.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ include $(CLEAR_VARS)
1313
LOCAL_MODULE := jsijniprofiler
1414

1515
LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp)
16+
LOCAL_SRC_FILES := $(subst $(LOCAL_PATH)/,,$(LOCAL_SRC_FILES))
1617

1718
LOCAL_C_INCLUDES := $(LOCAL_PATH) $(REACT_NATIVE)/ReactCommon/jsi $(call find-node-module,$(LOCAL_PATH),hermes-engine)/android/include
1819

ReactAndroid/src/main/java/com/facebook/hermes/reactexecutor/Android.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ include $(CLEAR_VARS)
1212
LOCAL_MODULE := hermes-executor-release
1313

1414
LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp)
15+
LOCAL_SRC_FILES := $(subst $(LOCAL_PATH)/,,$(LOCAL_SRC_FILES))
1516

1617
LOCAL_C_INCLUDES := $(LOCAL_PATH) $(REACT_NATIVE)/ReactCommon/jsi $(call find-node-module,$(LOCAL_PATH),hermes-engine)/android/include
1718

@@ -35,6 +36,7 @@ LOCAL_MODULE := hermes-executor-debug
3536
LOCAL_CFLAGS := -DHERMES_ENABLE_DEBUGGER=1
3637

3738
LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp)
39+
LOCAL_SRC_FILES := $(subst $(LOCAL_PATH)/,,$(LOCAL_SRC_FILES))
3840

3941
LOCAL_C_INCLUDES := $(LOCAL_PATH) $(REACT_NATIVE)/ReactCommon/jsi $(call find-node-module,$(LOCAL_PATH),hermes-engine)/android/include
4042

ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/jni/Android.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ include $(CLEAR_VARS)
1010
LOCAL_MODULE := mapbufferjni
1111

1212
LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/react/common/mapbuffer/*.cpp)
13+
LOCAL_SRC_FILES := $(subst $(LOCAL_PATH)/,,$(LOCAL_SRC_FILES))
1314

1415
LOCAL_SHARED_LIBRARIES := \
1516
libfb \

ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Android.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ include $(CLEAR_VARS)
1010
LOCAL_MODULE := fabricjni
1111

1212
LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp)
13+
LOCAL_SRC_FILES := $(subst $(LOCAL_PATH)/,,$(LOCAL_SRC_FILES))
1314

1415
LOCAL_SHARED_LIBRARIES := \
1516
libbutter \

ReactAndroid/src/main/java/com/facebook/react/jscexecutor/Android.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ include $(CLEAR_VARS)
1010
LOCAL_MODULE := jscexecutor
1111

1212
LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp)
13+
LOCAL_SRC_FILES := $(subst $(LOCAL_PATH)/,,$(LOCAL_SRC_FILES))
1314

1415
LOCAL_C_INCLUDES := $(LOCAL_PATH)
1516

ReactAndroid/src/main/java/com/facebook/react/modules/blob/jni/Android.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ include $(CLEAR_VARS)
1010
LOCAL_MODULE := reactnativeblob
1111

1212
LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp)
13+
LOCAL_SRC_FILES := $(subst $(LOCAL_PATH)/,,$(LOCAL_SRC_FILES))
1314

1415
LOCAL_C_INCLUDES := $(LOCAL_PATH)
1516

ReactAndroid/src/main/java/com/facebook/react/reactperflogger/jni/Android.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ LOCAL_MODULE := reactperfloggerjni
2626

2727
# Compile all local c++ files
2828
LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/reactperflogger/*.cpp)
29+
LOCAL_SRC_FILES := $(subst $(LOCAL_PATH)/,,$(LOCAL_SRC_FILES))
2930

3031
# Build the files in this directory as a shared library
3132
include $(BUILD_SHARED_LIBRARY)

ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni/Android.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ LOCAL_MODULE := callinvokerholder
2828

2929
# Compile all local c++ files
3030
LOCAL_SRC_FILES := $(LOCAL_PATH)/ReactCommon/CallInvokerHolder.cpp
31+
LOCAL_SRC_FILES := $(subst $(LOCAL_PATH)/,,$(LOCAL_SRC_FILES))
3132

3233
# Build the files in this directory as a shared library
3334
include $(BUILD_STATIC_LIBRARY)
@@ -56,6 +57,7 @@ LOCAL_STATIC_LIBRARIES = libcallinvokerholder libreactperfloggerjni
5657

5758
# Compile all local c++ files
5859
LOCAL_SRC_FILES := $(LOCAL_PATH)/ReactCommon/TurboModuleManager.cpp $(LOCAL_PATH)/ReactCommon/OnLoad.cpp
60+
LOCAL_SRC_FILES := $(subst $(LOCAL_PATH)/,,$(LOCAL_SRC_FILES))
5961

6062
# Build the files in this directory as a shared library
6163
include $(BUILD_SHARED_LIBRARY)

ReactAndroid/src/main/java/com/facebook/react/uimanager/jni/Android.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ include $(CLEAR_VARS)
1010
LOCAL_MODULE := uimanagerjni
1111

1212
LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp)
13+
LOCAL_SRC_FILES := $(subst $(LOCAL_PATH)/,,$(LOCAL_SRC_FILES))
1314

1415
LOCAL_SHARED_LIBRARIES := \
1516
libfb \

0 commit comments

Comments
 (0)