Flox Package Database 1
CRUD Operations on Nix Package Metadata
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
flox::resolver::Lockfile Class Reference

A locked representation of an environment. More...

#include <lockfile.hh>

Public Member Functions

 Lockfile (const Lockfile &)=default
 
 Lockfile (Lockfile &&)=default
 
 Lockfile (LockfileRaw raw)
 
 Lockfile (std::filesystem::path lockfilePath)
 
Lockfileoperator= (const Lockfile &)=default
 
Lockfileoperator= (Lockfile &&)=default
 
const LockfileRawgetLockfileRaw () const
 Get the raw representation of the lockfile.
 
const ManifestRawgetManifestRaw () const
 Get the original manifest used to create the lockfile.
 
const RegistryRawgetRegistryRaw () const
 Get the locked registry from the raw lockfile.
 
const EnvironmentManifestgetManifest () const
 Get old manifest.
 
const std::unordered_map< InstallID, ManifestDescriptor > & getDescriptors () const
 Get old descriptors.
 
const RegistryRawgetPackagesRegistryRaw () const
 Get the packagesRegistryRaw, containing all inputs used by packages.** members of the lockfile.
 
std::size_t removeUnusedInputs ()
 Drop any registry.inputs and registry.priority members that are not explicitly declared in the manifest registry or used by resolved packages.
 

Private Member Functions

void checkGroups () const
 Check the lockfile's packages.** locked inputs align with the requested groups in manifest.install.<INSTALL-ID>.packageGroup, Throws an exception if two packages in the same group use different inputs.
 
void check () const
 Check the lockfile's validity, throwing an exception for invalid contents.
 
void init ()
 Initialize manifest and packagesRegistryRaw from lockfileRaw.
 

Private Attributes

LockfileRaw lockfileRaw
 
EnvironmentManifest manifest
 
RegistryRaw packagesRegistryRaw
 

Detailed Description

A locked representation of an environment.

Unlike the raw form, this form is suitable for stashing temporary variables and other information that is not needed for serializing/de-serializing.

Member Function Documentation

◆ check()

void flox::resolver::Lockfile::check ( ) const
private

Check the lockfile's validity, throwing an exception for invalid contents.

This asserts that:

  • lockfileVersion is supported.
  • packages members' groups are enforced.
  • original manifest is consistent with the lockfile's registry.* and packages.** members for optional and systems skipping.
  • registry inputs do not use indirect flake references.

◆ getPackagesRegistryRaw()

const RegistryRaw & flox::resolver::Lockfile::getPackagesRegistryRaw ( ) const
inline

Get the packagesRegistryRaw, containing all inputs used by packages.** members of the lockfile.

This registry keys inputs by their fingerprints.

◆ removeUnusedInputs()

std::size_t flox::resolver::Lockfile::removeUnusedInputs ( )

Drop any registry.inputs and registry.priority members that are not explicitly declared in the manifest registry or used by resolved packages.

Returns
The number of removed inputs.

Member Data Documentation

◆ lockfileRaw

LockfileRaw flox::resolver::Lockfile::lockfileRaw
private

Raw representation of the lockfile.

◆ manifest

EnvironmentManifest flox::resolver::Lockfile::manifest
private

Handle for the manifest used to create the lockfile. This reads the lockfile's manifest.

◆ packagesRegistryRaw

RegistryRaw flox::resolver::Lockfile::packagesRegistryRaw
private

Maps { <FINGERPRINT>: <INPUT> } for all packages members' inputs.


The documentation for this class was generated from the following files: