[GHC] #8223: System.Posix.User fails to build on systems without get{gr, pw}nam_r

GHC ghc-devs at haskell.org
Wed Sep 4 16:22:08 CEST 2013


#8223: System.Posix.User fails to build on systems without get{gr,pw}nam_r
----------------------------------+----------------------------------------
       Reporter:  rwbarton        |             Owner:
           Type:  bug             |            Status:  new
       Priority:  normal          |         Milestone:
      Component:  libraries/unix  |           Version:  7.7
       Keywords:                  |  Operating System:  Other
   Architecture:  arm             |   Type of failure:  Building GHC failed
     Difficulty:  Unknown         |         Test Case:
     Blocked By:                  |          Blocking:
Related Tickets:                  |
----------------------------------+----------------------------------------
 I'm trying to build GHC for Android (using https://github.com/neurocyte
 /ghc-android) and according to `include/HsUnixConfig.h` Android doesn't
 have any of the `_r` functions in the `get{gr,pw}*` family.

 In `System/Posix/User.hsc` the imports of `Control.Monad` and
 `System.IO.Error` are conditional on `defined(HAVE_GETGRNAM_R) ||
 defined(HAVE_GETPWNAM_R)`, but the use site of those modules
 (`doubleAllocWhileERANGE`) was moved outside of any `#if`s by
 http://git.haskell.org/?p=packages/unix.git;a=commit;h=ef683c6ba703.

 I would suggest just removing the conditionals around the import of those
 two modules, since `doubleAllocWhileERANGE` is by now used by four other
 functions.  Otherwise, need to bracket the definition of
 `doubleAllocWhileERANGE` with the same conditional as the one around those
 imports, and should update the conditionals to reflect all four cases in
 which `doubleAllocWhileERANGE` is used.

 (BTW, does Android count as "Operating System: Linux"?  It is based on the
 Linux kernel, but with a rather peculiar user-space.)

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8223>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler




More information about the ghc-tickets mailing list