Skip to content

Commit 60b90d8

Browse files
committed
be safe
1 parent 7f063be commit 60b90d8

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

src/Rules/Boost.hs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,8 @@ boostRule = do
7373
"-DBOOST_INSTALL_LAYOUT=system"
7474
],
7575
-- symlink headers for each abi to reduce size
76-
postBuildEachABI = BuildActionABI $ \_ env -> do
77-
liftIO $ do
78-
createDirectoryLink (".." </> "include") (buildEnvOutPrefix env </> "include")
76+
postBuildEachABI = BuildActionABI $ \_ env ->
77+
liftIO $ createDirectoryLink (".." </> "include") (buildEnvOutPrefix env </> "include")
7978
}
8079
"boost" ~> do
8180
buildWithAndroidEnv buildBoost Boost

src/Rules/Marisa.hs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ where
1111

1212
import Base
1313
import CMakeBuilder
14-
import System.IO.Unsafe (unsafePerformIO)
1514

1615
data MarisaTrie = MarisaTrie
1716
deriving stock (Eq, Show, Typeable, Generic)
@@ -22,7 +21,7 @@ type instance RuleResult MarisaTrie = ()
2221
hostMarisaRule :: Rules ()
2322
hostMarisaRule = do
2423
"host-marisa" ~> do
25-
let marisaSrc = unsafePerformIO $ canonicalizePath "marisa-trie"
24+
marisaSrc <- liftIO $ canonicalizePath "marisa-trie"
2625
let buildDir = outputDir </> "marisa-build-host"
2726
let hostPrefix = outputDir </> "host"
2827
cmd_ (Cwd marisaSrc) "git checkout ."

src/Rules/OpenCC.hs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ where
1212

1313
import Base
1414
import CMakeBuilder
15-
import System.IO.Unsafe (unsafePerformIO)
1615

1716
data OpenCC = OpenCC
1817
deriving stock (Eq, Show, Typeable, Generic)
@@ -24,7 +23,7 @@ hostOpenCCRule :: Rules ()
2423
hostOpenCCRule = do
2524
"opencc-dict" ~> do
2625
need [ "host-marisa" ]
27-
let openccSrc = unsafePerformIO $ canonicalizePath "OpenCC"
26+
openccSrc <- liftIO $ canonicalizePath "OpenCC"
2827
let buildDir = outputDir </> "opencc-build-host"
2928
let hostPrefix = outputDir </> "host"
3029
cmd_ Shell ("echo " <> openccSrc)

0 commit comments

Comments
 (0)