{"action":"opened","issue":{"url":"https://api.github.com/repos/jwiegley/gitlib/issues/50","labels_url":"https://api.github.com/repos/jwiegley/gitlib/issues/50/labels{/name}","comments_url":"https://api.github.com/repos/jwiegley/gitlib/issues/50/comments","events_url":"https://api.github.com/repos/jwiegley/gitlib/issues/50/events","html_url":"https://github.com/jwiegley/gitlib/issues/50","id":91749665,"number":50,"title":"System.Posix and unix[-compat]","user":{"login":"srenatus","id":870638,"avatar_url":"https://avatars.githubusercontent.com/u/870638?v=3","gravatar_id":"","url":"https://api.github.com/users/srenatus","html_url":"https://github.com/srenatus","followers_url":"https://api.github.com/users/srenatus/followers","following_url":"https://api.github.com/users/srenatus/following{/other_user}","gists_url":"https://api.github.com/users/srenatus/gists{/gist_id}","starred_url":"https://api.github.com/users/srenatus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/srenatus/subscriptions","organizations_url":"https://api.github.com/users/srenatus/orgs","repos_url":"https://api.github.com/users/srenatus/repos","events_url":"https://api.github.com/users/srenatus/events{/privacy}","received_events_url":"https://api.github.com/users/srenatus/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-06-29T09:19:48Z","updated_at":"2015-06-29T09:19:48Z","closed_at":null,"body":"Hi there. Trying to use gitlib under windows (with msys2 and haskell platform), I stumbled upon the following:\r\n\r\n```console\r\n$ cabal sandbox init; cabal install --only-dependencies # successful (output redacted)\r\n$ cabal repl\r\nPackage has never been configured. Configuring with default flags. If this\r\nfails, please run configure manually.\r\nResolving dependencies...\r\nConfiguring gitlib-3.1.0.2...\r\nPreprocessing library gitlib-3.1.0.2...\r\n[...]\r\nLoading package unix-compat-0.4.1.4 ... linking ... done.\r\nLoading package conduit-combinators-1.0.1 ... linking ... done.\r\n\r\nGit\\Tree\\Working.hs:21:18:\r\n    Could not find module `System.Posix.Files'\r\n    Perhaps you meant System.Posix.Types (from base)\r\n    Use -v to see a list of the files searched for.\r\nFailed, modules loaded: none.\r\n```\r\n\r\nWith the following changes, \r\n\r\n```patch\r\ndiff --git a/gitlib/Git/Tree/Working.hs b/gitlib/Git/Tree/Working.hs\r\nindex d2dedef..8a41edd 100644\r\n--- a/gitlib/Git/Tree/Working.hs\r\n+++ b/gitlib/Git/Tree/Working.hs\r\n@@ -18,7 +18,7 @@ import           Data.Time.Clock.POSIX (posixSecondsToUTCTime)\r\n import           Git hiding (Options)\r\n import           Prelude hiding (log)\r\n import           System.FilePath.Posix\r\n-import           System.Posix.Files\r\n+import           System.PosixCompat.Files\r\n\r\n data FileEntry m = FileEntry\r\n     { fileModTime  :: UTCTime\r\ndiff --git a/gitlib/gitlib.cabal b/gitlib/gitlib.cabal\r\nindex fd36f0f..d043a21 100644\r\n--- a/gitlib/gitlib.cabal\r\n+++ b/gitlib/gitlib.cabal\r\n@@ -61,6 +61,7 @@ Library\r\n         , time                 >= 1.4\r\n         , transformers         >= 0.3.0.0\r\n         , unordered-containers >= 0.2.3.0\r\n+        , unix-compat\r\n     if !os(mingw32)\r\n         build-depends:\r\n           unix                 >= 2.5.1.1\r\n```\r\n\r\n...everything  seems to work:\r\n\r\n```console\r\n$ cabal repl\r\n.\\gitlib.cabal has been changed. Re-configuring with most recently used\r\noptions. If this fails, please run configure manually.\r\nResolving dependencies...\r\nConfiguring gitlib-3.1.0.2...\r\nPreprocessing library gitlib-3.1.0.2...\r\n[...]\r\nOk, modules loaded: Git, Git.Blob, Git.Commit, Git.Commit.Push, Git.Object, Git.Reference, Git.Repository, Git.Tree, Git.Tree.Builder, Git.Types, Git.Tree.Builder.Pure, Git.Tree.Working, Git.Tutorial, Git.Utils, Git.Working.\r\n*Git>\r\n```\r\n\r\nI'd gladly file a PR, but I'm not sure if this fix is correct, since there's some \"don't-use-unix-on-windows\"-logic in the cabal file already...\r\n\r\nThanks for your help\r\nStephan"}}