Nix
2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Toggle main menu visibility
Loading...
Searching...
No Matches
built-path.hh
Go to the documentation of this file.
1
#pragma once
3
4
#include "
nix/store/derived-path.hh
"
5
#include "
nix/store/realisation.hh
"
6
7
namespace
nix {
8
9
struct
SingleBuiltPath
;
10
11
struct
SingleBuiltPathBuilt
12
{
13
ref<SingleBuiltPath>
drvPath;
14
std::pair<std::string, StorePath> output;
15
16
SingleDerivedPathBuilt
discardOutputPath()
const
;
17
18
std::string to_string(
const
StoreDirConfig
& store)
const
;
19
static
SingleBuiltPathBuilt
parse(
const
StoreDirConfig
& store, std::string_view, std::string_view);
20
nlohmann::json toJSON(
const
StoreDirConfig
& store)
const
;
21
22
bool
operator==(
const
SingleBuiltPathBuilt
&)
const
noexcept
;
23
std::strong_ordering operator<=>(
const
SingleBuiltPathBuilt
&)
const
noexcept
;
24
};
25
26
using
_SingleBuiltPathRaw = std::variant<DerivedPathOpaque, SingleBuiltPathBuilt>;
27
28
struct
SingleBuiltPath
: _SingleBuiltPathRaw
29
{
30
using
Raw = _SingleBuiltPathRaw;
31
using
Raw::Raw;
32
33
using
Opaque =
DerivedPathOpaque
;
34
using
Built =
SingleBuiltPathBuilt
;
35
36
bool
operator==(
const
SingleBuiltPath
&)
const
=
default
;
37
auto
operator<=>(
const
SingleBuiltPath
&)
const
=
default
;
38
39
inline
const
Raw & raw()
const
40
{
41
return
static_cast<
const
Raw &
>
(*this);
42
}
43
44
StorePath
outPath()
const
;
45
46
SingleDerivedPath
discardOutputPath()
const
;
47
48
static
SingleBuiltPath
parse(
const
StoreDirConfig
& store, std::string_view);
49
nlohmann::json toJSON(
const
StoreDirConfig
& store)
const
;
50
};
51
52
static
inline
ref<SingleBuiltPath>
staticDrv(
StorePath
drvPath)
53
{
54
return
make_ref<SingleBuiltPath>(SingleBuiltPath::Opaque{drvPath});
55
}
56
62
struct
BuiltPathBuilt
63
{
64
ref<SingleBuiltPath>
drvPath;
65
std::map<std::string, StorePath> outputs;
66
67
bool
operator==(
const
BuiltPathBuilt
&)
const
noexcept
;
68
// TODO libc++ 16 (used by darwin) missing `std::map::operator <=>`, can't do yet.
69
// std::strong_ordering operator <=> (const BuiltPathBuilt &) const noexcept;
70
71
std::string to_string(
const
StoreDirConfig
& store)
const
;
72
static
BuiltPathBuilt
parse(
const
StoreDirConfig
& store, std::string_view, std::string_view);
73
nlohmann::json toJSON(
const
StoreDirConfig
& store)
const
;
74
};
75
76
using
_BuiltPathRaw = std::variant<DerivedPath::Opaque, BuiltPathBuilt>;
77
82
struct
BuiltPath
: _BuiltPathRaw
83
{
84
using
Raw = _BuiltPathRaw;
85
using
Raw::Raw;
86
87
using
Opaque =
DerivedPathOpaque
;
88
using
Built =
BuiltPathBuilt
;
89
90
bool
operator==(
const
BuiltPath
&)
const
=
default
;
91
92
// TODO libc++ 16 (used by darwin) missing `std::map::operator <=>`, can't do yet.
93
// auto operator <=> (const BuiltPath &) const = default;
94
95
inline
const
Raw & raw()
const
96
{
97
return
static_cast<
const
Raw &
>
(*this);
98
}
99
100
StorePathSet outPaths()
const
;
101
RealisedPath::Set toRealisedPaths(
Store
& store)
const
;
102
103
nlohmann::json toJSON(
const
StoreDirConfig
& store)
const
;
104
};
105
106
typedef
std::vector<BuiltPath> BuiltPaths;
107
108
SingleBuiltPath
getBuiltPath(
ref<Store>
evalStore,
ref<Store>
store,
const
SingleDerivedPath
& b);
109
110
struct
KeyedBuildResult
;
111
112
BuiltPath
toBuiltPath(
KeyedBuildResult
& result,
ref<Store>
evalStore,
ref<Store>
store);
113
114
}
// namespace nix
nix::StorePath
Definition
path.hh:33
nix::Store
Definition
store-api.hh:397
nix::ref
Definition
ref.hh:58
derived-path.hh
realisation.hh
nix::BuiltPathBuilt
Definition
built-path.hh:63
nix::BuiltPath
Definition
built-path.hh:83
nix::DerivedPathOpaque
Definition
derived-path.hh:26
nix::KeyedBuildResult
Definition
build-result.hh:204
nix::SingleBuiltPathBuilt
Definition
built-path.hh:12
nix::SingleBuiltPath
Definition
built-path.hh:29
nix::SingleDerivedPathBuilt
Definition
derived-path.hh:46
nix::SingleDerivedPath
Definition
derived-path.hh:105
nix::StoreDirConfig
Definition
store-dir-config.hh:29
libcmd
include
nix
cmd
built-path.hh
Generated by
1.18.0