19#include <unordered_map>
23#include <nlohmann/json.hpp>
35namespace flox::resolver {
41struct GlobalManifestRaw;
43struct GlobalManifestRawGA;
56 "invalid manifest file" )
66using InstallID = std::
string;
75 std::optional<std::vector<System>> systems;
79 std::optional<bool> unfree;
80 std::optional<bool> broken;
81 std::optional<std::vector<std::string>> licenses;
83 std::optional<Allows> allow;
87 std::optional<bool> preferPreReleases;
89 std::optional<Semver> semver;
91 std::optional<std::string> packageGroupingStrategy;
92 std::optional<std::string> activationStrategy;
100 merge(
const Options & overrides );
103 explicit operator pkgdb::PkgQueryArgs()
const;
147 std::optional<Options>
options = std::nullopt )
156 operator=(
const GlobalManifestRaw & )
159 operator=( GlobalManifestRaw && )
173 this->registry = std::nullopt;
174 this->options = std::nullopt;
177 explicit operator GlobalManifestRawGA()
const;
187from_json(
const nlohmann::json & jfrom, GlobalManifestRaw & manifest );
191to_json( nlohmann::json & jto,
const GlobalManifestRaw & manifest );
205 std::optional<std::string>
dir;
221 this->floxhub = std::nullopt;
222 this->dir = std::nullopt;
238 std::optional<std::string>
file;
266 std::optional<EnvBaseRaw> envBase;
269 std::unordered_map<InstallID, std::optional<ManifestDescriptorRaw>>>
272 std::optional<std::unordered_map<std::string, std::string>> vars;
274 std::optional<HookRaw> hook;
301 GlobalManifestRaw::operator=( globalManifestRaw );
308 GlobalManifestRaw::operator=( globalManifestRaw );
323 check()
const override;
332 this->envBase = std::nullopt;
333 this->install = std::nullopt;
334 this->vars = std::nullopt;
335 this->hook = std::nullopt;
412 this->options = std::nullopt;
415 explicit operator GlobalManifestRaw()
const
420 explicit operator ManifestRaw()
const
422 return ManifestRaw(
static_cast<GlobalManifestRaw
>( *
this ) );
433from_json(
const nlohmann::json & jfrom, GlobalManifestRawGA & manifest );
437to_json( nlohmann::json & jto,
const GlobalManifestRawGA & manifest );
456 std::unordered_map<InstallID, std::optional<ManifestDescriptorRaw>>>
459 std::optional<std::unordered_map<std::string, std::string>> vars;
461 std::optional<HookRaw> hook;
488 GlobalManifestRawGA::operator=( globalManifestRawGA );
495 GlobalManifestRawGA::operator=( globalManifestRawGA );
508 check()
const override;
514 this->options = std::nullopt;
516 this->install = std::nullopt;
517 this->vars = std::nullopt;
518 this->hook = std::nullopt;
534 raw.install = this->install;
535 raw.vars = this->vars;
536 raw.hook = this->hook;
561template<
typename RawType>
563 || std::derived_from<RawType, GlobalManifestRawGA>;
An exception thrown when a manifest file is invalid.
Restrict types to those derived from flox::resolver::GlobalManifestRaw or flox::resolver::GlobalManif...
Definition: manifest-raw.hh:562
Provides backports of some concepts features that are missing in Clang v11.
A set of user inputs used to set input preferences and query parameters during resolution.
Definitions of various std::exception children used for throwing errors with nice messages and typed ...
#define FLOX_DEFINE_EXCEPTION(NAME, ERROR_CODE, CATEGORY_MSG)
Generate a class definition with an error code and category message.
Definition: exceptions.hh:206
@ EC_INVALID_MANIFEST_FILE
Definition: exceptions.hh:45
RegistryRaw getGARegistry()
Get a hard coded registry for use with flox's GA release.
Definition: registry.cc:377
void from_json(const nlohmann::json &jfrom, RawPackage &pkg)
Convert a JSON object to a flox::RawPackage.
Definition: raw-package.cc:27
void to_json(nlohmann::json &jto, const FloxException &err)
Convert a flox::FloxException to a JSON object.
Definition: exceptions.cc:27
Interfaces for constructing complex ‘Packages’ queries.
A set of user inputs used to set input preferences during search and resolution.
Declares a base environment to extend.
Definition: manifest-raw.hh:198
void check() const
Validate the env-base field, throwing an exception if invalid information is found.
Definition: manifest-raw.cc:393
std::optional< std::string > dir
Definition: manifest-raw.hh:205
std::optional< std::string > floxhub
Definition: manifest-raw.hh:200
A global manifest containing only registry and options fields in its raw form. This form is limited t...
Definition: manifest-raw.hh:378
virtual void check() const
Validate manifest fields, throwing an exception if its contents are invalid.
Definition: manifest-raw.hh:406
std::optional< Options > options
Options controlling environment and search behaviors.
Definition: manifest-raw.hh:381
A global manifest containing only registry and options fields in its raw form.
Definition: manifest-raw.hh:133
virtual void check() const
Validate manifest fields, throwing an exception if its contents are invalid.
Definition: manifest-raw.hh:167
std::optional< Options > options
Options controlling environment and search behaviors.
Definition: manifest-raw.hh:138
std::optional< RegistryRaw > registry
Definition: manifest-raw.hh:135
Declares a hook to be run at environment activation.
Definition: manifest-raw.hh:233
void check() const
Validate Hook fields, throwing an exception if its contents are invalid.
Definition: manifest-raw.cc:529
std::optional< std::string > script
Definition: manifest-raw.hh:235
std::optional< std::string > file
Definition: manifest-raw.hh:238
A raw description of an environment to be read from a file. This form drops the registry field for us...
Definition: manifest-raw.hh:453
nlohmann::json diff(const ManifestRawGA &old) const
Generate a JSON diff between this manifest an old manifest.
Definition: manifest-raw.cc:796
void check() const override
Validate manifest fields, throwing an exception if its contents are invalid.
Definition: manifest-raw.cc:805
A raw description of an environment to be read from a file.
Definition: manifest-raw.hh:264
void check() const override
Validate manifest fields, throwing an exception if its contents are invalid.
Definition: manifest-raw.cc:672
nlohmann::json diff(const ManifestRaw &old) const
Generate a JSON diff between this manifest an old manifest.
Definition: manifest-raw.cc:702
Definition: manifest-raw.hh:78
Definition: manifest-raw.hh:86
A set of options that apply to an entire environment.
Definition: manifest-raw.hh:73
Miscellaneous typedefs and aliases.