Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turn StorePathMetadata into Metadata a #147

Closed
sorki opened this issue Mar 24, 2021 · 1 comment
Closed

Turn StorePathMetadata into Metadata a #147

sorki opened this issue Mar 24, 2021 · 1 comment

Comments

@sorki
Copy link
Member

sorki commented Mar 24, 2021

Related to #146, allows us to extend various path types, motivation in #148.

Draft:

 -- | Metadata about a 'StorePath'
-data StorePathMetadata = StorePathMetadata
+data Metadata a = Metadata
   { -- | The path this metadata is about
-    path :: !StorePath
+    path :: !a
   , -- | The path to the derivation file that built this path, if any
     -- and known.
-    deriverPath :: !(Maybe StorePath)
+    deriverPath :: !(Maybe a)
   , -- TODO should this be optional?
     -- | The hash of the nar serialization of the path.
     narHash :: !SomeNamedDigest
   , -- | The paths that this path directly references
-    references :: !StorePathSet
+    references :: !(HashSet a)
   , -- | When was this path registered valid in the store?
     registrationTime :: !UTCTime
   , -- | The size of the nar serialization of the path, in bytes.
@@ -43,6 +43,8 @@ data StorePathMetadata = StorePathMetadata
     contentAddressableAddress :: !(Maybe ContentAddressableAddress)
   }
 
+type StorePathMetadata = Metadata StorePath
@sorki sorki closed this as completed in e6f016d Nov 17, 2023
@Ericson2314
Copy link
Member

In my https://github.com/obsidiansystems/hnix-store/tree/daemon-server-side and in C++ Nix, I just got rid of the field. That, for example, normalizes (in the DB sense) Map StorePath Metadata.

sorki added a commit to sorki/hnix-store that referenced this issue Nov 18, 2023
Isn't used anywhere and it is better to have
`Map StorePath (Metadata StorePath)`

See also haskell-nix#147 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants