Fix build-from-source on Windows: use JVM temp dir instead of hardcoded /tmp - #57706
Open
kraenhansen wants to merge 1 commit into
Open
Fix build-from-source on Windows: use JVM temp dir instead of hardcoded /tmp#57706kraenhansen wants to merge 1 commit into
kraenhansen wants to merge 1 commit into
Conversation
…ed /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 <rootDir>\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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F7Mx2sWYCbJMwyTXaiXjbQ
|
@Abbondanzo has imported this pull request. If you are a Meta employee, you can view this in D113816859. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
packages/react-native/settings.gradle.ktsdeclares the intermediate container projects:packagesand:packages:react-nativewithprojectDir = file("/tmp"), to satisfy Gradle 9's requirement that every project in a path have an existing folder./tmpexists on posix hosts, but on Windows it is not an absolute path, so Gradle resolves it to a non-existent<rootDir>\tmpand build-from-source fails at configuration time:Use
System.getProperty("java.io.tmpdir", "/tmp")instead — the JVM temp dir, which is/tmpon posix and%TEMP%on Windows, and always exists.Changelog:
[ANDROID] [FIXED] - Use the JVM temp dir instead of a hardcoded
/tmpfor the build-from-source container project dirs, fixing Gradle configuration on WindowsTest Plan
/tmp); build-from-source configures as before.includeBuild(../node_modules/react-native)configures successfully instead of erroring.
windows-latestGradle lane inandroid: patch RN settings.gradle.kts /tmp projectDir for Windows callstackincubator/react-native-node-api#387.