daml/sdk/bazel_tools/haskell-ghcide-binary-q.patch
Gary Verhaegen e40aad897f
move to subdir 3.0 (#18520)
* move most files

* update CI configuration
2024-03-22 02:27:46 +01:00

21 lines
785 B
Diff

diff --git a/src/Development/IDE/Core/Shake.hs b/src/Development/IDE/Core/Shake.hs
index a471070..a2b3183 100644
--- a/src/Development/IDE/Core/Shake.hs
+++ b/src/Development/IDE/Core/Shake.hs
@@ -503,7 +503,14 @@ isBadDependency x
newtype Q k = Q (k, NormalizedFilePath)
deriving (Eq,Hashable,NFData, Generic)
-instance Binary k => Binary (Q k)
+instance Binary k => Binary (Q k) where
+ put (Q (k, fp)) = put (k, fp)
+ get = do
+ (k, fp) <- get
+ -- The `get` implementation of NormalizedFilePath
+ -- does not handle empty file paths so we
+ -- need to handle this ourselves here.
+ pure (Q (k, toNormalizedFilePath' fp))
instance Show k => Show (Q k) where
show (Q (k, file)) = show k ++ "; " ++ fromNormalizedFilePath file