Skip to content

Commit 15d2e4b

Browse files
rvlsevanspowellhamishmack
authored
Fix stack-to-nix: .stack-to-nix.cache: openFile: resource busy (file is locked) (#98)
* Fix stack-to-nix: .stack-to-nix.cache: openFile: resource busy (file is locked) * Use deepseq fmap instead of seq fmap * niv update haskell.nix * Fix for buildkite Co-authored-by: Samuel Evans-Powell <[email protected]> Co-authored-by: Hamish Mackenzie <[email protected]>
1 parent c8c5e6a commit 15d2e4b

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

.buildkite/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ cabal new-configure
1717

1818
echo
1919
echo "+++ Run stable version of plan-to-nix"
20-
nix build '(let haskellNix = import (builtins.fetchTarball "https://github.com/input-output-hk/haskell.nix/archive/hkm/use-source-repo.tar.gz") {}; in (import haskellNix.sources.nixpkgs haskellNix.nixpkgsArgs).haskell-nix.nix-tools.ghc8105)' -o nt
20+
nix build '(let haskellNix = import (builtins.fetchTarball "https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz") {}; in (import haskellNix.sources.nixpkgs haskellNix.nixpkgsArgs).haskell-nix.nix-tools.ghc8105)' -o nt
2121
./nt/bin/plan-to-nix --output .buildkite/nix1 --plan-json dist-newstyle/cache/plan.json
2222

2323
# Replace currently broken plan-to-nix output

lib/Stack2nix/Cache.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ module Stack2nix.Cache
44
, cacheHits
55
) where
66

7+
import Control.DeepSeq ((<$!!>))
78
import Control.Exception (catch, SomeException(..))
89

910
readCache :: FilePath
@@ -14,14 +15,13 @@ readCache :: FilePath
1415
, String -- pkgname
1516
, String -- nixexpr-path
1617
)]
17-
readCache f = fmap (toTuple . words) . lines <$> readFile f
18+
readCache f = fmap (toTuple . words) . lines <$!!> readFile f
1819
where toTuple [ url, rev, subdir, sha256, pkgname, exprPath ]
1920
= ( url, rev, subdir, sha256, pkgname, exprPath )
2021

2122
appendCache :: FilePath -> String -> String -> String -> String -> String -> String -> IO ()
2223
appendCache f url rev subdir sha256 pkgname exprPath = do
23-
appendFile f $ unwords [ url, rev, subdir, sha256, pkgname, exprPath ]
24-
appendFile f "\n"
24+
appendFile f $! unwords [ url, rev, subdir, sha256, pkgname, exprPath ] ++ "\n"
2525

2626
cacheHits :: FilePath -> String -> String -> String -> IO [ (String, String) ]
2727
cacheHits f url rev subdir

nix/sources.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
"homepage": "https://input-output-hk.github.io/haskell.nix",
66
"owner": "input-output-hk",
77
"repo": "haskell.nix",
8-
"rev": "920ac43ee13d95f56d7539bece1f5ee41b10c8a9",
9-
"sha256": "0px60yvag24ayj9zl82cbnpixm41slj2wqw4p2vgbwnbz125hgsx",
8+
"rev": "1992b910e9b4d880e1f4639f4fe7266bceb9a5ad",
9+
"sha256": "15w3wixjnb52f7cj3s94fy0zc0l1gc94p3n2wyq3qqxj10hvirfw",
1010
"type": "tarball",
11-
"url": "https://github.com/input-output-hk/haskell.nix/archive/920ac43ee13d95f56d7539bece1f5ee41b10c8a9.tar.gz",
11+
"url": "https://github.com/input-output-hk/haskell.nix/archive/1992b910e9b4d880e1f4639f4fe7266bceb9a5ad.tar.gz",
1212
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
1313
},
1414
"niv": {

0 commit comments

Comments
 (0)