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

Export CGid from System.Process.Internals (especially on Windows) #90

Closed
RyanGlScott opened this issue Mar 8, 2017 · 1 comment
Closed

Comments

@RyanGlScott
Copy link
Member

I found myself wanting to derive some instances for CreateProcess in one of my applications recently, only to discover that it wouldn't work on Windows. Why? Because CreateProcess uses UserID and GroupID fields, the definitions of which are platform-dependent:

#ifdef WINDOWS
-- Define some missing types for Windows compatibility. Note that these values
-- will never actually be used, as the setuid/setgid system calls are not
-- applicable on Windows. No value of this type will ever exist.
newtype CGid = CGid Word32
  deriving (Show, Eq)
type GroupID = CGid
type UserID = CGid
#else
type PHANDLE = CPid
#endif

This Windows-only newtype CGid is only available in the internal System.Process.Common module, and as a result, I can't make any instances for it (and thus can't derive any instances for CreateProcess).

Would you consider reexporting CGid from System.Process.Internals? That way I could accomplish my original goal, and process wouldn't have to make any API promises about the design of CGid.

RyanGlScott added a commit to RyanGlScott/text-show-instances that referenced this issue Mar 8, 2017
These are impossible to support on Windows at the moment, since I don't have access
to an internal datatype that process is using. We'll have to wait until
haskell/process#90 is fixed.
@snoyberg
Copy link
Collaborator

snoyberg commented Mar 9, 2017 via email

RyanGlScott added a commit to RyanGlScott/text-show-instances that referenced this issue Apr 23, 2017
* Some GHC 8.2 fixes

* XdgDirectory

* process instances

* Remove process instances

These are impossible to support on Windows at the moment, since I don't have access
to an internal datatype that process is using. We'll have to wait until
haskell/process#90 is fixed.

* Stash Win32 additions for now

* Finish Win32 addons

* ForeignSrcLang

* time-1.8

* Fix the build on older GHCs

* Fix the build on older GHCs, pt. 2

* Fix the GHC 7.10.3 build

* Version 3.6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants