id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc,os,architecture,failure,difficulty,testcase,blockedby,blocking,related
4147,"'withFilePath' not in scope, windows build, using base 4.1.0.0",lcasburn,igloo,"The cabal file indicates that directory>=1.0.1.0 should install correctly with base>=4.1. However, running in windows, the {{{System.Directory}}} module expects to use the function {{{withFilePath}}} in its functions, but I have not seen it defined until base 4.2:

{{{
copyPermissions :: FilePath -> FilePath -> IO ()
copyPermissions source dest = do
#ifdef mingw32_HOST_OS
  allocaBytes sizeof_stat $ \ p_stat -> do
  withFilePath source $ \p_source -> do
  withFilePath dest $ \p_dest -> do
    throwErrnoIfMinus1_ ""copyPermissions"" $ c_stat p_source p_stat
    mode <- st_mode p_stat
    throwErrnoIfMinus1_ ""copyPermissions"" $ c_wchmod p_dest mode
#else
  stat <- Posix.getFileStatus source
  let mode = Posix.fileMode stat
  Posix.setFileMode dest mode
#endif
}}}

The compilation fails with:
{{{
[1 of 1] Compiling System.Directory ( System\Directory.hs, dist\build\System\Directory.o )

System\Directory.hs:179:2: Not in scope: `withFilePath'
System\Directory.hs:233:2: Not in scope: `withFilePath'
System\Directory.hs:267:2: Not in scope: `withFilePath'
System\Directory.hs:268:2: Not in scope: `withFilePath'
System\Directory.hs:951:6: Not in scope: `withFilePath'
System\Directory.hs:959:6: Not in scope: `withFilePath'
cabal.exe: Error: some packages failed to install:
}}}

I have attached the cabal build output to this ticket.
",bug,closed,normal,,libraries/directory,6.10.4,fixed,,,Windows,Unknown/Multiple,Compile-time crash,,,,,
