Codegen leaves one folder per library in $TMPDIR on every pod install and Xcode build: generateCode never removes its mkdtempSync folder
Los mantenedores suelen responder en 2 días
@jipeng6036-del ya está trabajando en esto.
Desde el 16/11/2026.
- #60058 de @jipeng6036-del — abierto
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Estancado
- Stack tecnológico
- javascript, node.js, react-native
- Área
- build-system, mobile
Línea de trabajo
Start in packages/react-native/scripts/codegen/generate-artifacts-executor/generateNativeCode.js, especially generateCode and its mkdtempSync call. Check how the temporary directory is handled when generation succeeds or throws, then run the linked reproducer with TMPDIR, TEMP and TMP set to an empty folder. Done means no temporary folders remain and generated output is unchanged; pull request #60058 is already open against this issue.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Description
Every run of scripts/generate-codegen-artifacts.js, which pod install and Xcode's [CP-User] Generate Specs phase both run, leaves one folder per codegen library in the system temp folder ($TMPDIR on macOS), named after the library (AppSpecsXXXXXX, safeareacontextXXXXXX), each holding a copy of that library's generated code. Nothing removes them, so they add up with every pod install and every build.
On main (4a82359d7c), generateCode creates the folder with fs.mkdtempSync(path.join(os.tmpdir(), libraryName)), generates into its out/, copies that to the output folder with cpSyncRecursiveIfChanged, and returns without removing it. The file is the same in 0.88.1.
On a Mac with React Native 0.88.1 (macOS 27.2.1, Xcode 27.2, CocoaPods 1.17.0), one App Store build of an app with eleven codegen libraries left eleven folders from pod install and eleven more from xcodebuild archive, 12 KB to 1.3 MB each, and four days of builds had left 263 of them in that $TMPDIR.
Expected: the temporary folder is gone once generateCode has copied its files, whether generation succeeds or throws, and the output folder gets the same files as today.
Steps to reproduce
- Clone the reproducer below.
ReproducerApp/package.jsondeclares one app-level codegen library,AppSpecs, whose spec isReproducerApp/specs/NativeSample.ts. - In
ReproducerApp, runyarn install, thennode repro.js. It runsreact-native/scripts/generate-codegen-artifacts.js --path . --outputPath <output> --targetPlatform ios, the command Xcode's Generate Specs phase runs, withTMPDIR,TEMPandTMPpointed at an empty folder, and lists that folder after the codegen exits. It exits 1 while the codegen leaves anything there, 0 once it leaves nothing. - Expected: the folder is empty. Actual: it holds one folder per codegen library:
TMPDIR after the run holds 2 entries AppSpecsgxi4vl (3 files) safeareacontextEGhhho (14 files) DEFECT: codegen left 2 temporary folder(s) in TMPDIR after it exited
React Native Version
0.88.1
Affected Platforms
Build - MacOS, Build - Windows
Areas
Codegen
Output of npx @react-native-community/cli info
System:
OS: Windows 11 10.0.26300
CPU: "(32) x64 AMD Ryzen 9 9950X3D 16-Core Processor "
Memory: 139.30 GB / 255.67 GB
Binaries:
Node:
version: 26.12.1
path: C:\Program Files\nodejs\node.EXE
npm:
version: 12.2.1
path: C:\Program Files\nodejs\npm.CMD
Stacktrace or Logs
react-native 0.88.1, node v26.12.1, win32 10.0.26300 x64
TMPDIR, TEMP and TMP set to an empty folder
$ node react-native/scripts/generate-codegen-artifacts.js --path . --outputPath <output> --targetPlatform ios
[Codegen] Generating Native Code for AppSpecs - ios
[Codegen] Generated artifacts: <output>\build\generated\ios\ReactCodegen
[Codegen] Generating Native Code for safeareacontext - ios
[Codegen] Generated artifacts: <output>\build\generated\ios\ReactCodegen
codegen exited 0 and wrote 2 files to <output>/build/generated/ios/ReactCodegen/AppSpecs
TMPDIR after the run holds 2 entries
AppSpecsgxi4vl (3 files)
safeareacontextEGhhho (14 files)
DEFECT: codegen left 2 temporary folder(s) in TMPDIR after it exited
MANDATORY Reproducer
https://github.com/YevheniiKotyrlo/rn-codegen-tmpdir-repro
Screenshots and Videos
No response
- Lenguaje dominante
- C++
- Estrellas
- 127k
- Forks
- 25.5k
- Merge medio
- 3 d 22 h
- PR fusionados (30 d)
- 235
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de react/react-native
-
Needs: Author Feedback Needs: Repro
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
react/react-native#60059 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Needs: Triage :mag:
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
react/react-native#60000 ·
Los mantenedores suelen responder en 2 días
-
`yarn test-ios` exits before building RNTester: `objc-test.sh` launches the WebSocket server script #59433 deletedPosiblemente ocupada @lazerg la tomó hace 4 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
react/react-native#59939 ·
Los mantenedores suelen responder en 2 días
-
iOS Fabric pointer-handler reset leaves the next lone touch non-primaryPosiblemente ocupada @alleneubank la tomó hace 6 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
react/react-native#59919 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
react/react-native#59722 ·
Los mantenedores suelen responder en 2 días
Todos los issues de react/react-native
Issues similares
-
[fuzzer-found][mlir][tosa] `TransposeOp::reifyResultShapes` crashes on unranked tensor inputAbiertocrash generated by fuzzer mlir
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
llvm/llvm-project#243218 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
petercorke/robotics-toolbox-python#943 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
realtime
Dificultad 2/5 1-3 horas Aptitud para principiantes 69/100
NVIDIA/cuda-quantum#5913 ·
Los mantenedores suelen responder en 1 día
-
[hidapi] update to 0.16.0Abiertocategory:port-update
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 2 días
-
area:build bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
NatronGitHub/openfx-arena#71 ·
Los mantenedores suelen responder en 1 día