#4147: 'withFilePath' not in scope, windows build, using base 4.1.0.0
---------------------------------+------------------------------------------
    Reporter:  lcasburn          |       Owner:                     
        Type:  bug               |      Status:  new                
    Priority:  normal            |   Component:  libraries/directory
     Version:  6.10.4            |    Keywords:                     
          Os:  Windows           |    Testcase:                     
Architecture:  Unknown/Multiple  |     Failure:  Compile-time crash 
---------------------------------+------------------------------------------
 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.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4147>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to