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

#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

#8223: System.Posix.User fails to build on systems without get{gr,pw}nam_r ----------------------------------------+--------------------------- Reporter: rwbarton | Owner: Type: bug | Status: patch Priority: normal | Milestone: Component: libraries/unix | Version: 7.7 Resolution: | Keywords: Operating System: Other | Architecture: arm Type of failure: Building GHC failed | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: ----------------------------------------+--------------------------- Changes (by rwbarton): * status: new => patch Comment: I don't really think it makes sense to micro-optimize random modules for code size when it won't affect most platforms anyways, so here is the patch for simply making the imports unconditional. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8223#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8223: System.Posix.User fails to build on systems without get{gr,pw}nam_r ----------------------------------------+--------------------------- Reporter: rwbarton | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: libraries/unix | Version: 7.7 Resolution: fixed | Keywords: Operating System: Other | Architecture: arm Type of failure: Building GHC failed | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: ----------------------------------------+--------------------------- Changes (by thoughtpolice): * status: patch => closed * resolution: => fixed Comment: Merged, thanks! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8223#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC