mirror of
https://github.com/NixOS/nix
synced 2025-06-24 22:11:15 +02:00
Merge pull request #13262 from xokdvium/typos
Fix various typos in source code
This commit is contained in:
commit
d929eed168
63 changed files with 104 additions and 104 deletions
|
@ -23,17 +23,17 @@ struct SourcePath;
|
||||||
namespace flake { struct Settings; }
|
namespace flake { struct Settings; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @todo Get rid of global setttings variables
|
* @todo Get rid of global settings variables
|
||||||
*/
|
*/
|
||||||
extern fetchers::Settings fetchSettings;
|
extern fetchers::Settings fetchSettings;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @todo Get rid of global setttings variables
|
* @todo Get rid of global settings variables
|
||||||
*/
|
*/
|
||||||
extern EvalSettings evalSettings;
|
extern EvalSettings evalSettings;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @todo Get rid of global setttings variables
|
* @todo Get rid of global settings variables
|
||||||
*/
|
*/
|
||||||
extern flake::Settings flakeSettings;
|
extern flake::Settings flakeSettings;
|
||||||
|
|
||||||
|
|
|
@ -294,7 +294,7 @@ StringSet NixRepl::completePrefix(const std::string & prefix)
|
||||||
} catch (BadURL & e) {
|
} catch (BadURL & e) {
|
||||||
// Quietly ignore BadURL flake-related errors.
|
// Quietly ignore BadURL flake-related errors.
|
||||||
} catch (FileNotFound & e) {
|
} catch (FileNotFound & e) {
|
||||||
// Quietly ignore non-existent file beeing `import`-ed.
|
// Quietly ignore non-existent file being `import`-ed.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -458,7 +458,7 @@ namespace nix {
|
||||||
HintFmt("expected a function but found %s: %s", "a list", Uncolored("[ ]")),
|
HintFmt("expected a function but found %s: %s", "a list", Uncolored("[ ]")),
|
||||||
HintFmt("while evaluating the first argument passed to builtins.filterSource"));
|
HintFmt("while evaluating the first argument passed to builtins.filterSource"));
|
||||||
|
|
||||||
// Usupported by store "dummy"
|
// Unsupported by store "dummy"
|
||||||
|
|
||||||
// ASSERT_TRACE2("filterSource (_: 1) ./.",
|
// ASSERT_TRACE2("filterSource (_: 1) ./.",
|
||||||
// TypeError,
|
// TypeError,
|
||||||
|
@ -636,7 +636,7 @@ namespace nix {
|
||||||
HintFmt("expected a set but found %s: %s", "a list", Uncolored("[ ]")),
|
HintFmt("expected a set but found %s: %s", "a list", Uncolored("[ ]")),
|
||||||
HintFmt("while evaluating the second argument passed to builtins.mapAttrs"));
|
HintFmt("while evaluating the second argument passed to builtins.mapAttrs"));
|
||||||
|
|
||||||
// XXX: defered
|
// XXX: deferred
|
||||||
// ASSERT_TRACE2("mapAttrs \"\" { foo.bar = 1; }",
|
// ASSERT_TRACE2("mapAttrs \"\" { foo.bar = 1; }",
|
||||||
// TypeError,
|
// TypeError,
|
||||||
// HintFmt("attempt to call something which is not a function but %s", "a string"),
|
// HintFmt("attempt to call something which is not a function but %s", "a string"),
|
||||||
|
@ -666,9 +666,9 @@ namespace nix {
|
||||||
HintFmt("expected a set but found %s: %s", "an integer", Uncolored(ANSI_CYAN "1" ANSI_NORMAL)),
|
HintFmt("expected a set but found %s: %s", "an integer", Uncolored(ANSI_CYAN "1" ANSI_NORMAL)),
|
||||||
HintFmt("while evaluating a value of the list passed as second argument to builtins.zipAttrsWith"));
|
HintFmt("while evaluating a value of the list passed as second argument to builtins.zipAttrsWith"));
|
||||||
|
|
||||||
// XXX: How to properly tell that the fucntion takes two arguments ?
|
// XXX: How to properly tell that the function takes two arguments ?
|
||||||
// The same question also applies to sort, and maybe others.
|
// The same question also applies to sort, and maybe others.
|
||||||
// Due to lazyness, we only create a thunk, and it fails later on.
|
// Due to laziness, we only create a thunk, and it fails later on.
|
||||||
// ASSERT_TRACE2("zipAttrsWith (_: 1) [ { foo = 1; } ]",
|
// ASSERT_TRACE2("zipAttrsWith (_: 1) [ { foo = 1; } ]",
|
||||||
// TypeError,
|
// TypeError,
|
||||||
// HintFmt("attempt to call something which is not a function but %s", "an integer"),
|
// HintFmt("attempt to call something which is not a function but %s", "an integer"),
|
||||||
|
@ -877,7 +877,7 @@ namespace nix {
|
||||||
HintFmt("expected a function but found %s: %s", "an integer", Uncolored(ANSI_CYAN "1" ANSI_NORMAL)),
|
HintFmt("expected a function but found %s: %s", "an integer", Uncolored(ANSI_CYAN "1" ANSI_NORMAL)),
|
||||||
HintFmt("while evaluating the first argument passed to builtins.genList"));
|
HintFmt("while evaluating the first argument passed to builtins.genList"));
|
||||||
|
|
||||||
// XXX: defered
|
// XXX: deferred
|
||||||
// ASSERT_TRACE2("genList (x: x + \"foo\") 2 #TODO",
|
// ASSERT_TRACE2("genList (x: x + \"foo\") 2 #TODO",
|
||||||
// TypeError,
|
// TypeError,
|
||||||
// HintFmt("cannot add %s to an integer", "a string"),
|
// HintFmt("cannot add %s to an integer", "a string"),
|
||||||
|
|
|
@ -143,7 +143,7 @@ namespace nix {
|
||||||
// Usually Nix rejects duplicate keys in an attrset but it does allow
|
// Usually Nix rejects duplicate keys in an attrset but it does allow
|
||||||
// so if it is an attribute set that contains disjoint sets of keys.
|
// so if it is an attribute set that contains disjoint sets of keys.
|
||||||
// The below is equivalent to `{a.b = 1; a.c = 2; }`.
|
// The below is equivalent to `{a.b = 1; a.c = 2; }`.
|
||||||
// The attribute set `a` will be a Thunk at first as the attribuets
|
// The attribute set `a` will be a Thunk at first as the attributes
|
||||||
// have to be merged (or otherwise computed) and that is done in a lazy
|
// have to be merged (or otherwise computed) and that is done in a lazy
|
||||||
// manner.
|
// manner.
|
||||||
|
|
||||||
|
|
|
@ -657,7 +657,7 @@ std::optional<EvalState::Doc> EvalState::getDoc(Value & v)
|
||||||
Value & functor = *v.attrs()->find(sFunctor)->value;
|
Value & functor = *v.attrs()->find(sFunctor)->value;
|
||||||
Value * vp[] = {&v};
|
Value * vp[] = {&v};
|
||||||
Value partiallyApplied;
|
Value partiallyApplied;
|
||||||
// The first paramater is not user-provided, and may be
|
// The first parameter is not user-provided, and may be
|
||||||
// handled by code that is opaque to the user, like lib.const = x: y: y;
|
// handled by code that is opaque to the user, like lib.const = x: y: y;
|
||||||
// So preferably we show docs that are relevant to the
|
// So preferably we show docs that are relevant to the
|
||||||
// "partially applied" function returned by e.g. `const`.
|
// "partially applied" function returned by e.g. `const`.
|
||||||
|
@ -2495,7 +2495,7 @@ SourcePath EvalState::coerceToPath(const PosIdx pos, Value & v, NixStringContext
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Any other value should be coercable to a string, interpreted
|
/* Any other value should be coercible to a string, interpreted
|
||||||
relative to the root filesystem. */
|
relative to the root filesystem. */
|
||||||
auto path = coerceToString(pos, v, context, errorCtx, false, false, true).toOwned();
|
auto path = coerceToString(pos, v, context, errorCtx, false, false, true).toOwned();
|
||||||
if (path == "" || path[0] != '/')
|
if (path == "" || path[0] != '/')
|
||||||
|
@ -2866,7 +2866,7 @@ bool EvalState::fullGC() {
|
||||||
GC_gcollect();
|
GC_gcollect();
|
||||||
// Check that it ran. We might replace this with a version that uses more
|
// Check that it ran. We might replace this with a version that uses more
|
||||||
// of the boehm API to get this reliably, at a maintenance cost.
|
// of the boehm API to get this reliably, at a maintenance cost.
|
||||||
// We use a 1K margin because technically this has a race condtion, but we
|
// We use a 1K margin because technically this has a race condition, but we
|
||||||
// probably won't encounter it in practice, because the CLI isn't concurrent
|
// probably won't encounter it in practice, because the CLI isn't concurrent
|
||||||
// like that.
|
// like that.
|
||||||
return GC_get_bytes_since_gc() < 1024;
|
return GC_get_bytes_since_gc() < 1024;
|
||||||
|
|
|
@ -13,7 +13,7 @@ struct PrimOp;
|
||||||
struct EvalSettings : Config
|
struct EvalSettings : Config
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Function used to interpet look path entries of a given scheme.
|
* Function used to interpret look path entries of a given scheme.
|
||||||
*
|
*
|
||||||
* The argument is the non-scheme part of the lookup path entry (see
|
* The argument is the non-scheme part of the lookup path entry (see
|
||||||
* `LookupPathHooks` below).
|
* `LookupPathHooks` below).
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
|
|
||||||
// inluding the generated headers twice leads to errors
|
// including the generated headers twice leads to errors
|
||||||
#ifndef BISON_HEADER
|
#ifndef BISON_HEADER
|
||||||
# include "lexer-tab.hh"
|
# include "lexer-tab.hh"
|
||||||
# include "parser-tab.hh"
|
# include "parser-tab.hh"
|
||||||
|
|
|
@ -890,7 +890,7 @@ static void prim_ceil(EvalState & state, const PosIdx pos, Value * * args, Value
|
||||||
auto arg = args[0]->integer();
|
auto arg = args[0]->integer();
|
||||||
auto res = v.integer();
|
auto res = v.integer();
|
||||||
if (arg != res) {
|
if (arg != res) {
|
||||||
state.error<EvalError>("Due to a bug (see https://github.com/NixOS/nix/issues/12899) a loss of precision occured in previous Nix versions because the NixInt argument %1% was rounded to %2%.\n\tFuture Nix versions might implement the correct behavior.", arg, res).atPos(pos).debugThrow();
|
state.error<EvalError>("Due to a bug (see https://github.com/NixOS/nix/issues/12899) a loss of precision occurred in previous Nix versions because the NixInt argument %1% was rounded to %2%.\n\tFuture Nix versions might implement the correct behavior.", arg, res).atPos(pos).debugThrow();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -931,7 +931,7 @@ static void prim_floor(EvalState & state, const PosIdx pos, Value * * args, Valu
|
||||||
auto arg = args[0]->integer();
|
auto arg = args[0]->integer();
|
||||||
auto res = v.integer();
|
auto res = v.integer();
|
||||||
if (arg != res) {
|
if (arg != res) {
|
||||||
state.error<EvalError>("Due to a bug (see https://github.com/NixOS/nix/issues/12899) a loss of precision occured in previous Nix versions because the NixInt argument %1% was rounded to %2%.\n\tFuture Nix versions might implement the correct behavior.", arg, res).atPos(pos).debugThrow();
|
state.error<EvalError>("Due to a bug (see https://github.com/NixOS/nix/issues/12899) a loss of precision occurred in previous Nix versions because the NixInt argument %1% was rounded to %2%.\n\tFuture Nix versions might implement the correct behavior.", arg, res).atPos(pos).debugThrow();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -965,7 +965,7 @@ static void prim_tryEval(EvalState & state, const PosIdx pos, Value * * args, Va
|
||||||
ReplExitStatus (* savedDebugRepl)(ref<EvalState> es, const ValMap & extraEnv) = nullptr;
|
ReplExitStatus (* savedDebugRepl)(ref<EvalState> es, const ValMap & extraEnv) = nullptr;
|
||||||
if (state.debugRepl && state.settings.ignoreExceptionsDuringTry)
|
if (state.debugRepl && state.settings.ignoreExceptionsDuringTry)
|
||||||
{
|
{
|
||||||
/* to prevent starting the repl from exceptions withing a tryEval, null it. */
|
/* to prevent starting the repl from exceptions within a tryEval, null it. */
|
||||||
savedDebugRepl = state.debugRepl;
|
savedDebugRepl = state.debugRepl;
|
||||||
state.debugRepl = nullptr;
|
state.debugRepl = nullptr;
|
||||||
}
|
}
|
||||||
|
@ -2172,7 +2172,7 @@ static RegisterPrimOp primop_outputOf({
|
||||||
[input placeholder string](@docroot@/store/derivation/index.md#input-placeholder)
|
[input placeholder string](@docroot@/store/derivation/index.md#input-placeholder)
|
||||||
if needed.
|
if needed.
|
||||||
|
|
||||||
If the derivation has a statically-known output path (i.e. the derivation output is input-addressed, or fixed content-addresed), the output path will just be returned.
|
If the derivation has a statically-known output path (i.e. the derivation output is input-addressed, or fixed content-addressed), the output path will just be returned.
|
||||||
But if the derivation is content-addressed or if the derivation is itself not-statically produced (i.e. is the output of another derivation), an input placeholder will be returned instead.
|
But if the derivation is content-addressed or if the derivation is itself not-statically produced (i.e. is the output of another derivation), an input placeholder will be returned instead.
|
||||||
|
|
||||||
*`derivation reference`* must be a string that may contain a regular store path to a derivation, or may be an input placeholder reference.
|
*`derivation reference`* must be a string that may contain a regular store path to a derivation, or may be an input placeholder reference.
|
||||||
|
@ -2815,7 +2815,7 @@ static RegisterPrimOp primop_unsafeGetAttrPos(PrimOp {
|
||||||
.fun = prim_unsafeGetAttrPos,
|
.fun = prim_unsafeGetAttrPos,
|
||||||
});
|
});
|
||||||
|
|
||||||
// access to exact position information (ie, line and colum numbers) is deferred
|
// access to exact position information (ie, line and column numbers) is deferred
|
||||||
// due to the cost associated with calculating that information and how rarely
|
// due to the cost associated with calculating that information and how rarely
|
||||||
// it is used in practice. this is achieved by creating thunks to otherwise
|
// it is used in practice. this is achieved by creating thunks to otherwise
|
||||||
// inaccessible primops that are not exposed as __op or under builtins to turn
|
// inaccessible primops that are not exposed as __op or under builtins to turn
|
||||||
|
@ -2827,7 +2827,7 @@ static RegisterPrimOp primop_unsafeGetAttrPos(PrimOp {
|
||||||
// but each type of thunk has an associated runtime cost in the current evaluator.
|
// but each type of thunk has an associated runtime cost in the current evaluator.
|
||||||
// as with black holes this cost is too high to justify another thunk type to check
|
// as with black holes this cost is too high to justify another thunk type to check
|
||||||
// for in the very hot path that is forceValue.
|
// for in the very hot path that is forceValue.
|
||||||
static struct LazyPosAcessors {
|
static struct LazyPosAccessors {
|
||||||
PrimOp primop_lineOfPos{
|
PrimOp primop_lineOfPos{
|
||||||
.arity = 1,
|
.arity = 1,
|
||||||
.fun = [] (EvalState & state, PosIdx pos, Value * * args, Value & v) {
|
.fun = [] (EvalState & state, PosIdx pos, Value * * args, Value & v) {
|
||||||
|
@ -2843,7 +2843,7 @@ static struct LazyPosAcessors {
|
||||||
|
|
||||||
Value lineOfPos, columnOfPos;
|
Value lineOfPos, columnOfPos;
|
||||||
|
|
||||||
LazyPosAcessors()
|
LazyPosAccessors()
|
||||||
{
|
{
|
||||||
lineOfPos.mkPrimOp(&primop_lineOfPos);
|
lineOfPos.mkPrimOp(&primop_lineOfPos);
|
||||||
columnOfPos.mkPrimOp(&primop_columnOfPos);
|
columnOfPos.mkPrimOp(&primop_columnOfPos);
|
||||||
|
@ -3623,7 +3623,7 @@ static void prim_genList(EvalState & state, const PosIdx pos, Value * * args, Va
|
||||||
|
|
||||||
size_t len = size_t(len_);
|
size_t len = size_t(len_);
|
||||||
|
|
||||||
// More strict than striclty (!) necessary, but acceptable
|
// More strict than strictly (!) necessary, but acceptable
|
||||||
// as evaluating map without accessing any values makes little sense.
|
// as evaluating map without accessing any values makes little sense.
|
||||||
state.forceFunction(*args[0], noPos, "while evaluating the first argument passed to builtins.genList");
|
state.forceFunction(*args[0], noPos, "while evaluating the first argument passed to builtins.genList");
|
||||||
|
|
||||||
|
@ -4126,7 +4126,7 @@ static void prim_substring(EvalState & state, const PosIdx pos, Value * * args,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Special-case on empty substring to avoid O(n) strlen
|
// Special-case on empty substring to avoid O(n) strlen
|
||||||
// This allows for the use of empty substrings to efficently capture string context
|
// This allows for the use of empty substrings to efficiently capture string context
|
||||||
if (len == 0) {
|
if (len == 0) {
|
||||||
state.forceValue(*args[2], pos);
|
state.forceValue(*args[2], pos);
|
||||||
if (args[2]->type() == nString) {
|
if (args[2]->type() == nString) {
|
||||||
|
@ -4442,7 +4442,7 @@ void prim_split(EvalState & state, const PosIdx pos, Value * * args, Value & v)
|
||||||
// Add a list for matched substrings.
|
// Add a list for matched substrings.
|
||||||
const size_t slen = match.size() - 1;
|
const size_t slen = match.size() - 1;
|
||||||
|
|
||||||
// Start at 1, beacause the first match is the whole string.
|
// Start at 1, because the first match is the whole string.
|
||||||
auto list2 = state.buildList(slen);
|
auto list2 = state.buildList(slen);
|
||||||
for (const auto & [si, v2] : enumerate(list2)) {
|
for (const auto & [si, v2] : enumerate(list2)) {
|
||||||
if (!match[si + 1].matched)
|
if (!match[si + 1].matched)
|
||||||
|
|
|
@ -305,7 +305,7 @@ static RegisterPrimOp primop_fetchTree({
|
||||||
- `"tarball"`
|
- `"tarball"`
|
||||||
|
|
||||||
Download a tar archive and extract it into the Nix store.
|
Download a tar archive and extract it into the Nix store.
|
||||||
This has the same underyling implementation as [`builtins.fetchTarball`](@docroot@/language/builtins.md#builtins-fetchTarball)
|
This has the same underlying implementation as [`builtins.fetchTarball`](@docroot@/language/builtins.md#builtins-fetchTarball)
|
||||||
|
|
||||||
- `url` (String, required)
|
- `url` (String, required)
|
||||||
|
|
||||||
|
|
|
@ -587,7 +587,7 @@ struct GitRepoImpl : GitRepo, std::enable_shared_from_this<GitRepoImpl>
|
||||||
});
|
});
|
||||||
|
|
||||||
/* Evaluate result through status code and checking if public
|
/* Evaluate result through status code and checking if public
|
||||||
key fingerprints appear on stderr. This is neccessary
|
key fingerprints appear on stderr. This is necessary
|
||||||
because the git command might also succeed due to the
|
because the git command might also succeed due to the
|
||||||
commit being signed by gpg keys that are present in the
|
commit being signed by gpg keys that are present in the
|
||||||
users key agent. */
|
users key agent. */
|
||||||
|
|
|
@ -175,7 +175,7 @@ struct GitArchiveInputScheme : InputScheme
|
||||||
return input;
|
return input;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Search for the longest possible match starting from the begining and ending at either the end or a path segment.
|
// Search for the longest possible match starting from the beginning and ending at either the end or a path segment.
|
||||||
std::optional<std::string> getAccessToken(const fetchers::Settings & settings, const std::string & host, const std::string & url) const override
|
std::optional<std::string> getAccessToken(const fetchers::Settings & settings, const std::string & host, const std::string & url) const override
|
||||||
{
|
{
|
||||||
auto tokens = settings.accessTokens.get();
|
auto tokens = settings.accessTokens.get();
|
||||||
|
|
|
@ -27,7 +27,7 @@ extern "C" {
|
||||||
typedef struct nix_flake_settings nix_flake_settings;
|
typedef struct nix_flake_settings nix_flake_settings;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Context and paramaters for parsing a flake reference
|
* @brief Context and parameters for parsing a flake reference
|
||||||
* @see nix_flake_reference_parse_flags_free
|
* @see nix_flake_reference_parse_flags_free
|
||||||
* @see nix_flake_reference_parse_string
|
* @see nix_flake_reference_parse_string
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -531,7 +531,7 @@ LockedFlake lockFlake(
|
||||||
|
|
||||||
/* Resolve relative 'path:' inputs relative to
|
/* Resolve relative 'path:' inputs relative to
|
||||||
the source path of the overrider. */
|
the source path of the overrider. */
|
||||||
auto overridenSourcePath = hasOverride ? i->second.sourcePath : sourcePath;
|
auto overriddenSourcePath = hasOverride ? i->second.sourcePath : sourcePath;
|
||||||
|
|
||||||
/* Respect the "flakeness" of the input even if we
|
/* Respect the "flakeness" of the input even if we
|
||||||
override it. */
|
override it. */
|
||||||
|
@ -552,7 +552,7 @@ LockedFlake lockFlake(
|
||||||
|
|
||||||
assert(input.ref);
|
assert(input.ref);
|
||||||
|
|
||||||
auto overridenParentPath =
|
auto overriddenParentPath =
|
||||||
input.ref->input.isRelative()
|
input.ref->input.isRelative()
|
||||||
? std::optional<InputAttrPath>(hasOverride ? i->second.parentInputAttrPath : inputAttrPathPrefix)
|
? std::optional<InputAttrPath>(hasOverride ? i->second.parentInputAttrPath : inputAttrPathPrefix)
|
||||||
: std::nullopt;
|
: std::nullopt;
|
||||||
|
@ -561,8 +561,8 @@ LockedFlake lockFlake(
|
||||||
{
|
{
|
||||||
if (auto relativePath = input.ref->input.isRelative()) {
|
if (auto relativePath = input.ref->input.isRelative()) {
|
||||||
return SourcePath {
|
return SourcePath {
|
||||||
overridenSourcePath.accessor,
|
overriddenSourcePath.accessor,
|
||||||
CanonPath(*relativePath, overridenSourcePath.path.parent().value())
|
CanonPath(*relativePath, overriddenSourcePath.path.parent().value())
|
||||||
};
|
};
|
||||||
} else
|
} else
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
|
@ -596,7 +596,7 @@ LockedFlake lockFlake(
|
||||||
|
|
||||||
if (oldLock
|
if (oldLock
|
||||||
&& oldLock->originalRef.canonicalize() == input.ref->canonicalize()
|
&& oldLock->originalRef.canonicalize() == input.ref->canonicalize()
|
||||||
&& oldLock->parentInputAttrPath == overridenParentPath
|
&& oldLock->parentInputAttrPath == overriddenParentPath
|
||||||
&& !hasCliOverride)
|
&& !hasCliOverride)
|
||||||
{
|
{
|
||||||
debug("keeping existing input '%s'", inputAttrPathS);
|
debug("keeping existing input '%s'", inputAttrPathS);
|
||||||
|
@ -694,7 +694,7 @@ LockedFlake lockFlake(
|
||||||
inputFlake.lockedRef,
|
inputFlake.lockedRef,
|
||||||
ref,
|
ref,
|
||||||
true,
|
true,
|
||||||
overridenParentPath);
|
overriddenParentPath);
|
||||||
|
|
||||||
node->inputs.insert_or_assign(id, childNode);
|
node->inputs.insert_or_assign(id, childNode);
|
||||||
|
|
||||||
|
@ -741,7 +741,7 @@ LockedFlake lockFlake(
|
||||||
}
|
}
|
||||||
}();
|
}();
|
||||||
|
|
||||||
auto childNode = make_ref<LockedNode>(lockedRef, ref, false, overridenParentPath);
|
auto childNode = make_ref<LockedNode>(lockedRef, ref, false, overriddenParentPath);
|
||||||
|
|
||||||
nodePaths.emplace(childNode, path);
|
nodePaths.emplace(childNode, path);
|
||||||
|
|
||||||
|
|
|
@ -129,7 +129,7 @@ struct LockedFlake
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Source tree accessors for nodes that have been fetched in
|
* Source tree accessors for nodes that have been fetched in
|
||||||
* lockFlake(); in particular, the root node and the overriden
|
* lockFlake(); in particular, the root node and the overridden
|
||||||
* inputs.
|
* inputs.
|
||||||
*/
|
*/
|
||||||
std::map<ref<Node>, SourcePath> nodePaths;
|
std::map<ref<Node>, SourcePath> nodePaths;
|
||||||
|
|
|
@ -259,7 +259,7 @@ public:
|
||||||
update(*state);
|
update(*state);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check whether an activity has an ancestore with the specified
|
/* Check whether an activity has an ancestor with the specified
|
||||||
type. */
|
type. */
|
||||||
bool hasAncestor(State & state, ActivityType type, ActivityId act)
|
bool hasAncestor(State & state, ActivityType type, ActivityId act)
|
||||||
{
|
{
|
||||||
|
@ -382,7 +382,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* Redraw, if the output has changed.
|
* Redraw, if the output has changed.
|
||||||
*
|
*
|
||||||
* Excessive redrawing is noticable on slow terminals, and it interferes
|
* Excessive redrawing is noticeable on slow terminals, and it interferes
|
||||||
* with text selection in some terminals, including libvte-based terminal
|
* with text selection in some terminals, including libvte-based terminal
|
||||||
* emulators.
|
* emulators.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -87,7 +87,7 @@ TEST(machines, getMachinesWithCommentsAndSemicolonSeparator) {
|
||||||
|
|
||||||
TEST(machines, getMachinesWithFunnyWhitespace) {
|
TEST(machines, getMachinesWithFunnyWhitespace) {
|
||||||
auto actual = Machine::parseConfig({},
|
auto actual = Machine::parseConfig({},
|
||||||
" # commment ; comment\n"
|
" # comment ; comment\n"
|
||||||
" nix@scratchy.labs.cs.uu.nl ; nix@itchy.labs.cs.uu.nl \n"
|
" nix@scratchy.labs.cs.uu.nl ; nix@itchy.labs.cs.uu.nl \n"
|
||||||
"\n \n"
|
"\n \n"
|
||||||
"\n ;;; \n"
|
"\n ;;; \n"
|
||||||
|
|
|
@ -46,7 +46,7 @@ TEST(OutputsSpec, names_underscore) {
|
||||||
ASSERT_EQ(expected.to_string(), str);
|
ASSERT_EQ(expected.to_string(), str);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(OutputsSpec, names_numberic) {
|
TEST(OutputsSpec, names_numeric) {
|
||||||
std::string_view str = "01";
|
std::string_view str = "01";
|
||||||
OutputsSpec expected = OutputsSpec::Names { "01" };
|
OutputsSpec expected = OutputsSpec::Names { "01" };
|
||||||
ASSERT_EQ(OutputsSpec::parse(str), expected);
|
ASSERT_EQ(OutputsSpec::parse(str), expected);
|
||||||
|
@ -126,7 +126,7 @@ TEST_DONT_PARSE(star_second, "^foo,*")
|
||||||
|
|
||||||
#undef TEST_DONT_PARSE
|
#undef TEST_DONT_PARSE
|
||||||
|
|
||||||
TEST(ExtendedOutputsSpec, defeault) {
|
TEST(ExtendedOutputsSpec, default) {
|
||||||
std::string_view str = "foo";
|
std::string_view str = "foo";
|
||||||
auto [prefix, extendedOutputsSpec] = ExtendedOutputsSpec::parse(str);
|
auto [prefix, extendedOutputsSpec] = ExtendedOutputsSpec::parse(str);
|
||||||
ASSERT_EQ(prefix, "foo");
|
ASSERT_EQ(prefix, "foo");
|
||||||
|
|
|
@ -329,7 +329,7 @@ Goal::Co DerivationBuildingGoal::gaveUpOnSubstitution()
|
||||||
auto take1 = get(resolvedResult.builtOutputs, outputName);
|
auto take1 = get(resolvedResult.builtOutputs, outputName);
|
||||||
if (take1) return *take1;
|
if (take1) return *take1;
|
||||||
|
|
||||||
/* The above `get` should work. But sateful tracking of
|
/* The above `get` should work. But stateful tracking of
|
||||||
outputs in resolvedResult, this can get out of sync with the
|
outputs in resolvedResult, this can get out of sync with the
|
||||||
store, which is our actual source of truth. For now we just
|
store, which is our actual source of truth. For now we just
|
||||||
check the store directly if it fails. */
|
check the store directly if it fails. */
|
||||||
|
@ -1150,7 +1150,7 @@ std::pair<bool, SingleDrvOutputs> DerivationBuildingGoal::checkPathValidity()
|
||||||
for (auto & i : queryPartialDerivationOutputMap()) {
|
for (auto & i : queryPartialDerivationOutputMap()) {
|
||||||
auto initialOutput = get(initialOutputs, i.first);
|
auto initialOutput = get(initialOutputs, i.first);
|
||||||
if (!initialOutput)
|
if (!initialOutput)
|
||||||
// this is an invalid output, gets catched with (!wantedOutputsLeft.empty())
|
// this is an invalid output, gets caught with (!wantedOutputsLeft.empty())
|
||||||
continue;
|
continue;
|
||||||
auto & info = *initialOutput;
|
auto & info = *initialOutput;
|
||||||
info.wanted = true;
|
info.wanted = true;
|
||||||
|
|
|
@ -86,7 +86,7 @@ void DerivationGoal::addWantedOutputs(const OutputsSpec & outputs)
|
||||||
{
|
{
|
||||||
auto newWanted = wantedOutputs.union_(outputs);
|
auto newWanted = wantedOutputs.union_(outputs);
|
||||||
switch (needRestart) {
|
switch (needRestart) {
|
||||||
case NeedRestartForMoreOutputs::OutputsUnmodifedDontNeed:
|
case NeedRestartForMoreOutputs::OutputsUnmodifiedDontNeed:
|
||||||
if (!newWanted.isSubsetOf(wantedOutputs))
|
if (!newWanted.isSubsetOf(wantedOutputs))
|
||||||
needRestart = NeedRestartForMoreOutputs::OutputsAddedDoNeed;
|
needRestart = NeedRestartForMoreOutputs::OutputsAddedDoNeed;
|
||||||
break;
|
break;
|
||||||
|
@ -303,7 +303,7 @@ Goal::Co DerivationGoal::haveDerivation(StorePath drvPath)
|
||||||
nrFailed = nrNoSubstituters = 0;
|
nrFailed = nrNoSubstituters = 0;
|
||||||
|
|
||||||
if (needRestart == NeedRestartForMoreOutputs::OutputsAddedDoNeed) {
|
if (needRestart == NeedRestartForMoreOutputs::OutputsAddedDoNeed) {
|
||||||
needRestart = NeedRestartForMoreOutputs::OutputsUnmodifedDontNeed;
|
needRestart = NeedRestartForMoreOutputs::OutputsUnmodifiedDontNeed;
|
||||||
co_return haveDerivation(std::move(drvPath));
|
co_return haveDerivation(std::move(drvPath));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -458,7 +458,7 @@ std::pair<bool, SingleDrvOutputs> DerivationGoal::checkPathValidity(const StoreP
|
||||||
for (auto & i : queryPartialDerivationOutputMap(drvPath)) {
|
for (auto & i : queryPartialDerivationOutputMap(drvPath)) {
|
||||||
auto initialOutput = get(initialOutputs, i.first);
|
auto initialOutput = get(initialOutputs, i.first);
|
||||||
if (!initialOutput)
|
if (!initialOutput)
|
||||||
// this is an invalid output, gets catched with (!wantedOutputsLeft.empty())
|
// this is an invalid output, gets caught with (!wantedOutputsLeft.empty())
|
||||||
continue;
|
continue;
|
||||||
auto & info = *initialOutput;
|
auto & info = *initialOutput;
|
||||||
info.wanted = wantedOutputs.contains(i.first);
|
info.wanted = wantedOutputs.contains(i.first);
|
||||||
|
|
|
@ -412,7 +412,7 @@ Derivation parseDerivation(
|
||||||
expect(str, "rvWithVersion(");
|
expect(str, "rvWithVersion(");
|
||||||
auto versionS = parseString(str);
|
auto versionS = parseString(str);
|
||||||
if (*versionS == "xp-dyn-drv") {
|
if (*versionS == "xp-dyn-drv") {
|
||||||
// Only verison we have so far
|
// Only version we have so far
|
||||||
version = DerivationATermVersion::DynamicDerivations;
|
version = DerivationATermVersion::DynamicDerivations;
|
||||||
xpSettings.require(Xp::DynamicDerivations);
|
xpSettings.require(Xp::DynamicDerivations);
|
||||||
} else {
|
} else {
|
||||||
|
@ -553,7 +553,7 @@ static void unparseDerivedPathMapNode(const StoreDirConfig & store, std::string
|
||||||
* derivation?
|
* derivation?
|
||||||
*
|
*
|
||||||
* In other words, does it on the output of derivation that is itself an
|
* In other words, does it on the output of derivation that is itself an
|
||||||
* ouput of a derivation? This corresponds to a dependency that is an
|
* output of a derivation? This corresponds to a dependency that is an
|
||||||
* inductive derived path with more than one layer of
|
* inductive derived path with more than one layer of
|
||||||
* `DerivedPath::Built`.
|
* `DerivedPath::Built`.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -775,7 +775,7 @@ void LocalStore::collectGarbage(const GCOptions & options, GCResults & results)
|
||||||
deleteFromStore(path.to_string());
|
deleteFromStore(path.to_string());
|
||||||
referrersCache.erase(path);
|
referrersCache.erase(path);
|
||||||
} catch (PathInUse &e) {
|
} catch (PathInUse &e) {
|
||||||
// If we end up here, it's likely a new occurence
|
// If we end up here, it's likely a new occurrence
|
||||||
// of https://github.com/NixOS/nix/issues/11923
|
// of https://github.com/NixOS/nix/issues/11923
|
||||||
printError("BUG: %s", e.what());
|
printError("BUG: %s", e.what());
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ struct BuildResult
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @note This is directly used in the nix-store --serve protocol.
|
* @note This is directly used in the nix-store --serve protocol.
|
||||||
* That means we need to worry about compatability across versions.
|
* That means we need to worry about compatibility across versions.
|
||||||
* Therefore, don't remove status codes, and only add new status
|
* Therefore, don't remove status codes, and only add new status
|
||||||
* codes at the end of the list.
|
* codes at the end of the list.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
/**
|
/**
|
||||||
* @file Misc type defitions for both local building and remote (RPC building)
|
* @file Misc type definitions for both local building and remote (RPC building)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "nix/util/hash.hh"
|
#include "nix/util/hash.hh"
|
||||||
|
|
|
@ -42,7 +42,7 @@ struct DerivationGoal : public Goal
|
||||||
* The goal state machine is progressing based on the current value of
|
* The goal state machine is progressing based on the current value of
|
||||||
* `wantedOutputs. No actions are needed.
|
* `wantedOutputs. No actions are needed.
|
||||||
*/
|
*/
|
||||||
OutputsUnmodifedDontNeed,
|
OutputsUnmodifiedDontNeed,
|
||||||
/**
|
/**
|
||||||
* `wantedOutputs` has been extended, but the state machine is
|
* `wantedOutputs` has been extended, but the state machine is
|
||||||
* proceeding according to its old value, so we need to restart.
|
* proceeding according to its old value, so we need to restart.
|
||||||
|
@ -59,7 +59,7 @@ struct DerivationGoal : public Goal
|
||||||
/**
|
/**
|
||||||
* Whether additional wanted outputs have been added.
|
* Whether additional wanted outputs have been added.
|
||||||
*/
|
*/
|
||||||
NeedRestartForMoreOutputs needRestart = NeedRestartForMoreOutputs::OutputsUnmodifedDontNeed;
|
NeedRestartForMoreOutputs needRestart = NeedRestartForMoreOutputs::OutputsUnmodifiedDontNeed;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The derivation stored at `drvReq`.
|
* The derivation stored at `drvReq`.
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* Template implementations (as opposed to mere declarations).
|
* Template implementations (as opposed to mere declarations).
|
||||||
*
|
*
|
||||||
* This file is an exmample of the "impl.hh" pattern. See the
|
* This file is an example of the "impl.hh" pattern. See the
|
||||||
* contributing guide.
|
* contributing guide.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -89,12 +89,12 @@ DECLARE_COMMON_SERIALISER(std::map<K COMMA_ V>);
|
||||||
* that the underlying types never serialize to the empty string.
|
* that the underlying types never serialize to the empty string.
|
||||||
*
|
*
|
||||||
* We do this instead of a generic std::optional<T> instance because
|
* We do this instead of a generic std::optional<T> instance because
|
||||||
* ordinal tags (0 or 1, here) are a bit of a compatability hazard. For
|
* ordinal tags (0 or 1, here) are a bit of a compatibility hazard. For
|
||||||
* the same reason, we don't have a std::variant<T..> instances (ordinal
|
* the same reason, we don't have a std::variant<T..> instances (ordinal
|
||||||
* tags 0...n).
|
* tags 0...n).
|
||||||
*
|
*
|
||||||
* We could the generic instances and then these as specializations for
|
* We could the generic instances and then these as specializations for
|
||||||
* compatability, but that's proven a bit finnicky, and also makes the
|
* compatibility, but that's proven a bit finnicky, and also makes the
|
||||||
* worker protocol harder to implement in other languages where such
|
* worker protocol harder to implement in other languages where such
|
||||||
* specializations may not be allowed.
|
* specializations may not be allowed.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -170,7 +170,7 @@ struct DerivationOptions
|
||||||
/**
|
/**
|
||||||
* Parse this information from its legacy encoding as part of the
|
* Parse this information from its legacy encoding as part of the
|
||||||
* environment. This should not be used with nice greenfield formats
|
* environment. This should not be used with nice greenfield formats
|
||||||
* (e.g. JSON) but is necessary for supporing old formats (e.g.
|
* (e.g. JSON) but is necessary for supporting old formats (e.g.
|
||||||
* ATerm).
|
* ATerm).
|
||||||
*/
|
*/
|
||||||
static DerivationOptions
|
static DerivationOptions
|
||||||
|
|
|
@ -214,7 +214,7 @@ struct DerivationType {
|
||||||
/**
|
/**
|
||||||
* Impure derivation type
|
* Impure derivation type
|
||||||
*
|
*
|
||||||
* This is similar at buil-time to the content addressed, not standboxed, not fixed
|
* This is similar at build-time to the content addressed, not standboxed, not fixed
|
||||||
* type, but has some restrictions on its usage.
|
* type, but has some restrictions on its usage.
|
||||||
*/
|
*/
|
||||||
struct Impure {
|
struct Impure {
|
||||||
|
|
|
@ -89,7 +89,7 @@ struct GCResults
|
||||||
* Some views have only a no-op temp roots even though others to the
|
* Some views have only a no-op temp roots even though others to the
|
||||||
* same store allow triggering GC. For instance one can't add a root
|
* same store allow triggering GC. For instance one can't add a root
|
||||||
* over ssh, but that doesn't prevent someone from gc-ing that store
|
* over ssh, but that doesn't prevent someone from gc-ing that store
|
||||||
* accesed via SSH locally).
|
* accessed via SSH locally).
|
||||||
*
|
*
|
||||||
* - The derived `LocalFSStore` class has `LocalFSStore::addPermRoot`,
|
* - The derived `LocalFSStore` class has `LocalFSStore::addPermRoot`,
|
||||||
* which is not part of this class because it relies on the notion of
|
* which is not part of this class because it relies on the notion of
|
||||||
|
|
|
@ -13,13 +13,13 @@ namespace nix {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An (owned) output name. Just a type alias used to make code more
|
* An (owned) output name. Just a type alias used to make code more
|
||||||
* readible.
|
* readable.
|
||||||
*/
|
*/
|
||||||
typedef std::string OutputName;
|
typedef std::string OutputName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A borrowed output name. Just a type alias used to make code more
|
* A borrowed output name. Just a type alias used to make code more
|
||||||
* readible.
|
* readable.
|
||||||
*/
|
*/
|
||||||
typedef std::string_view OutputNameView;
|
typedef std::string_view OutputNameView;
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ struct UnkeyedValidPathInfo
|
||||||
Hash narHash;
|
Hash narHash;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Other store objects this store object referes to.
|
* Other store objects this store object refers to.
|
||||||
*/
|
*/
|
||||||
StorePathSet references;
|
StorePathSet references;
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* Template implementations (as opposed to mere declarations).
|
* Template implementations (as opposed to mere declarations).
|
||||||
*
|
*
|
||||||
* This file is an exmample of the "impl.hh" pattern. See the
|
* This file is an example of the "impl.hh" pattern. See the
|
||||||
* contributing guide.
|
* contributing guide.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -62,7 +62,7 @@ public:
|
||||||
*
|
*
|
||||||
* Current implementation is to use `fcntl` with `F_SETPIPE_SZ`,
|
* Current implementation is to use `fcntl` with `F_SETPIPE_SZ`,
|
||||||
* which is Linux-only. For this implementation, `size` must
|
* which is Linux-only. For this implementation, `size` must
|
||||||
* convertable to an `int`. In other words, it must be within
|
* convertible to an `int`. In other words, it must be within
|
||||||
* `[0, INT_MAX]`.
|
* `[0, INT_MAX]`.
|
||||||
*/
|
*/
|
||||||
void trySetBufferSize(size_t size);
|
void trySetBufferSize(size_t size);
|
||||||
|
|
|
@ -382,7 +382,7 @@ public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Query the mapping outputName => outputPath for the given
|
* Query the mapping outputName => outputPath for the given
|
||||||
* derivation. All outputs are mentioned so ones mising the mapping
|
* derivation. All outputs are mentioned so ones missing the mapping
|
||||||
* are mapped to `std::nullopt`.
|
* are mapped to `std::nullopt`.
|
||||||
*/
|
*/
|
||||||
virtual std::map<std::string, std::optional<StorePath>> queryPartialDerivationOutputMap(
|
virtual std::map<std::string, std::optional<StorePath>> queryPartialDerivationOutputMap(
|
||||||
|
@ -809,7 +809,7 @@ protected:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper for methods that are not unsupported: this is used for
|
* Helper for methods that are not unsupported: this is used for
|
||||||
* default definitions for virtual methods that are meant to be overriden.
|
* default definitions for virtual methods that are meant to be overridden.
|
||||||
*
|
*
|
||||||
* @todo Using this should be a last resort. It is better to make
|
* @todo Using this should be a last resort. It is better to make
|
||||||
* the method "virtual pure" and/or move it to a subclass.
|
* the method "virtual pure" and/or move it to a subclass.
|
||||||
|
|
|
@ -89,7 +89,7 @@ struct MixStoreDirMethods
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Read-only variant of addToStore(). It returns the store
|
* Read-only variant of addToStore(). It returns the store
|
||||||
* path for the given file sytem object.
|
* path for the given file system object.
|
||||||
*/
|
*/
|
||||||
std::pair<StorePath, Hash> computeStorePath(
|
std::pair<StorePath, Hash> computeStorePath(
|
||||||
std::string_view name,
|
std::string_view name,
|
||||||
|
|
|
@ -9,7 +9,7 @@ namespace nix {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A parsed Store URI (URI is a slight misnomer...), parsed but not yet
|
* A parsed Store URI (URI is a slight misnomer...), parsed but not yet
|
||||||
* resolved to a specific instance and query parms validated.
|
* resolved to a specific instance and query params validated.
|
||||||
*
|
*
|
||||||
* Supported values are:
|
* Supported values are:
|
||||||
*
|
*
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
* those implementations.
|
* those implementations.
|
||||||
*
|
*
|
||||||
* Consumers of an arbitrary store from a URL/JSON configuration instead
|
* Consumers of an arbitrary store from a URL/JSON configuration instead
|
||||||
* just need the defintions `nix/store/store-open.hh`; those do use this
|
* just need the definitions `nix/store/store-open.hh`; those do use this
|
||||||
* but only as an implementation. Consumers of a specific extra type of
|
* but only as an implementation. Consumers of a specific extra type of
|
||||||
* store can skip both these, and just use the definition of the store
|
* store can skip both these, and just use the definition of the store
|
||||||
* in question directly.
|
* in question directly.
|
||||||
|
@ -71,7 +71,7 @@ struct Implementations
|
||||||
};
|
};
|
||||||
auto [it, didInsert] = registered().insert({TConfig::name(), std::move(factory)});
|
auto [it, didInsert] = registered().insert({TConfig::name(), std::move(factory)});
|
||||||
if (!didInsert) {
|
if (!didInsert) {
|
||||||
throw Error("Already registred store with name '%s'", it->first);
|
throw Error("Already registered store with name '%s'", it->first);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -97,7 +97,7 @@ struct WorkerProto::BasicClientConnection : WorkerProto::BasicConnection
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* After calling handshake, must call this to exchange some basic
|
* After calling handshake, must call this to exchange some basic
|
||||||
* information abou the connection.
|
* information about the connection.
|
||||||
*/
|
*/
|
||||||
ClientHandshakeInfo postHandshake(const StoreDirConfig & store);
|
ClientHandshakeInfo postHandshake(const StoreDirConfig & store);
|
||||||
|
|
||||||
|
@ -157,7 +157,7 @@ struct WorkerProto::BasicServerConnection : WorkerProto::BasicConnection
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* After calling handshake, must call this to exchange some basic
|
* After calling handshake, must call this to exchange some basic
|
||||||
* information abou the connection.
|
* information about the connection.
|
||||||
*/
|
*/
|
||||||
void postHandshake(const StoreDirConfig & store, const ClientHandshakeInfo & info);
|
void postHandshake(const StoreDirConfig & store, const ClientHandshakeInfo & info);
|
||||||
};
|
};
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* Template implementations (as opposed to mere declarations).
|
* Template implementations (as opposed to mere declarations).
|
||||||
*
|
*
|
||||||
* This file is an exmample of the "impl.hh" pattern. See the
|
* This file is an example of the "impl.hh" pattern. See the
|
||||||
* contributing guide.
|
* contributing guide.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -89,7 +89,7 @@ struct WorkerProto
|
||||||
struct BasicServerConnection;
|
struct BasicServerConnection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extra information provided as part of protocol negotation.
|
* Extra information provided as part of protocol negotiation.
|
||||||
*/
|
*/
|
||||||
struct ClientHandshakeInfo;
|
struct ClientHandshakeInfo;
|
||||||
|
|
||||||
|
|
|
@ -331,7 +331,7 @@ Path getDefaultProfile()
|
||||||
if (!pathExists(profileLink)) {
|
if (!pathExists(profileLink)) {
|
||||||
replaceSymlink(profile, profileLink);
|
replaceSymlink(profile, profileLink);
|
||||||
}
|
}
|
||||||
// Backwards compatibiliy measure: Make root's profile available as
|
// Backwards compatibility measure: Make root's profile available as
|
||||||
// `.../default` as it's what NixOS and most of the init scripts expect
|
// `.../default` as it's what NixOS and most of the init scripts expect
|
||||||
Path globalProfileLink = settings.nixStateDir + "/profiles/default";
|
Path globalProfileLink = settings.nixStateDir + "/profiles/default";
|
||||||
if (isRootUser() && !pathExists(globalProfileLink)) {
|
if (isRootUser() && !pathExists(globalProfileLink)) {
|
||||||
|
|
|
@ -120,7 +120,7 @@ std::string MountedSSHStoreConfig::doc()
|
||||||
* store.
|
* store.
|
||||||
*
|
*
|
||||||
* MountedSSHStore is very similar to UDSRemoteStore --- ignoring the
|
* MountedSSHStore is very similar to UDSRemoteStore --- ignoring the
|
||||||
* superficial differnce of SSH vs Unix domain sockets, they both are
|
* superficial difference of SSH vs Unix domain sockets, they both are
|
||||||
* accessing remote stores, and they both assume the store will be
|
* accessing remote stores, and they both assume the store will be
|
||||||
* mounted in the local filesystem.
|
* mounted in the local filesystem.
|
||||||
*
|
*
|
||||||
|
|
|
@ -333,10 +333,10 @@ digraph graphname {
|
||||||
node [shape=box]
|
node [shape=box]
|
||||||
fileSource -> narSink
|
fileSource -> narSink
|
||||||
narSink [style=dashed]
|
narSink [style=dashed]
|
||||||
narSink -> unsualHashTee [style = dashed, label = "Recursive && !SHA-256"]
|
narSink -> unusualHashTee [style = dashed, label = "Recursive && !SHA-256"]
|
||||||
narSink -> narHashSink [style = dashed, label = "else"]
|
narSink -> narHashSink [style = dashed, label = "else"]
|
||||||
unsualHashTee -> narHashSink
|
unusualHashTee -> narHashSink
|
||||||
unsualHashTee -> caHashSink
|
unusualHashTee -> caHashSink
|
||||||
fileSource -> parseSink
|
fileSource -> parseSink
|
||||||
parseSink [style=dashed]
|
parseSink [style=dashed]
|
||||||
parseSink-> fileSink [style = dashed, label = "Flat"]
|
parseSink-> fileSink [style = dashed, label = "Flat"]
|
||||||
|
|
|
@ -1987,7 +1987,7 @@ void DerivationBuilderImpl::runChild()
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto & i : ss) {
|
for (auto & i : ss) {
|
||||||
// For backwards-compatibiliy, resolve all the symlinks in the
|
// For backwards-compatibility, resolve all the symlinks in the
|
||||||
// chroot paths
|
// chroot paths
|
||||||
auto canonicalPath = canonPath(i, true);
|
auto canonicalPath = canonPath(i, true);
|
||||||
pathsInChroot.emplace(i, canonicalPath);
|
pathsInChroot.emplace(i, canonicalPath);
|
||||||
|
|
|
@ -127,7 +127,7 @@ bool PathLocks::lockPaths(const PathSet & paths, const std::string & waitMsg, bo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
debug("lock aquired on '%1%'", lockPath);
|
debug("lock acquired on '%1%'", lockPath);
|
||||||
|
|
||||||
struct _stat st;
|
struct _stat st;
|
||||||
if (_fstat(fromDescriptorReadOnly(fd.get()), &st) == -1)
|
if (_fstat(fromDescriptorReadOnly(fd.get()), &st) == -1)
|
||||||
|
|
|
@ -19,7 +19,7 @@ namespace nix {
|
||||||
const char *one_liner =
|
const char *one_liner =
|
||||||
"this is the other problem line of code";
|
"this is the other problem line of code";
|
||||||
|
|
||||||
TEST(logEI, catpuresBasicProperties) {
|
TEST(logEI, capturesBasicProperties) {
|
||||||
|
|
||||||
MakeError(TestError, Error);
|
MakeError(TestError, Error);
|
||||||
ErrorInfo::programName = std::optional("error-unit-test");
|
ErrorInfo::programName = std::optional("error-unit-test");
|
||||||
|
|
|
@ -144,7 +144,7 @@ Hash Hash::parseSRI(std::string_view original)
|
||||||
{
|
{
|
||||||
auto rest = original;
|
auto rest = original;
|
||||||
|
|
||||||
// Parse the has type before the separater, if there was one.
|
// Parse the has type before the separator, if there was one.
|
||||||
auto hashRaw = splitPrefixTo(rest, '-');
|
auto hashRaw = splitPrefixTo(rest, '-');
|
||||||
if (!hashRaw)
|
if (!hashRaw)
|
||||||
throw BadHash("hash '%s' is not SRI", original);
|
throw BadHash("hash '%s' is not SRI", original);
|
||||||
|
|
|
@ -23,7 +23,7 @@ std::string hiliteMatches(
|
||||||
auto m = *it;
|
auto m = *it;
|
||||||
size_t start = m.position();
|
size_t start = m.position();
|
||||||
out.append(s.substr(last_end, m.position() - last_end));
|
out.append(s.substr(last_end, m.position() - last_end));
|
||||||
// Merge continous matches
|
// Merge continuous matches
|
||||||
ssize_t end = start + m.length();
|
ssize_t end = start + m.length();
|
||||||
while (++it != matches.end() && (*it).position() <= end) {
|
while (++it != matches.end() && (*it).position() <= end) {
|
||||||
auto n = *it;
|
auto n = *it;
|
||||||
|
|
|
@ -252,7 +252,7 @@ protected:
|
||||||
std::list<ExpectedArg> processedArgs;
|
std::list<ExpectedArg> processedArgs;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Process some positional arugments
|
* Process some positional arguments
|
||||||
*
|
*
|
||||||
* @param finish: We have parsed everything else, and these are the only
|
* @param finish: We have parsed everything else, and these are the only
|
||||||
* arguments left. Used because we accumulate some "pending args" we might
|
* arguments left. Used because we accumulate some "pending args" we might
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Awful hacky generation of the comparison operators by doing a lexicographic
|
* Awful hacky generation of the comparison operators by doing a lexicographic
|
||||||
* comparison between the choosen fields.
|
* comparison between the chosen fields.
|
||||||
*
|
*
|
||||||
* ```
|
* ```
|
||||||
* GENERATE_CMP(ClassName, me->field1, me->field2, ...)
|
* GENERATE_CMP(ClassName, me->field1, me->field2, ...)
|
||||||
|
|
|
@ -8,7 +8,7 @@ namespace nix {
|
||||||
MakeError(ExecutableLookupError, Error);
|
MakeError(ExecutableLookupError, Error);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @todo rename, it is not just good for execuatable paths, but also
|
* @todo rename, it is not just good for executable paths, but also
|
||||||
* other lists of paths.
|
* other lists of paths.
|
||||||
*/
|
*/
|
||||||
struct ExecutablePath
|
struct ExecutablePath
|
||||||
|
@ -51,7 +51,7 @@ struct ExecutablePath
|
||||||
*
|
*
|
||||||
* @param exe This must just be a name, and not contain any `/` (or
|
* @param exe This must just be a name, and not contain any `/` (or
|
||||||
* `\` on Windows). in case it does, per the spec no lookup should
|
* `\` on Windows). in case it does, per the spec no lookup should
|
||||||
* be perfomed, and the path (it is not just a file name) as is.
|
* be performed, and the path (it is not just a file name) as is.
|
||||||
* This is the caller's respsonsibility.
|
* This is the caller's respsonsibility.
|
||||||
*
|
*
|
||||||
* This is a pure function, except for the default `isExecutable`
|
* This is a pure function, except for the default `isExecutable`
|
||||||
|
|
|
@ -68,7 +68,7 @@ static inline int fromDescriptorReadOnly(Descriptor fd)
|
||||||
std::string readFile(Descriptor fd);
|
std::string readFile(Descriptor fd);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Wrappers arount read()/write() that read/write exactly the
|
* Wrappers around read()/write() that read/write exactly the
|
||||||
* requested number of bytes.
|
* requested number of bytes.
|
||||||
*/
|
*/
|
||||||
void readFull(Descriptor fd, char * buf, size_t count);
|
void readFull(Descriptor fd, char * buf, size_t count);
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
namespace nix {
|
namespace nix {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unix-style path primives.
|
* Unix-style path primitives.
|
||||||
*
|
*
|
||||||
* Nix'result own "logical" paths are always Unix-style. So this is always
|
* Nix'result own "logical" paths are always Unix-style. So this is always
|
||||||
* used for that, and additionally used for native paths on Unix.
|
* used for that, and additionally used for native paths on Unix.
|
||||||
|
@ -51,7 +51,7 @@ struct UnixPathTrait
|
||||||
* often manipulating them converted to UTF-8 (*) using `char`.
|
* often manipulating them converted to UTF-8 (*) using `char`.
|
||||||
*
|
*
|
||||||
* (Actually neither are guaranteed to be valid unicode; both are
|
* (Actually neither are guaranteed to be valid unicode; both are
|
||||||
* arbitrary non-0 8- or 16-bit bytes. But for charcters with specifical
|
* arbitrary non-0 8- or 16-bit bytes. But for characters with specifical
|
||||||
* meaning like '/', '\\', ':', etc., we refer to an encoding scheme,
|
* meaning like '/', '\\', ':', etc., we refer to an encoding scheme,
|
||||||
* and also for sake of UIs that display paths a text.)
|
* and also for sake of UIs that display paths a text.)
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -36,7 +36,7 @@ enum struct HashFormat : int {
|
||||||
/// @brief Lowercase hexadecimal encoding. @see base16Chars
|
/// @brief Lowercase hexadecimal encoding. @see base16Chars
|
||||||
Base16,
|
Base16,
|
||||||
/// @brief "<hash algo>:<Base 64 hash>", format of the SRI integrity attribute.
|
/// @brief "<hash algo>:<Base 64 hash>", format of the SRI integrity attribute.
|
||||||
/// @see W3C recommendation [Subresource Intergrity](https://www.w3.org/TR/SRI/).
|
/// @see W3C recommendation [Subresource Integrity](https://www.w3.org/TR/SRI/).
|
||||||
SRI
|
SRI
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ struct Hash
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parse a hash from a string representation like the above, except the
|
* Parse a hash from a string representation like the above, except the
|
||||||
* type prefix is mandatory is there is no separate arguement.
|
* type prefix is mandatory is there is no separate argument.
|
||||||
*/
|
*/
|
||||||
static Hash parseAnyPrefixed(std::string_view s);
|
static Hash parseAnyPrefixed(std::string_view s);
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ namespace nix {
|
||||||
|
|
||||||
class PosIdx
|
class PosIdx
|
||||||
{
|
{
|
||||||
friend struct LazyPosAcessors;
|
friend struct LazyPosAccessors;
|
||||||
friend class PosTable;
|
friend class PosTable;
|
||||||
friend class std::hash<PosIdx>;
|
friend class std::hash<PosIdx>;
|
||||||
|
|
||||||
|
|
|
@ -564,7 +564,7 @@ struct FramedSink : nix::BufferedSink
|
||||||
|
|
||||||
void writeUnbuffered(std::string_view data) override
|
void writeUnbuffered(std::string_view data) override
|
||||||
{
|
{
|
||||||
/* Don't send more data if an error has occured. */
|
/* Don't send more data if an error has occurred. */
|
||||||
checkError();
|
checkError();
|
||||||
|
|
||||||
to << data.size();
|
to << data.size();
|
||||||
|
|
|
@ -54,7 +54,7 @@ struct SourceAccessor : std::enable_shared_from_this<SourceAccessor>
|
||||||
*
|
*
|
||||||
* @note Unlike Unix, this method should *not* follow symlinks. Nix
|
* @note Unlike Unix, this method should *not* follow symlinks. Nix
|
||||||
* by default wants to manipulate symlinks explicitly, and not
|
* by default wants to manipulate symlinks explicitly, and not
|
||||||
* implictly follow them, as they are frequently untrusted user data
|
* implicitly follow them, as they are frequently untrusted user data
|
||||||
* and thus may point to arbitrary locations. Acting on the targets
|
* and thus may point to arbitrary locations. Acting on the targets
|
||||||
* targets of symlinks should only occasionally be done, and only
|
* targets of symlinks should only occasionally be done, and only
|
||||||
* with care.
|
* with care.
|
||||||
|
|
|
@ -15,7 +15,7 @@ namespace nix {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
// This function is needed to handle non-blocking reads/writes. This is needed in the buildhook, because
|
// This function is needed to handle non-blocking reads/writes. This is needed in the buildhook, because
|
||||||
// somehow the json logger file descriptor ends up beeing non-blocking and breaks remote-building.
|
// somehow the json logger file descriptor ends up being non-blocking and breaks remote-building.
|
||||||
// TODO: get rid of buildhook and remove this function again (https://github.com/NixOS/nix/issues/12688)
|
// TODO: get rid of buildhook and remove this function again (https://github.com/NixOS/nix/issues/12688)
|
||||||
void pollFD(int fd, int events)
|
void pollFD(int fd, int events)
|
||||||
{
|
{
|
||||||
|
|
|
@ -47,7 +47,7 @@ void writeFull(HANDLE handle, std::string_view s, bool allowInterrupts)
|
||||||
if (allowInterrupts) checkInterrupt();
|
if (allowInterrupts) checkInterrupt();
|
||||||
DWORD res;
|
DWORD res;
|
||||||
#if _WIN32_WINNT >= 0x0600
|
#if _WIN32_WINNT >= 0x0600
|
||||||
auto path = handleToPath(handle); // debug; do it before becuase handleToPath changes lasterror
|
auto path = handleToPath(handle); // debug; do it before because handleToPath changes lasterror
|
||||||
if (!WriteFile(handle, s.data(), s.size(), &res, NULL)) {
|
if (!WriteFile(handle, s.data(), s.size(), &res, NULL)) {
|
||||||
throw WinError("writing to file %1%:%2%", handle, path);
|
throw WinError("writing to file %1%:%2%", handle, path);
|
||||||
}
|
}
|
||||||
|
|
|
@ -862,7 +862,7 @@ static void opServe(Strings opFlags, Strings opArgs)
|
||||||
|
|
||||||
auto options = ServeProto::Serialise<ServeProto::BuildOptions>::read(*store, rconn);
|
auto options = ServeProto::Serialise<ServeProto::BuildOptions>::read(*store, rconn);
|
||||||
|
|
||||||
// Only certain feilds get initialized based on the protocol
|
// Only certain fields get initialized based on the protocol
|
||||||
// version. This is why not all the code below is unconditional.
|
// version. This is why not all the code below is unconditional.
|
||||||
// See how the serialization logic in
|
// See how the serialization logic in
|
||||||
// `ServeProto::Serialise<ServeProto::BuildOptions>` matches
|
// `ServeProto::Serialise<ServeProto::BuildOptions>` matches
|
||||||
|
|
|
@ -65,7 +65,7 @@ public:
|
||||||
std::vector<FlakeRef> getFlakeRefsForCompletion() override
|
std::vector<FlakeRef> getFlakeRefsForCompletion() override
|
||||||
{
|
{
|
||||||
return {
|
return {
|
||||||
// Like getFlakeRef but with expandTilde calld first
|
// Like getFlakeRef but with expandTilde called first
|
||||||
parseFlakeRef(fetchSettings, expandTilde(flakeUrl), std::filesystem::current_path().string())
|
parseFlakeRef(fetchSettings, expandTilde(flakeUrl), std::filesystem::current_path().string())
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -226,7 +226,7 @@ foreach linkname : nix_symlinks
|
||||||
# TODO(Ericson2314): Don't do this once we have the `meson.override_find_program` working)
|
# TODO(Ericson2314): Don't do this once we have the `meson.override_find_program` working)
|
||||||
build_by_default: true
|
build_by_default: true
|
||||||
)
|
)
|
||||||
# TODO(Ericson3214): Dosen't yet work
|
# TODO(Ericson3214): Doesn't yet work
|
||||||
#meson.override_find_program(linkname, t)
|
#meson.override_find_program(linkname, t)
|
||||||
endforeach
|
endforeach
|
||||||
|
|
||||||
|
@ -246,7 +246,7 @@ custom_target(
|
||||||
# TODO(Ericson2314): Don't do this once we have the `meson.override_find_program` working)
|
# TODO(Ericson2314): Don't do this once we have the `meson.override_find_program` working)
|
||||||
build_by_default: true
|
build_by_default: true
|
||||||
)
|
)
|
||||||
# TODO(Ericson3214): Dosen't yet work
|
# TODO(Ericson3214): Doesn't yet work
|
||||||
#meson.override_find_program(linkname, t)
|
#meson.override_find_program(linkname, t)
|
||||||
|
|
||||||
localstatedir = nix_store.get_variable(
|
localstatedir = nix_store.get_variable(
|
||||||
|
|
|
@ -481,7 +481,7 @@ static void processStdioConnection(ref<Store> store, TrustedFlag trustClient)
|
||||||
* @param forceTrustClientOpt See `daemonLoop()` and the parameter with
|
* @param forceTrustClientOpt See `daemonLoop()` and the parameter with
|
||||||
* the same name over there for details.
|
* the same name over there for details.
|
||||||
*
|
*
|
||||||
* @param procesOps Whether to force processing ops even if the next
|
* @param processOps Whether to force processing ops even if the next
|
||||||
* store also is a remote store and could process it directly.
|
* store also is a remote store and could process it directly.
|
||||||
*/
|
*/
|
||||||
static void runDaemon(bool stdio, std::optional<TrustedFlag> forceTrustClientOpt, bool processOps)
|
static void runDaemon(bool stdio, std::optional<TrustedFlag> forceTrustClientOpt, bool processOps)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue