Merged
Conversation
Collaborator
|
Thanks for the PR and the catch about the unstable |
e36cbc8 to
dcaa85c
Compare
Contributor
Author
|
I've confirmed the remaining tests now pass perfectly on both my Windows and Linux Haskell setups. I've also rebased and force-pushed the changes. Thanks for the quick reply! |
snoyberg
reviewed
Jun 28, 2021
Contributor
Author
|
Huh, didn't mean to tag the user, sorry SInCE! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change
This PR adds a new exported function in System.Process:
getCurrentPid.This calls
getCurrentProcessIdfrom System.Win32.Process on Windows, andgetProcessIDfrom System.Posix.Process on POSIX systems.Rationale
This seems like an oversight considering
getPidis implemented already. I sometimes require the current running program's process ID. Currently, I have to do the CPP conditional logic myself every time, which is a pain. Putting this inprocessseems natural.Furthermore, my understanding of
processis that it is a unified interface to System.Win32.Process and System.Posix.Process. As both modules provide a function to "get the currently executing process id", I feel it makes sense to have a cross-platform wrapper function.Remaining Issues
The
@sincefield has been left as a TODO since I'm not sure what version this will be merged in.Tests
I could not come up with a method to test the PR. Unlike with the test for
getPid, there's nothing to compare the value against, I think. It's worked from my past experiences in personal projects.I wasn't able to ensure a stable setup to test to begin with, as running the existing test suite
stack teston the Windows version of Stack failed due to several reasons (getPidfailing, anddetatch_consolefailing). Any feedback or insight is therefore appreciated.