[GHC] #12795: Add more types to System.Posix.Types
#12795: Add more types to System.Posix.Types -------------------------------------+------------------------------------- Reporter: DanielG | Owner: Type: feature | Status: new request | Priority: normal | Milestone: Component: | Version: libraries/base | Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- A whole lot of types are still missing from `System.Posix.Types` as noted in a TODO comment in the code: {{{ --- ToDo: blksize_t, clockid_t, blkcnt_t, fsblkcnt_t, fsfilcnt_t, id_t, key_t --- suseconds_t, timer_t, useconds_t }}} Specifically the lack of wrappers for blkcnt_t is causing trouble because it's forcing HFuse to re-implement `unix`'s `FileStatus` type to include the missing `st_blocks` field. See [https://hackage.haskell.org/package/HFuse/docs/System- Fuse.html#t:FileStat FileStat docs on Hackage]. I have patches for `base` and `unix` ready to add wrappers for all the types the comment mentions, let's see if I can figure out how to use Phab ;) -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12795> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12795: Add more types to System.Posix.Types -------------------------------------+------------------------------------- Reporter: DanielG | Owner: DanielG Type: feature request | Status: new Priority: normal | Milestone: Component: libraries/base | Version: Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by DanielG): * owner: => DanielG @@ -10,3 +10,3 @@ - Specifically the lack of wrappers for blkcnt_t is causing trouble because - it's forcing HFuse to re-implement `unix`'s `FileStatus` type to include - the missing `st_blocks` field. See + Specifically the lack of a wrapper for `blkcnt_t` is causing trouble + because it's forcing HFuse to re-implement `unix`'s `FileStatus` type to + include the missing `st_blocks` field. See New description: A whole lot of types are still missing from `System.Posix.Types` as noted in a TODO comment in the code: {{{ --- ToDo: blksize_t, clockid_t, blkcnt_t, fsblkcnt_t, fsfilcnt_t, id_t, key_t --- suseconds_t, timer_t, useconds_t }}} Specifically the lack of a wrapper for `blkcnt_t` is causing trouble because it's forcing HFuse to re-implement `unix`'s `FileStatus` type to include the missing `st_blocks` field. See [https://hackage.haskell.org/package/HFuse/docs/System- Fuse.html#t:FileStat FileStat docs on Hackage]. I have patches for `base` and `unix` ready to add wrappers for all the types the comment mentions, let's see if I can figure out how to use Phab ;) -- -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12795#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12795: Add more types to System.Posix.Types -------------------------------------+------------------------------------- Reporter: DanielG | Owner: DanielG Type: feature request | Status: new Priority: normal | Milestone: Component: libraries/base | Version: Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2664 Wiki Page: | -------------------------------------+------------------------------------- Changes (by DanielG): * differential: => Phab:D2664 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12795#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12795: Add more types to System.Posix.Types -------------------------------------+------------------------------------- Reporter: DanielG | Owner: DanielG Type: feature request | Status: new Priority: normal | Milestone: Component: libraries/base | Version: Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2664 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bbaren): * cc: bbaren (added) -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12795#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12795: Add more types to System.Posix.Types -------------------------------------+------------------------------------- Reporter: DanielG | Owner: DanielG Type: feature request | Status: new Priority: normal | Milestone: Component: libraries/base | Version: Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2664 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"ffc2327070dbb664bdb407a804121eacb2a7c734/ghc" ffc23270/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="ffc2327070dbb664bdb407a804121eacb2a7c734" base: Add more POSIX types (fixes #12795) Test Plan: validate Reviewers: hvr, austin, RyanGlScott, bgamari Reviewed By: RyanGlScott, bgamari Subscribers: RyanGlScott, thomie, erikd Differential Revision: https://phabricator.haskell.org/D2664 GHC Trac Issues: #12795 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12795#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12795: Add more types to System.Posix.Types -------------------------------------+------------------------------------- Reporter: DanielG | Owner: DanielG Type: feature request | Status: closed Priority: normal | Milestone: 8.2.1 Component: libraries/base | Version: Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2664 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => closed * resolution: => fixed * milestone: => 8.2.1 Comment: Thanks DanielG! -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12795#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12795: Add more types to System.Posix.Types -------------------------------------+------------------------------------- Reporter: DanielG | Owner: DanielG Type: feature request | Status: closed Priority: normal | Milestone: 8.2.1 Component: libraries/base | Version: Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2664 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ryan Scott <ryan.gl.scott@…>): In [changeset:"513eb6a0638a1c64b9d76bcab39ed80cdd9dbb27/ghc" 513eb6a0/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="513eb6a0638a1c64b9d76bcab39ed80cdd9dbb27" Fix #12998 by removing CTimer Summary: CTimer is a wrapper around `timer_t`, which is a typedef for `void*` on most platforms. The issue is that GHC's `FPTOOLS_CHECK_HTYPE` is not robust enough to discern pointer types from non-pointer types, so it mistakenly labels `timer_t` as a `Double` or `Int32` (depending on how many bits a pointer takes up on your platform). This wreaks havoc when trying to give it certain type class instances, as noted in https://phabricator.haskell.org/rGHCffc2327070dbb664bdb407a804121eacb2a7c734. For now, the simplest thing to do would be removing `CTimer`, since: 1. The original author (@DanielG) didn't have a particular use in mind for `timer_t` when he fixed #12795. 2. `CTimer` hasn't appeared in a release of `base` yet. Fixes #12998. Reviewers: austin, hvr, bgamari, DanielG, trofi Reviewed By: bgamari, trofi Subscribers: thomie, DanielG, erikd Differential Revision: https://phabricator.haskell.org/D2876 GHC Trac Issues: #12795, #12998 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12795#comment:6> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12795: Add more types to System.Posix.Types -------------------------------------+------------------------------------- Reporter: DanielG | Owner: DanielG Type: feature request | Status: closed Priority: normal | Milestone: 8.2.1 Component: libraries/base | Version: Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2664 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ryan Scott <ryan.gl.scott@…>): In [changeset:"db91d17edfbe7deecb62bbb89c804249f9c4a4bd/ghc" db91d17e/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="db91d17edfbe7deecb62bbb89c804249f9c4a4bd" Properly introduce CTimer to System.Posix.Types Summary: In ffc2327070dbb664bdb407a804121eacb2a7c734, an attempt was made at adding a Haskell wrapper around the C `timer_t` type. Unfortunately, GHC's autoconf macros weren't sophisticated enough at the time to properly detect that `timer_t` is represented by a `void *` (i.e., a pointer) on most OSes. This is a second attempt at `CTimer`, this time using `AC_COMPILE_IFELSE` to detect if a type is a pointer type by compiling the following program: ``` type val; *val; ``` This also only derives a small subset of class instances for `CTimer` that are known to be compatible with `Ptr` using a new `OPAQUE_TYPE_WITH_CTYPE` macro. Test Plan: ./validate Reviewers: erikd, hvr, austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2952 GHC Trac Issues: #12795, #12998 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12795#comment:7> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC