Skip to content
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

Add Crystal::System::Process to split out system-specific implementations #9035

Merged
merged 7 commits into from
Apr 13, 2020

Conversation

oprypin
Copy link
Member

@oprypin oprypin commented Apr 10, 2020

Note that most of this change is just extracting parts of process.cr, mostly unchanged.

To see that for yourself, make sure to view the patch as
git diff -w master:src/process.cr src/crystal/system/unix/process.cr

This is based on RX14@ed14ad5

The Windows counterpart of this

Closes #8536

oprypin added 2 commits April 8, 2020 18:06
Int64 is enough to fit the actual underlying values of different platforms (Int32 on Linux, UInt32 on Windows).

This will allow to make Process cross-platform without returning a different type to users on different platforms.
…ions

Note that most of this change is just extracting parts of process.cr, mostly unchanged.
To see that for yourself, make sure to view the patch as `git diff -w HEAD~:src/process.cr src/crystal/system/unix/process.cr`

Co-Authored-By: Stephanie Hobbs <[email protected]>
src/kernel.cr Outdated Show resolved Hide resolved
@RX14 RX14 added platform:windows Windows support based on the MSVC toolchain / Win32 API topic:stdlib:runtime labels Apr 10, 2020
@oprypin
Copy link
Member Author

oprypin commented Apr 10, 2020

src/process.cr Show resolved Hide resolved
src/crystal/system/unix/process.cr Outdated Show resolved Hide resolved
LibC.pthread_sigmask(LibC::SIG_SETMASK, pointerof(newmask), nil)
else
{% unless flag?(:preview_mt) %}
::Process.after_fork_child_callbacks.each(&.call)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't after_fork_child be moved to Crystal::System, too?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know (like, actually could be conceptually the wrong thing to do) and it's certainly not a requirement to make things work.

src/crystal/system/process.cr Show resolved Hide resolved
src/kernel.cr Outdated Show resolved Hide resolved
src/process.cr Outdated Show resolved Hide resolved
@straight-shoota straight-shoota added this to the 0.35.0 milestone Apr 12, 2020
@oprypin
Copy link
Member Author

oprypin commented Apr 12, 2020

From my side this is ready, only as squash-merge.

Add Crystal::System::Process to split out system-specific implementations (#9035)

Note that most of this change is just extracting parts of process.cr, mostly unchanged.
To see that for yourself, make sure to view the patch as `git diff -w HEAD~:src/process.cr src/crystal/system/unix/process.cr`

@straight-shoota
Copy link
Member

I've already added it to the milestone (which effectively signals it's accepted). Just waiting for CI to finish.

@oprypin
Copy link
Member Author

oprypin commented Apr 12, 2020

Thanks!
I just always feel like I need to clarify how it should be merged.

@RX14 RX14 merged commit 9a4896b into crystal-lang:master Apr 13, 2020
@jkthorne
Copy link
Contributor

Thanks
Wow this seems like a big step to windows support.

carlhoerberg pushed a commit to carlhoerberg/crystal that referenced this pull request Apr 29, 2020
…ions (crystal-lang#9035)

Note that most of this change is just extracting parts of process.cr, mostly unchanged.
To see that for yourself, make sure to view the patch as `git diff -w HEAD~:src/process.cr src/crystal/system/unix/process.cr`

Co-authored-by: Stephanie Hobbs <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform:windows Windows support based on the MSVC toolchain / Win32 API topic:stdlib:runtime
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants