-
-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fallback for Process.fork
not being supported on Windows
#221
base: main
Are you sure you want to change the base?
Conversation
Hi @kyleplump, thanks for having a go at this! Your solution would work for the However, I don't think it will work for the Would you like to have a go at making this work? |
Thanks for the pointers @timriley! I would love to have a go at this My initial reaction would have been to create a new thread if the method is not implemented, and in that thread make the I would be happy to create a new thread to encapsulate this new process so it runs concurrently, or wrap the new process in a EDIT: ended up going with |
The proposed fix does not work on a Windows platform: the
|
Thanks very much for testing this, @pcopissa! I was about to look at this today, and your work is very informative! I don't have a windows machine to test on, unfortunately. Given you're already familiar with the code and the problem, are you willing to have a go at a fix yourself? If you can do it before Monday, then we can include the fix in Hanami 2.2.0! I recognise that is short notice, so I'm more than willing to work with your own timeframes, and make a patch release whenever we have a fix ready. |
Hi @timriley
I appreciate your offer but the fact is that I am not familiar at all with Hanami code... I just read the error messages, searched the Github repo for similar issue (and fixes) and tried to apply them on the version I have installed...
I do have a Windows 10 laptop though and I am trying to get a version that works with Ruby 3.0 (even though I have 3.2 at the moment). Hanami did fit the bill but now I have a hard time understanding which is the minimal Ruby version. In some places it says 3.0 and in some others 3.1.
… Il 31/10/2024 05:42 CET Tim Riley ***@***.***> ha scritto:
Thanks very much for testing this, @pcopissa https://github.com/pcopissa! I was about to look at this today, and your work is very informative!
I don't have a windows machine to test on, unfortunately. Given you're already familiar with the code and the problem, are you willing to have a go at a fix yourself?
If you can do it before Monday, then we can include the fix in Hanami 2.2.0! I recognise that is short notice, so I'm more than willing to work with your own timeframes, and make a patch release whenever we have a fix ready.
—
Reply to this email directly, view it on GitHub #221 (comment), or unsubscribe https://github.com/notifications/unsubscribe-auth/AKPVUS2YFRZEYTNCUOXBUQ3Z6GYKPAVCNFSM6AAAAABLVBEW4SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINBYHE4TSNBQGI.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
No worries at all, @pcopissa :) Hanami as of 2.1 has a minimum Ruby version of 3.0. When we release 2.2, it will have a minimum Ruby version of 3.1. |
👋🏼 Hi @dsisnero! Since you've filed and fixed various Windows-related issues with Hanami, I wonder whether you might be up for giving this PR a test, and if it doesn't work, trying a few different approaches to address the issue? Let me know if this sounds possible for you, and if so, whether there's any more info you might need :) Thank you! |
thanks for the tip @pcopissa ! I think your suggestion is better than the original fix:
a much better solution, thank you 😃 @timriley i can test out this new solution in the next day or two on a windows machine and update the PR if necessary, so it can be included in the release? I would of course welcome any additional testing or suggestions from @dsisnero though! |
@kyleplump If you could test this adjusted approach and verify it's working, that would be amazing! I can certainly still include it in next week's release. Here's the things to look out for:
In other words, just make sure it works like it does on Mac/Linux 😄 Thank you! |
Process.fork
is only supported on *nix operating systems: https://ruby-doc.org/core-2.6.2/Process.html#method-c-forkBut, spawning new processes off of the main thread is still supported using
spawn()
This fix handles
fork
not being implemented by falling back on the already usedOpen3.popen3
call, which itself wraps the nativespawn
function: https://github.com/ruby/open3/blob/master/lib/open3.rb#L533Might not be the most performant solution, but at least gets everything up and running
Please lmk if you notice anything I should change, thanks!