haskell / directory

Platform-independent library for basic file system operations
https://hackage.haskell.org/package/directory
Other
58 stars 47 forks source link

Use openBinaryTempFile from file-io #185

Closed hasufell closed 2 months ago

hasufell commented 2 months ago

Fixes https://github.com/haskell/directory/issues/182

hasufell commented 2 months ago

@Rufflewind file-io-0.1.3 now has a tighter lower base bound on >= 4.13.0.0, which means 8.6.5 support is dropped.

hasufell commented 2 months ago

Hmm, this is a problem: https://github.com/haskell/directory/actions/runs/10331017603/job/28600720095?pr=185#step:9:348

ghc.exe:  | C:\sr\snapshots\ec89220c\lib\x86_64-windows-ghc-8.10.4\file-io-0.1.3-8zfnnOBQn38Id6g1rLLcl4\HSfile-io-0.1.3-8zfnnOBQn38Id6g1rLLcl4.o: unknown symbol `__createUUIDTempFileErrNo'
ghc.exe: Could not load Object Code C:\sr\snapshots\ec89220c\lib\x86_64-windows-ghc-8.10.4\file-io-0.1.3-8zfnnOBQn38Id6g1rLLcl4\HSfile-io-0.1.3-8zfnnOBQn38Id6g1rLLcl4.o.

ghc.exe: unable to load package `file-io-0.1.3'

https://github.com/hasufell/file-io/blob/5ab65c44c637aa67072f73cea66406859ce6c5e2/windows/System/File/Platform.hsc#L186-L187

foreign import ccall "__createUUIDTempFileErrNo" c_createUUIDTempFileErrNo
  :: CWString -> CWString -> CWString -> Ptr CWString -> IO Bool

This symbol doesn't exist in 8.10: https://gitlab.haskell.org/ghc/ghc/-/blob/ghc-8.10/libraries/base/cbits/Win32Utils.c?ref_type=heads

It appears in 9.0 though: https://gitlab.haskell.org/ghc/ghc/-/blob/ghc-9.0/libraries/base/cbits/Win32Utils.c?ref_type=heads

hasufell commented 2 months ago

https://github.com/hasufell/file-io/pull/25

Rufflewind commented 2 months ago

Thank you!