Skip to content

Commit c841f93

Browse files
committed
remote: align GC(Options|Result) record field naming
1 parent 77fe9f9 commit c841f93

File tree

4 files changed

+23
-23
lines changed

4 files changed

+23
-23
lines changed

hnix-store-remote/src/System/Nix/Store/Remote.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,9 @@ deleteSpecific paths = do
234234
putInt (0::Int)
235235
putInt (0::Int)
236236
getSocketIncremental $ do
237-
gcResult_deletedPaths <- getPathsOrFail storeDir
238-
gcResult_bytesFreed <- getInt
239-
-- TODO: who knows
237+
gcResultDeletedPaths <- getPathsOrFail storeDir
238+
gcResultBytesFreed <- getInt
239+
-- TODO: obsolete
240240
_ :: Int <- getInt
241241
pure GCResult{..}
242242

hnix-store-remote/src/System/Nix/Store/Remote/Serializer.hs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,10 +1101,10 @@ storeRequest = Serializer
11011101
pure $ Some (BuildDerivation path drv buildMode')
11021102

11031103
WorkerOp_CollectGarbage -> mapGetE $ do
1104-
gcOptions_operation <- getS enum
1105-
gcOptions_pathsToDelete <- getS (hashSet storePath)
1106-
gcOptions_ignoreLiveness <- getS bool
1107-
gcOptions_maxFreed <- getS int
1104+
gcOptionsOperation <- getS enum
1105+
gcOptionsPathsToDelete <- getS (hashSet storePath)
1106+
gcOptionsIgnoreLiveness <- getS bool
1107+
gcOptionsMaxFreed <- getS int
11081108
-- obsolete fields
11091109
Control.Monad.forM_ [0..(2 :: Word8)]
11101110
$ pure $ getS (int @Word8)
@@ -1238,10 +1238,10 @@ storeRequest = Serializer
12381238
Some (CollectGarbage GCOptions{..}) -> mapPutE $ do
12391239
putS workerOp WorkerOp_CollectGarbage
12401240

1241-
putS enum gcOptions_operation
1242-
putS (hashSet storePath) gcOptions_pathsToDelete
1243-
putS bool gcOptions_ignoreLiveness
1244-
putS int gcOptions_maxFreed
1241+
putS enum gcOptionsOperation
1242+
putS (hashSet storePath) gcOptionsPathsToDelete
1243+
putS bool gcOptionsIgnoreLiveness
1244+
putS int gcOptionsMaxFreed
12451245
-- obsolete fields
12461246
Control.Monad.forM_ [0..(2 :: Word8)]
12471247
$ pure $ putS int (0 :: Word8)
@@ -1444,12 +1444,12 @@ gcResult
14441444
=> NixSerializer r ReplySError GCResult
14451445
gcResult = mapErrorS ReplySError_GCResult $ Serializer
14461446
{ getS = do
1447-
gcResult_deletedPaths <- getS (hashSet storePath)
1448-
gcResult_bytesFreed <- getS int
1447+
gcResultDeletedPaths <- getS (hashSet storePath)
1448+
gcResultBytesFreed <- getS int
14491449
Control.Monad.void $ getS (int @Word64) -- obsolete
14501450
pure GCResult{..}
14511451
, putS = \GCResult{..} -> do
1452-
putS (hashSet storePath) gcResult_deletedPaths
1453-
putS int gcResult_bytesFreed
1452+
putS (hashSet storePath) gcResultDeletedPaths
1453+
putS int gcResultBytesFreed
14541454
putS (int @Word64) 0 -- obsolete
14551455
}

hnix-store-remote/src/System/Nix/Store/Remote/Types/GC.hs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,24 @@ data GCAction
2424
-- | Garbage collector operation options
2525
data GCOptions = GCOptions
2626
{ -- | Operation
27-
gcOptions_operation :: GCAction
27+
gcOptionsOperation :: GCAction
2828
-- | If set, then reachability from the roots is ignored (unused)
29-
, gcOptions_ignoreLiveness :: Bool
29+
, gcOptionsIgnoreLiveness :: Bool
3030
-- | Paths to delete for @GCAction_DeleteSpecific@
31-
, gcOptions_pathsToDelete :: HashSet StorePath
31+
, gcOptionsPathsToDelete :: HashSet StorePath
3232
-- | Stop after `gcOptions_maxFreed` bytes have been freed
33-
, gcOptions_maxFreed :: Word64
33+
, gcOptionsMaxFreed :: Word64
3434
} deriving (Eq, Generic, Ord, Show)
3535

3636
-- | Result of the garbage collection operation
3737
data GCResult = GCResult
3838
{ -- | Depending on the action, the GC roots,
3939
-- or the paths that would be or have been deleted
40-
gcResult_deletedPaths :: HashSet StorePath
40+
gcResultDeletedPaths :: HashSet StorePath
4141
-- | The number of bytes that would be or was freed for
4242
--
4343
-- - @GCAction_ReturnDead@
4444
-- - @GCAction_DeleteDead@
4545
-- - @GCAction_DeleteSpecific@
46-
, gcResult_bytesFreed :: Word64
46+
, gcResultBytesFreed :: Word64
4747
} deriving (Eq, Generic, Ord, Show)

hnix-store-remote/tests-io/NixDaemon.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,6 @@ spec_protocol = Hspec.around withNixDaemon $
297297
removeFile $ mconcat [ tempRootsDir, "/", entry ]
298298

299299
GCResult{..} <- deleteSpecific (HS.fromList [path])
300-
gcResult_deletedPaths `shouldBe` HS.fromList [path]
301-
gcResult_bytesFreed `shouldBe` 4
300+
gcResultDeletedPaths `shouldBe` HS.fromList [path]
301+
gcResultBytesFreed `shouldBe` 4
302302

0 commit comments

Comments
 (0)