zio / zio-process

A simple ZIO library for interacting with external processes and command-line programs
https://zio.dev/zio-process
Apache License 2.0
64 stars 13 forks source link

Scala Native support #4

Open reibitto opened 4 years ago

reibitto commented 4 years ago

This may not actually require any code changes. From what I can tell, Scala Native already supports Java's ProcessBuilder interface (which is what ZIO Process is based on).

It's a matter of trying it out and seeing where Scala Native support for ZIO is. I believe it's still a work in progress but works to some degree.

markehammons commented 3 years ago

There are some limits to using scala native's process builder. Using it myself, I found myself having problems doing process to process streaming cause of some weird crashes.

Here's a gist for a scala native implementation of a Process ZLayer. You'll note that it doesn't do a lot of what java's process builder does, and that's because I figure streams make a lot of what process builder helps do easier. Regarding killing processes, I figured I'd add a promise to the interface that could be triggered to have the process killed.

Hope this helps.

reibitto commented 3 years ago

Thanks for the information and spending time investigating. 🙂

Scala Native is still experimental enough that I'm not too eager to spend too much time on it just yet, but it's something that I'll eventually get to if nobody decides to get a PR going before me.

Process and ProcessBuilder are listed on this page but I guess there are still unresolved issues with it as you've found. Ideally those issues would get fixed upstream (or we fix them if it's doable) rather than creating and maintaining a separate implementation ourselves. That would require code splitting, which is a valid approach, but not really the one I'd like to go with until it's clearer what the Scala Native ProcessBuilder bug/issue is. I can't find any issues relating to Process in the Scala Native repo yet. Might need to create a minimal example of the issue first to find out more.

jdegoes commented 1 year ago

/bounty $350

algora-pbc[bot] commented 1 year ago

💎 $350 bounty created by ZIO 🙋 If you start working on this, comment /attempt #4 to notify everyone 👉 To claim this bounty, submit a pull request that includes the text /claim #4 somewhere in its body 📝 Before proceeding, please make sure you can receive payouts in your country 💵 Payment arrives in your account 2-5 days after the bounty is rewarded 💯 You keep 100% of the bounty award 🙏 Thank you for contributing to zio/zio-process!

👉 Add a bountyShare on socials

Attempt Started (GMT+0) Solution
🟢 @pablf #397
algora-pbc[bot] commented 7 months ago

💡 @pablf submitted a pull request that claims the bounty. You can visit your bounty board to reward.

algora-pbc[bot] commented 7 months ago

🎉🎈 @pablf has been awarded $350! 🎈🎊