[GHC] #9945: export list for System.Posix.Internals breaking the build on Windows

GHC ghc-devs at haskell.org
Wed Dec 31 17:18:54 UTC 2014


#9945: export list for System.Posix.Internals breaking the build on Windows
-------------------------------------+-------------------------------------
        Reporter:  MartinF           |                   Owner:  MartinF
            Type:  bug               |                  Status:  new
        Priority:  normal            |               Milestone:
       Component:  Compiler          |                 Version:  7.11
      Resolution:                    |                Keywords:
Operating System:  Windows           |            Architecture:
 Type of failure:  Building GHC      |  Unknown/Multiple
  failed                             |               Test Case:
      Blocked By:                    |                Blocking:
 Related Tickets:  #9852             |  Differential Revisions:
-------------------------------------+-------------------------------------

Comment (by simonpj):

 I tripped over it too. The patch below "fixes" it, but it is obviously Not
 Right.

 Various functions are defined under THREE different sets of conditions
  * `#if !defined(HTYPE_TCFLAG_T)`
  * `#if !defined(mingw32_HOST_OS)`
  * `#if !defined(mingw32_HOST_OS) && !defined(__MINGW32__)`

 They should presumably be just one set of conditions?

 Anyway it would be great if someone could fix it properly.

 Simon

 {{{
 diff --git a/libraries/base/System/Posix/Internals.hs
 b/libraries/base/System/Posix/Internals.hs
 index e2e32c3..344c09c 100644
 --- a/libraries/base/System/Posix/Internals.hs
 +++ b/libraries/base/System/Posix/Internals.hs
 @@ -25,24 +25,43 @@ module System.Posix.Internals
       CFLock, CFilePath, CGroup, CLconv, CPasswd, CSigaction, CSigset,
 CStat,
       CTermios, CTm, CTms, CUtimbuf, CUtsname, FD,

 -     c_access, c_chmod, c_close, c_creat, c_dup, c_dup2, c_fcntl_lock,
 -     c_fcntl_read, c_fcntl_write, c_fork, c_fstat, c_ftruncate, c_getpid,
 -     c_isatty, c_lflag, c_link, c_lseek, c_mkfifo, c_open, c_pipe,
 c_read,
 -     c_s_isblk, c_s_ischr, c_s_isdir, c_s_isfifo, c_s_isreg, c_s_issock,
 -     c_safe_open, c_safe_read, c_safe_write, c_sigaddset, c_sigemptyset,
 -     c_sigprocmask, c_stat, c_tcgetattr, c_tcsetattr, c_umask, c_unlink,
 -     c_utime, c_waitpid, c_write, const_echo, const_f_getfl,
 const_f_setfd,
 +     c_access, c_chmod, c_close, c_creat, c_dup, c_dup2,
 +
 +#if !defined(mingw32_HOST_OS) && !defined(__MINGW32__)
 +     c_fcntl_lock, c_fcntl_read, c_fcntl_write, c_fork, c_link, c_mkfifo,
 c_pipe,
 +     c_sigemptyset, c_sigaddset, c_sigprocmask, c_tcgetattr, c_tcsetattr,
 +     c_utime, c_waitpid, c_s_issock,
 +     setCloseOnExec,
 +#endif
 +#if !defined(mingw32_HOST_OS)
 +     peekFilePathLen,
 +#endif
 +
 +#if defined(HTYPE_TCFLAG_T)
 +     tcSetAttr,
 +     sizeof_termios, sizeof_sigset_t, c_lflag, poke_c_lflag, ptr_c_cc,
 +     get_saved_termios, set_saved_termios,
 +#else
 +     is_console,
 +#endif
 +
 +     c_fstat, c_ftruncate, c_getpid,
 +     c_isatty, c_lseek, c_open, c_read,
 +     c_s_isblk, c_s_ischr, c_s_isdir, c_s_isfifo, c_s_isreg,
 +     c_safe_open, c_safe_read, c_safe_write,
 +     c_stat, c_umask, c_unlink,
 +     c_write, const_echo, const_f_getfl, const_f_setfd,
       const_f_setfl, const_fd_cloexec, const_icanon, const_sig_block,
       const_sig_setmask, const_sigttou, const_tcsanow, const_vmin,
 const_vtime,
       dEFAULT_BUFFER_SIZE, fdFileSize, fdGetMode, fdStat, fdType,
 fileType,
 -     getEcho, get_saved_termios, ioe_unknownfiletype, lstat, newFilePath,
 +     getEcho, ioe_unknownfiletype, lstat, newFilePath,
       o_APPEND, o_BINARY, o_CREAT, o_EXCL, o_NOCTTY, o_NONBLOCK, o_RDONLY,
 -     o_RDWR, o_TRUNC, o_WRONLY, peekFilePath, peekFilePathLen,
 poke_c_lflag,
 -     ptr_c_cc, puts, sEEK_CUR, sEEK_END, sEEK_SET, s_isblk, s_ischr,
 s_isdir,
 -     s_isfifo, s_isreg, s_issock, setCloseOnExec, setCooked, setEcho,
 -     setNonBlockingFD, set_saved_termios, sizeof_sigset_t, sizeof_stat,
 -     sizeof_termios, st_dev, st_ino, st_mode, st_mtime, st_size,
 statGetType,
 -     tcSetAttr, withFilePath
 +     o_RDWR, o_TRUNC, o_WRONLY, peekFilePath,
 +     puts, sEEK_CUR, sEEK_END, sEEK_SET, s_isblk, s_ischr, s_isdir,
 +     s_isfifo, s_isreg, s_issock, setCooked, setEcho,
 +     setNonBlockingFD, sizeof_stat,
 +     st_dev, st_ino, st_mode, st_mtime, st_size, statGetType,
 +     withFilePath
       ) where

  #include "HsBaseConfig.h"
 }}}

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


More information about the ghc-tickets mailing list