diff --git a/hnix-store-remote/src/System/Nix/Store/Remote.hs b/hnix-store-remote/src/System/Nix/Store/Remote.hs index af830a7..3aacb63 100644 --- a/hnix-store-remote/src/System/Nix/Store/Remote.hs +++ b/hnix-store-remote/src/System/Nix/Store/Remote.hs @@ -234,9 +234,9 @@ deleteSpecific paths = do putInt (0::Int) putInt (0::Int) getSocketIncremental $ do - gcResult_deletedPaths <- getPathsOrFail storeDir - gcResult_bytesFreed <- getInt - -- TODO: who knows + gcResultDeletedPaths <- getPathsOrFail storeDir + gcResultBytesFreed <- getInt + -- TODO: obsolete _ :: Int <- getInt pure GCResult{..} diff --git a/hnix-store-remote/src/System/Nix/Store/Remote/Serializer.hs b/hnix-store-remote/src/System/Nix/Store/Remote/Serializer.hs index 47249db..c5fd1b3 100644 --- a/hnix-store-remote/src/System/Nix/Store/Remote/Serializer.hs +++ b/hnix-store-remote/src/System/Nix/Store/Remote/Serializer.hs @@ -1101,10 +1101,10 @@ storeRequest = Serializer pure $ Some (BuildDerivation path drv buildMode') WorkerOp_CollectGarbage -> mapGetE $ do - gcOptions_operation <- getS enum - gcOptions_pathsToDelete <- getS (hashSet storePath) - gcOptions_ignoreLiveness <- getS bool - gcOptions_maxFreed <- getS int + gcOptionsOperation <- getS enum + gcOptionsPathsToDelete <- getS (hashSet storePath) + gcOptionsIgnoreLiveness <- getS bool + gcOptionsMaxFreed <- getS int -- obsolete fields Control.Monad.forM_ [0..(2 :: Word8)] $ pure $ getS (int @Word8) @@ -1238,10 +1238,10 @@ storeRequest = Serializer Some (CollectGarbage GCOptions{..}) -> mapPutE $ do putS workerOp WorkerOp_CollectGarbage - putS enum gcOptions_operation - putS (hashSet storePath) gcOptions_pathsToDelete - putS bool gcOptions_ignoreLiveness - putS int gcOptions_maxFreed + putS enum gcOptionsOperation + putS (hashSet storePath) gcOptionsPathsToDelete + putS bool gcOptionsIgnoreLiveness + putS int gcOptionsMaxFreed -- obsolete fields Control.Monad.forM_ [0..(2 :: Word8)] $ pure $ putS int (0 :: Word8) @@ -1444,12 +1444,12 @@ gcResult => NixSerializer r ReplySError GCResult gcResult = mapErrorS ReplySError_GCResult $ Serializer { getS = do - gcResult_deletedPaths <- getS (hashSet storePath) - gcResult_bytesFreed <- getS int + gcResultDeletedPaths <- getS (hashSet storePath) + gcResultBytesFreed <- getS int Control.Monad.void $ getS (int @Word64) -- obsolete pure GCResult{..} , putS = \GCResult{..} -> do - putS (hashSet storePath) gcResult_deletedPaths - putS int gcResult_bytesFreed + putS (hashSet storePath) gcResultDeletedPaths + putS int gcResultBytesFreed putS (int @Word64) 0 -- obsolete } diff --git a/hnix-store-remote/src/System/Nix/Store/Remote/Types/GC.hs b/hnix-store-remote/src/System/Nix/Store/Remote/Types/GC.hs index 8fdda8b..b707ca6 100644 --- a/hnix-store-remote/src/System/Nix/Store/Remote/Types/GC.hs +++ b/hnix-store-remote/src/System/Nix/Store/Remote/Types/GC.hs @@ -24,24 +24,24 @@ data GCAction -- | Garbage collector operation options data GCOptions = GCOptions { -- | Operation - gcOptions_operation :: GCAction + gcOptionsOperation :: GCAction -- | If set, then reachability from the roots is ignored (unused) - , gcOptions_ignoreLiveness :: Bool + , gcOptionsIgnoreLiveness :: Bool -- | Paths to delete for @GCAction_DeleteSpecific@ - , gcOptions_pathsToDelete :: HashSet StorePath + , gcOptionsPathsToDelete :: HashSet StorePath -- | Stop after `gcOptions_maxFreed` bytes have been freed - , gcOptions_maxFreed :: Word64 + , gcOptionsMaxFreed :: Word64 } deriving (Eq, Generic, Ord, Show) -- | Result of the garbage collection operation data GCResult = GCResult { -- | Depending on the action, the GC roots, -- or the paths that would be or have been deleted - gcResult_deletedPaths :: HashSet StorePath + gcResultDeletedPaths :: HashSet StorePath -- | The number of bytes that would be or was freed for -- -- - @GCAction_ReturnDead@ -- - @GCAction_DeleteDead@ -- - @GCAction_DeleteSpecific@ - , gcResult_bytesFreed :: Word64 + , gcResultBytesFreed :: Word64 } deriving (Eq, Generic, Ord, Show) diff --git a/hnix-store-remote/tests-io/NixDaemon.hs b/hnix-store-remote/tests-io/NixDaemon.hs index a83a9c8..ac847bd 100644 --- a/hnix-store-remote/tests-io/NixDaemon.hs +++ b/hnix-store-remote/tests-io/NixDaemon.hs @@ -297,6 +297,6 @@ spec_protocol = Hspec.around withNixDaemon $ removeFile $ mconcat [ tempRootsDir, "/", entry ] GCResult{..} <- deleteSpecific (HS.fromList [path]) - gcResult_deletedPaths `shouldBe` HS.fromList [path] - gcResult_bytesFreed `shouldBe` 4 + gcResultDeletedPaths `shouldBe` HS.fromList [path] + gcResultBytesFreed `shouldBe` 4