Commit 908872a
Fix build-from-source on Windows: use JVM temp dir instead of hardcoded /tmp (#57706)
Summary:
`packages/react-native/settings.gradle.kts` declares the intermediate container projects `:packages` and `:packages:react-native` with `projectDir = file("/tmp")`, to satisfy Gradle 9's requirement that every project in a path have an existing folder. `/tmp` exists on posix hosts, but on Windows it is not an absolute path, so Gradle resolves it to a non-existent `<rootDir>\tmp` and build-from-source fails at configuration time:
Configuring project ':packages:react-native' without an existing directory
is not allowed.
Use `System.getProperty("java.io.tmpdir", "/tmp")` instead — the JVM temp dir, which is `/tmp` on posix and `%TEMP%` on Windows, and always exists.
## Changelog
[ANDROID] [FIXED] - Use the JVM temp dir instead of a hardcoded `/tmp` for the build-from-source container project dirs, fixing Gradle configuration on Windows
Pull Request resolved: #57706
Test Plan:
- posix: the resolved dir is unchanged (`/tmp`); build-from-source configures as before.
- Windows: resolves to an existing temp dir, so `includeBuild(../node_modules/react-native)`
configures successfully instead of erroring.
- Downstream evidence: this exact change greened the `windows-latest` Gradle lane in
callstackincubator/react-native-node-api#387.
Reviewed By: christophpurrer
Differential Revision: D113816859
Pulled By: Abbondanzo
fbshipit-source-id: 9846dadab9012369dcab26aa05ea3297633acf9f1 parent f911911 commit 908872a
1 file changed
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
37 | 40 | | |
38 | | - | |
| 41 | + | |
39 | 42 | | |
40 | | - | |
| 43 | + | |
0 commit comments