From 03f5adcd62fb1c6676f8b9e77723bac514ac8e9d Mon Sep 17 00:00:00 2001 From: David Eichmann <EichmannD@gmail.com> Date: Wed, 3 Jul 2019 11:25:11 +0100 Subject: [PATCH] Bump Shake and copy instead of hard link from cloud cache This is important as in hard link mode shake makes all such files read only to avoid accidentally modifying cache files via the hard link. It turns out, many Hadrian rules attempt read access to such files and hence fail in the hard link mode. These rules could be refactored to avoid write access, but using copy instead of hard link a much simpler solution. --- hadrian/hadrian.cabal | 2 +- hadrian/src/Main.hs | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/hadrian/hadrian.cabal b/hadrian/hadrian.cabal index e895334baedf..1e7287cb921c 100644 --- a/hadrian/hadrian.cabal +++ b/hadrian/hadrian.cabal @@ -128,7 +128,7 @@ executable hadrian , mtl == 2.2.* , parsec >= 3.1 && < 3.2 , QuickCheck >= 2.6 && < 2.13 - , shake >= 0.17.6 + , shake >= 0.18.3 , transformers >= 0.4 && < 0.6 , unordered-containers >= 0.2.1 && < 0.3 build-tools: alex >= 3.1 diff --git a/hadrian/src/Main.hs b/hadrian/src/Main.hs index 34e2afe23ef2..63001fe53b56 100644 --- a/hadrian/src/Main.hs +++ b/hadrian/src/Main.hs @@ -41,6 +41,16 @@ main = do , shakeTimings = True , shakeExtra = extra + -- Setting shakeSymlink to False ensures files are copied out of + -- shake's cloud cache instead of hard linked. This is important as + -- the hard link mode makes all such files read only to avoid + -- accidentally modifying cache files via the hard link. It turns + -- out, many Hadrian rules attempt read access to such files and + -- hence would in the hard link mode. These rules could be + -- refactored to avoid write access, but setting shakeSymlink to + -- False is a much simpler solution. + , shakeSymlink = False + -- Enable linting file accesses in the build dir and ghc root dir -- (cwd) when using the `--lint-fsatrace` option. , shakeLintInside = [ cwd, buildRoot ] -- GitLab