Added Processes to IONative
Implemented ProcessBuilder-based process spawning for Scala Native using posix_spawn, with support for stdin, stdout, and stderr piping. Integrated pidfd_open and fileDescriptorPoller to asynchronously and non-blockingly wait for process termination. Falls back to waitpid when pidfd_open is unavailable.
@armanbilge can you please review this PR
I checked the timeout exception in the env inheritance test. I think the issue comes in how the envMap/envp is being constructed. Interestingly, adding a dummy variable when the Map is empty seems to solve the problem.
@antoniojimeneznieto Yep, I tried using dummy variable, and it actually resolved the issue.
However, using dummy variable doesn't result in countEnv(false) == 0 as it does on the JVM platform. Instead, we get countEnv(true) > countEnv(false), which still causes the test to pass.
So I’m unsure if this is the correct fix, since the behavior isn’t exactly the same.
Also, I’m not fully understanding why the EOF signal isn’t being triggered in readFd, which is preventing the loop from exiting. Currently, both test cases failing in CI is due to this issue.
Yes! this isn't a fix, since it may introduce other issues or conflicts. It was more of a remark than a proper solution, sorry for the confusion.
@armanbilge @antoniojimeneznieto I have found the issue, The epollSystem was not including EPOLLHUP, which is necessary to detect when the pipe has been closed by a process. This is the reason why the testcases are failing.
I have made a PR to handle EPOLLHUP https://github.com/typelevel/cats-effect/pull/4422
@armanbilge can you please review this PR