From e03c5ee4a1b84d397e202fc924e9308ce6a50f1a Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Sun, 19 Feb 2023 16:51:01 +0800 Subject: [PATCH] Don't fail on setModificationTime, fixes #784 Related: * https://github.com/actions/runner-images/issues/7061 * https://github.com/actions/runner-images/pull/7068 --- lib/GHCup/Download.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/GHCup/Download.hs b/lib/GHCup/Download.hs index 8c350fe..4e9bd31 100644 --- a/lib/GHCup/Download.hs +++ b/lib/GHCup/Download.hs @@ -263,8 +263,12 @@ getBase uri = do dlWithMod modTime json_file = do let (dir, fn) = splitFileName json_file f <- liftE $ download uri' (Just $ over pathL' (<> ".sig") uri') Nothing Nothing dir (Just fn) True - liftIO $ setModificationTime f modTime - liftIO $ setAccessTime f modTime + + -- make these failures non-fatal, also see: + -- https://github.com/actions/runner-images/issues/7061 + handleIO (\e -> logWarn $ "setModificationTime failed with: " <> T.pack (displayException e)) $ liftIO $ setModificationTime f modTime + handleIO (\e -> logWarn $ "setAccessTime failed with: " <> T.pack (displayException e)) $ liftIO $ setAccessTime f modTime + pure f