From e62ec62b3c9e5f01c067fea35597e7d3bff23bf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kr=C3=A6n=20Hansen?= Date: Mon, 27 Jul 2026 13:38:02 +0000 Subject: [PATCH] Fix build-from-source on Windows: use JVM temp dir instead of hardcoded /tmp The intermediate container projects :packages and :packages:react-native are declared with projectDir = file("/tmp") to satisfy Gradle 9's requirement that every project in a path have an existing folder. "/tmp" is not an absolute path on Windows, so Gradle resolves it to a non-existing \tmp and build-from-source fails at configuration time. Use the JVM temp dir instead, which exists on every platform. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01F7Mx2sWYCbJMwyTXaiXjbQ --- packages/react-native/settings.gradle.kts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/react-native/settings.gradle.kts b/packages/react-native/settings.gradle.kts index 2036e0f16450..15a03c394345 100644 --- a/packages/react-native/settings.gradle.kts +++ b/packages/react-native/settings.gradle.kts @@ -34,7 +34,10 @@ project(":packages:react-native:ReactAndroid:hermes-engine").projectDir = // As we build :packages:react-native:ReactAndroid, we need to declare the folders // for :packages and :packages:react-native as well as otherwise the build from // source will fail with a missing folder exception. +// We point them at the JVM temp dir rather than a hardcoded "/tmp": the latter is +// not an absolute path on Windows, where Gradle would resolve it to a +// non-existing \tmp and fail at configuration time. -project(":packages").projectDir = file("/tmp") +project(":packages").projectDir = file(System.getProperty("java.io.tmpdir", "/tmp")) -project(":packages:react-native").projectDir = file("/tmp") +project(":packages:react-native").projectDir = file(System.getProperty("java.io.tmpdir", "/tmp"))