diff --git a/Setup.hs b/Setup.hs
--- a/Setup.hs
+++ b/Setup.hs
@@ -1,12 +1,19 @@
+{-# LANGUAGE CPP #-}
 import Distribution.Simple
 import Distribution.PackageDescription
 import Distribution.Simple.LocalBuildInfo(LocalBuildInfo, buildDir)
 import System.Cmd(system)
-import System.FilePath
 
+ps :: String
+#if mingw32_HOST_OS || mingw32_TARGET_OS
+ps = ['\\']
+#else
+ps = ['/']
+#endif
+
 main = defaultMainWithHooks hooks
   where hooks = simpleUserHooks { runTests = runTests' }
 
 runTests' :: Args -> Bool -> PackageDescription -> LocalBuildInfo -> IO ()
 runTests' _ _ _ lbi = system testprog >> return ()
-  where testprog = (buildDir lbi) </> "test" </> "test"
+  where testprog = (buildDir lbi) ++ ps ++ "test" ++ ps ++ "test"
diff --git a/bits-atomic.cabal b/bits-atomic.cabal
--- a/bits-atomic.cabal
+++ b/bits-atomic.cabal
@@ -1,5 +1,5 @@
 Name:               bits-atomic
-Version:            0.1.1
+Version:            0.1.2
 License:            BSD3
 License-File:       License.txt
 Maintainer:         Gabriel Wicke <wicke@wikidev.net>
@@ -19,6 +19,10 @@
     > cabal configure -ftest
     > cabal build
     > cabal test
+ .
+ /Recent changes/:
+ .
+ * 0.1.2: Avoid using System.FilePath in Setup.hs to fix build failure on hackage
 Category:           Data, Concurrency, Foreign
 Stability:          experimental
 Build-Type:         Custom
