CACI-International / ergo-cpp

A C++ build system library for ergo.
MIT License
2 stars 0 forks source link

Too many open files error during dependency detection #6

Open calebzulawski opened 1 year ago

calebzulawski commented 1 year ago

I suspect this only happens during dependency detection (and not regular compilation) because a greater percentage of time is spent loading headers. This is pretty easily fixed with ulimit but it might be good to limit the number of detection processes (it's currently limited to the task limit, which I would have thought would be sufficient).

error: Too many open files (os error 24)
   ┌─ ergo-cpp-0.12.1/src/operations.ergo:68:21
   │    
68 │                 child = exec ~env=toolchain:tool-exec-env $compiler ^[
   │ ╭───────────────────────^
   │ │ ╭─────────────────────'
69 │ │ │                 ^tc-flags
70 │ │ │                 ^flags
71 │ │ │                 ^public-include-flags
   · │ │
75 │ │ │                 $tracked-file
76 │ │ │             ]
   │ ╰─│─────────────^ while spawning this process
   │   ╰─────────────' in this call

one or more errors occurred
afranchuk commented 1 year ago

This will occur if something is persisting the child process values rather than using them immediately. This used to occur before a few script changes I made. I was able to check the number of open files using procfs to debug/verify fixes.