android: patch RN settings.gradle.kts /tmp projectDir for Windows#387
Open
kraenhansen wants to merge 1 commit into
Open
android: patch RN settings.gradle.kts /tmp projectDir for Windows#387kraenhansen wants to merge 1 commit into
kraenhansen wants to merge 1 commit into
Conversation
The Windows unit-test lane failed configuring the React Native build-from-
source composite build:
Configuring project ':packages:react-native' without an existing directory
is not allowed. The configured projectDirectory '...\react-native\tmp'
does not exist
React Native's own settings.gradle.kts declares the intermediate container
projects :packages and :packages:react-native with projectDir = file("/tmp"),
purely to satisfy Gradle 9's rule that every project in a path have an existing
folder. "/tmp" exists on the posix CI hosts but on Windows it is not an
absolute path, so Gradle resolves it to a non-existent <react-native>\tmp and
the build fails before any task runs. This is why only windows-latest was red
while ubuntu and macOS passed.
Add a pnpm patch replacing file("/tmp") with
file(System.getProperty("java.io.tmpdir", "/tmp")): the JVM temp dir is "/tmp"
on posix and %TEMP% on Windows, both of which always exist. Remove the patch
once React Native stops hardcoding "/tmp" upstream.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TVfanKvtyfSsoMgZv3DJtY
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.
Targets the
kh/adopt-static-h-node-apibranch (PR #372). Follow-up to #386, which greened ubuntu + macOS but left windows-latest red on a different cause.Root cause
After #386 fixed the
Project.exec()removal, the Windows Gradle build got further and bothgradle.test.tscases failed at configuration time:This is upstream React Native, not our code. RN's own
settings.gradle.kts(used for build-from-source composite builds, which this project requires) declares the intermediate container projects with a throwaway dir:/tmpexists on the posix CI hosts, so ubuntu/macOS pass. On Windows/tmpis not absolute, so Gradle resolves it to a non-existent<react-native>\tmp, and Gradle 9 hard-errors on a missingprojectDirectory— failing before any task runs.Fix
There's no fixed RN release to bump to (pinned nightly), so this adds a
pnpm patchreplacingfile("/tmp")withfile(System.getProperty("java.io.tmpdir", "/tmp"))— the JVM temp dir, which is/tmpon posix and%TEMP%on Windows and always exists. The patch carries a comment with its removal condition (once RN stops hardcoding/tmp).Files:
patches/react-native@0.87.0-nightly-20260529-88857d22f.patchpnpm-workspace.yaml(patchedDependenciesentry)pnpm-lock.yamlTest plan
Generated by Claude Code