1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-24 22:11:15 +02:00

Fix various typos in source code

This only touches code comments, class names, documentation,
enumeration names and tests.
This commit is contained in:
Sergei Zimmerman 2025-05-25 20:14:11 +00:00
parent 9e97ecabb6
commit 114de63d88
No known key found for this signature in database
GPG key ID: A9B0B557CA632325
63 changed files with 104 additions and 104 deletions

View file

@ -23,17 +23,17 @@ struct SourcePath;
namespace flake { struct Settings; }
/**
* @todo Get rid of global setttings variables
* @todo Get rid of global settings variables
*/
extern fetchers::Settings fetchSettings;
/**
* @todo Get rid of global setttings variables
* @todo Get rid of global settings variables
*/
extern EvalSettings evalSettings;
/**
* @todo Get rid of global setttings variables
* @todo Get rid of global settings variables
*/
extern flake::Settings flakeSettings;

View file

@ -294,7 +294,7 @@ StringSet NixRepl::completePrefix(const std::string & prefix)
} catch (BadURL & e) {
// Quietly ignore BadURL flake-related errors.
} catch (FileNotFound & e) {
// Quietly ignore non-existent file beeing `import`-ed.
// Quietly ignore non-existent file being `import`-ed.
}
}

View file

@ -458,7 +458,7 @@ namespace nix {
HintFmt("expected a function but found %s: %s", "a list", Uncolored("[ ]")),
HintFmt("while evaluating the first argument passed to builtins.filterSource"));
// Usupported by store "dummy"
// Unsupported by store "dummy"
// ASSERT_TRACE2("filterSource (_: 1) ./.",
// TypeError,
@ -636,7 +636,7 @@ namespace nix {
HintFmt("expected a set but found %s: %s", "a list", Uncolored("[ ]")),
HintFmt("while evaluating the second argument passed to builtins.mapAttrs"));
// XXX: defered
// XXX: deferred
// ASSERT_TRACE2("mapAttrs \"\" { foo.bar = 1; }",
// TypeError,
// 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("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.
// 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; } ]",
// TypeError,
// 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("while evaluating the first argument passed to builtins.genList"));
// XXX: defered
// XXX: deferred
// ASSERT_TRACE2("genList (x: x + \"foo\") 2 #TODO",
// TypeError,
// HintFmt("cannot add %s to an integer", "a string"),

View file

@ -143,7 +143,7 @@ namespace nix {
// 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.
// 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
// manner.

View file

@ -657,7 +657,7 @@ std::optional<EvalState::Doc> EvalState::getDoc(Value & v)
Value & functor = *v.attrs()->find(sFunctor)->value;
Value * vp[] = {&v};
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;
// So preferably we show docs that are relevant to the
// "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. */
auto path = coerceToString(pos, v, context, errorCtx, false, false, true).toOwned();
if (path == "" || path[0] != '/')
@ -2866,7 +2866,7 @@ bool EvalState::fullGC() {
GC_gcollect();
// 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.
// 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
// like that.
return GC_get_bytes_since_gc() < 1024;

View file

@ -13,7 +13,7 @@ struct PrimOp;
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
* `LookupPathHooks` below).

View file

@ -2,7 +2,7 @@
#include <cstddef>
// inluding the generated headers twice leads to errors
// including the generated headers twice leads to errors
#ifndef BISON_HEADER
# include "lexer-tab.hh"
# include "parser-tab.hh"

View file

@ -890,7 +890,7 @@ static void prim_ceil(EvalState & state, const PosIdx pos, Value * * args, Value
auto arg = args[0]->integer();
auto res = v.integer();
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 res = v.integer();
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;
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;
state.debugRepl = nullptr;
}
@ -2172,7 +2172,7 @@ static RegisterPrimOp primop_outputOf({
[input placeholder string](@docroot@/store/derivation/index.md#input-placeholder)
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.
*`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,
});
// 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
// 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
@ -2827,7 +2827,7 @@ static RegisterPrimOp primop_unsafeGetAttrPos(PrimOp {
// 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
// for in the very hot path that is forceValue.
static struct LazyPosAcessors {
static struct LazyPosAccessors {
PrimOp primop_lineOfPos{
.arity = 1,
.fun = [] (EvalState & state, PosIdx pos, Value * * args, Value & v) {
@ -2843,7 +2843,7 @@ static struct LazyPosAcessors {
Value lineOfPos, columnOfPos;
LazyPosAcessors()
LazyPosAccessors()
{
lineOfPos.mkPrimOp(&primop_lineOfPos);
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_);
// More strict than striclty (!) necessary, but acceptable
// More strict than strictly (!) necessary, but acceptable
// as evaluating map without accessing any values makes little sense.
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
// 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) {
state.forceValue(*args[2], pos);
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.
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);
for (const auto & [si, v2] : enumerate(list2)) {
if (!match[si + 1].matched)

View file

@ -305,7 +305,7 @@ static RegisterPrimOp primop_fetchTree({
- `"tarball"`
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)

View file

@ -587,7 +587,7 @@ struct GitRepoImpl : GitRepo, std::enable_shared_from_this<GitRepoImpl>
});
/* 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
commit being signed by gpg keys that are present in the
users key agent. */

View file

@ -175,7 +175,7 @@ struct GitArchiveInputScheme : InputScheme
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
{
auto tokens = settings.accessTokens.get();

View file

@ -27,7 +27,7 @@ extern "C" {
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_string
*/

View file

@ -531,7 +531,7 @@ LockedFlake lockFlake(
/* Resolve relative 'path:' inputs relative to
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
override it. */
@ -552,7 +552,7 @@ LockedFlake lockFlake(
assert(input.ref);
auto overridenParentPath =
auto overriddenParentPath =
input.ref->input.isRelative()
? std::optional<InputAttrPath>(hasOverride ? i->second.parentInputAttrPath : inputAttrPathPrefix)
: std::nullopt;
@ -561,8 +561,8 @@ LockedFlake lockFlake(
{
if (auto relativePath = input.ref->input.isRelative()) {
return SourcePath {
overridenSourcePath.accessor,
CanonPath(*relativePath, overridenSourcePath.path.parent().value())
overriddenSourcePath.accessor,
CanonPath(*relativePath, overriddenSourcePath.path.parent().value())
};
} else
return std::nullopt;
@ -596,7 +596,7 @@ LockedFlake lockFlake(
if (oldLock
&& oldLock->originalRef.canonicalize() == input.ref->canonicalize()
&& oldLock->parentInputAttrPath == overridenParentPath
&& oldLock->parentInputAttrPath == overriddenParentPath
&& !hasCliOverride)
{
debug("keeping existing input '%s'", inputAttrPathS);
@ -694,7 +694,7 @@ LockedFlake lockFlake(
inputFlake.lockedRef,
ref,
true,
overridenParentPath);
overriddenParentPath);
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);

View file

@ -129,7 +129,7 @@ struct LockedFlake
/**
* 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.
*/
std::map<ref<Node>, SourcePath> nodePaths;

View file

@ -259,7 +259,7 @@ public:
update(*state);
}
/* Check whether an activity has an ancestore with the specified
/* Check whether an activity has an ancestor with the specified
type. */
bool hasAncestor(State & state, ActivityType type, ActivityId act)
{
@ -382,7 +382,7 @@ public:
/**
* 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
* emulators.
*/

View file

@ -87,7 +87,7 @@ TEST(machines, getMachinesWithCommentsAndSemicolonSeparator) {
TEST(machines, getMachinesWithFunnyWhitespace) {
auto actual = Machine::parseConfig({},
" # commment ; comment\n"
" # comment ; comment\n"
" nix@scratchy.labs.cs.uu.nl ; nix@itchy.labs.cs.uu.nl \n"
"\n \n"
"\n ;;; \n"

View file

@ -46,7 +46,7 @@ TEST(OutputsSpec, names_underscore) {
ASSERT_EQ(expected.to_string(), str);
}
TEST(OutputsSpec, names_numberic) {
TEST(OutputsSpec, names_numeric) {
std::string_view str = "01";
OutputsSpec expected = OutputsSpec::Names { "01" };
ASSERT_EQ(OutputsSpec::parse(str), expected);
@ -126,7 +126,7 @@ TEST_DONT_PARSE(star_second, "^foo,*")
#undef TEST_DONT_PARSE
TEST(ExtendedOutputsSpec, defeault) {
TEST(ExtendedOutputsSpec, default) {
std::string_view str = "foo";
auto [prefix, extendedOutputsSpec] = ExtendedOutputsSpec::parse(str);
ASSERT_EQ(prefix, "foo");

View file

@ -329,7 +329,7 @@ Goal::Co DerivationBuildingGoal::gaveUpOnSubstitution()
auto take1 = get(resolvedResult.builtOutputs, outputName);
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
store, which is our actual source of truth. For now we just
check the store directly if it fails. */
@ -1150,7 +1150,7 @@ std::pair<bool, SingleDrvOutputs> DerivationBuildingGoal::checkPathValidity()
for (auto & i : queryPartialDerivationOutputMap()) {
auto initialOutput = get(initialOutputs, i.first);
if (!initialOutput)
// this is an invalid output, gets catched with (!wantedOutputsLeft.empty())
// this is an invalid output, gets caught with (!wantedOutputsLeft.empty())
continue;
auto & info = *initialOutput;
info.wanted = true;

View file

@ -86,7 +86,7 @@ void DerivationGoal::addWantedOutputs(const OutputsSpec & outputs)
{
auto newWanted = wantedOutputs.union_(outputs);
switch (needRestart) {
case NeedRestartForMoreOutputs::OutputsUnmodifedDontNeed:
case NeedRestartForMoreOutputs::OutputsUnmodifiedDontNeed:
if (!newWanted.isSubsetOf(wantedOutputs))
needRestart = NeedRestartForMoreOutputs::OutputsAddedDoNeed;
break;
@ -303,7 +303,7 @@ Goal::Co DerivationGoal::haveDerivation(StorePath drvPath)
nrFailed = nrNoSubstituters = 0;
if (needRestart == NeedRestartForMoreOutputs::OutputsAddedDoNeed) {
needRestart = NeedRestartForMoreOutputs::OutputsUnmodifedDontNeed;
needRestart = NeedRestartForMoreOutputs::OutputsUnmodifiedDontNeed;
co_return haveDerivation(std::move(drvPath));
}
@ -458,7 +458,7 @@ std::pair<bool, SingleDrvOutputs> DerivationGoal::checkPathValidity(const StoreP
for (auto & i : queryPartialDerivationOutputMap(drvPath)) {
auto initialOutput = get(initialOutputs, i.first);
if (!initialOutput)
// this is an invalid output, gets catched with (!wantedOutputsLeft.empty())
// this is an invalid output, gets caught with (!wantedOutputsLeft.empty())
continue;
auto & info = *initialOutput;
info.wanted = wantedOutputs.contains(i.first);

View file

@ -412,7 +412,7 @@ Derivation parseDerivation(
expect(str, "rvWithVersion(");
auto versionS = parseString(str);
if (*versionS == "xp-dyn-drv") {
// Only verison we have so far
// Only version we have so far
version = DerivationATermVersion::DynamicDerivations;
xpSettings.require(Xp::DynamicDerivations);
} else {
@ -553,7 +553,7 @@ static void unparseDerivedPathMapNode(const StoreDirConfig & store, std::string
* derivation?
*
* 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
* `DerivedPath::Built`.
*/

View file

@ -775,7 +775,7 @@ void LocalStore::collectGarbage(const GCOptions & options, GCResults & results)
deleteFromStore(path.to_string());
referrersCache.erase(path);
} 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
printError("BUG: %s", e.what());
}

View file

@ -14,7 +14,7 @@ struct BuildResult
{
/**
* @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
* codes at the end of the list.
*/

View file

@ -1,6 +1,6 @@
#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"

View file

@ -42,7 +42,7 @@ struct DerivationGoal : public Goal
* The goal state machine is progressing based on the current value of
* `wantedOutputs. No actions are needed.
*/
OutputsUnmodifedDontNeed,
OutputsUnmodifiedDontNeed,
/**
* `wantedOutputs` has been extended, but the state machine is
* 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.
*/
NeedRestartForMoreOutputs needRestart = NeedRestartForMoreOutputs::OutputsUnmodifedDontNeed;
NeedRestartForMoreOutputs needRestart = NeedRestartForMoreOutputs::OutputsUnmodifiedDontNeed;
/**
* The derivation stored at `drvReq`.

View file

@ -4,7 +4,7 @@
*
* 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.
*/

View file

@ -89,12 +89,12 @@ DECLARE_COMMON_SERIALISER(std::map<K COMMA_ V>);
* that the underlying types never serialize to the empty string.
*
* 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
* tags 0...n).
*
* 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
* specializations may not be allowed.
*/

View file

@ -170,7 +170,7 @@ struct DerivationOptions
/**
* Parse this information from its legacy encoding as part of the
* 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).
*/
static DerivationOptions

View file

@ -214,7 +214,7 @@ struct DerivationType {
/**
* 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.
*/
struct Impure {

View file

@ -89,7 +89,7 @@ struct GCResults
* 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
* 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`,
* which is not part of this class because it relies on the notion of

View file

@ -13,13 +13,13 @@ namespace nix {
/**
* An (owned) output name. Just a type alias used to make code more
* readible.
* readable.
*/
typedef std::string OutputName;
/**
* A borrowed output name. Just a type alias used to make code more
* readible.
* readable.
*/
typedef std::string_view OutputNameView;

View file

@ -51,7 +51,7 @@ struct UnkeyedValidPathInfo
Hash narHash;
/**
* Other store objects this store object referes to.
* Other store objects this store object refers to.
*/
StorePathSet references;

View file

@ -4,7 +4,7 @@
*
* 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.
*/

View file

@ -62,7 +62,7 @@ public:
*
* Current implementation is to use `fcntl` with `F_SETPIPE_SZ`,
* 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]`.
*/
void trySetBufferSize(size_t size);

View file

@ -382,7 +382,7 @@ public:
/**
* 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`.
*/
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
* 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
* the method "virtual pure" and/or move it to a subclass.

View file

@ -89,7 +89,7 @@ struct MixStoreDirMethods
/**
* 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::string_view name,

View file

@ -9,7 +9,7 @@ namespace nix {
/**
* 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:
*

View file

@ -7,7 +7,7 @@
* those implementations.
*
* 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
* store can skip both these, and just use the definition of the store
* in question directly.
@ -71,7 +71,7 @@ struct Implementations
};
auto [it, didInsert] = registered().insert({TConfig::name(), std::move(factory)});
if (!didInsert) {
throw Error("Already registred store with name '%s'", it->first);
throw Error("Already registered store with name '%s'", it->first);
}
}
};

View file

@ -97,7 +97,7 @@ struct WorkerProto::BasicClientConnection : WorkerProto::BasicConnection
/**
* After calling handshake, must call this to exchange some basic
* information abou the connection.
* information about the connection.
*/
ClientHandshakeInfo postHandshake(const StoreDirConfig & store);
@ -157,7 +157,7 @@ struct WorkerProto::BasicServerConnection : WorkerProto::BasicConnection
/**
* 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);
};

View file

@ -4,7 +4,7 @@
*
* 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.
*/

View file

@ -89,7 +89,7 @@ struct WorkerProto
struct BasicServerConnection;
/**
* Extra information provided as part of protocol negotation.
* Extra information provided as part of protocol negotiation.
*/
struct ClientHandshakeInfo;

View file

@ -331,7 +331,7 @@ Path getDefaultProfile()
if (!pathExists(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
Path globalProfileLink = settings.nixStateDir + "/profiles/default";
if (isRootUser() && !pathExists(globalProfileLink)) {

View file

@ -120,7 +120,7 @@ std::string MountedSSHStoreConfig::doc()
* store.
*
* 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
* mounted in the local filesystem.
*

View file

@ -333,10 +333,10 @@ digraph graphname {
node [shape=box]
fileSource -> narSink
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"]
unsualHashTee -> narHashSink
unsualHashTee -> caHashSink
unusualHashTee -> narHashSink
unusualHashTee -> caHashSink
fileSource -> parseSink
parseSink [style=dashed]
parseSink-> fileSink [style = dashed, label = "Flat"]

View file

@ -1987,7 +1987,7 @@ void DerivationBuilderImpl::runChild()
}
for (auto & i : ss) {
// For backwards-compatibiliy, resolve all the symlinks in the
// For backwards-compatibility, resolve all the symlinks in the
// chroot paths
auto canonicalPath = canonPath(i, true);
pathsInChroot.emplace(i, canonicalPath);

View file

@ -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;
if (_fstat(fromDescriptorReadOnly(fd.get()), &st) == -1)

View file

@ -19,7 +19,7 @@ namespace nix {
const char *one_liner =
"this is the other problem line of code";
TEST(logEI, catpuresBasicProperties) {
TEST(logEI, capturesBasicProperties) {
MakeError(TestError, Error);
ErrorInfo::programName = std::optional("error-unit-test");

View file

@ -144,7 +144,7 @@ Hash Hash::parseSRI(std::string_view 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, '-');
if (!hashRaw)
throw BadHash("hash '%s' is not SRI", original);

View file

@ -23,7 +23,7 @@ std::string hiliteMatches(
auto m = *it;
size_t start = m.position();
out.append(s.substr(last_end, m.position() - last_end));
// Merge continous matches
// Merge continuous matches
ssize_t end = start + m.length();
while (++it != matches.end() && (*it).position() <= end) {
auto n = *it;

View file

@ -252,7 +252,7 @@ protected:
std::list<ExpectedArg> processedArgs;
/**
* Process some positional arugments
* Process some positional arguments
*
* @param finish: We have parsed everything else, and these are the only
* arguments left. Used because we accumulate some "pending args" we might

View file

@ -16,7 +16,7 @@
/**
* 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, ...)

View file

@ -8,7 +8,7 @@ namespace nix {
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.
*/
struct ExecutablePath
@ -51,7 +51,7 @@ struct ExecutablePath
*
* @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
* 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 a pure function, except for the default `isExecutable`

View file

@ -68,7 +68,7 @@ static inline int fromDescriptorReadOnly(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.
*/
void readFull(Descriptor fd, char * buf, size_t count);

View file

@ -11,7 +11,7 @@
namespace nix {
/**
* Unix-style path primives.
* Unix-style path primitives.
*
* Nix'result own "logical" paths are always Unix-style. So this is always
* 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`.
*
* (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,
* and also for sake of UIs that display paths a text.)
*/

View file

@ -36,7 +36,7 @@ enum struct HashFormat : int {
/// @brief Lowercase hexadecimal encoding. @see base16Chars
Base16,
/// @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
};
@ -66,7 +66,7 @@ struct Hash
/**
* 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);

View file

@ -8,7 +8,7 @@ namespace nix {
class PosIdx
{
friend struct LazyPosAcessors;
friend struct LazyPosAccessors;
friend class PosTable;
friend class std::hash<PosIdx>;

View file

@ -564,7 +564,7 @@ struct FramedSink : nix::BufferedSink
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();
to << data.size();

View file

@ -54,7 +54,7 @@ struct SourceAccessor : std::enable_shared_from_this<SourceAccessor>
*
* @note Unlike Unix, this method should *not* follow symlinks. Nix
* 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
* targets of symlinks should only occasionally be done, and only
* with care.

View file

@ -15,7 +15,7 @@ namespace nix {
namespace {
// 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)
void pollFD(int fd, int events)
{

View file

@ -47,7 +47,7 @@ void writeFull(HANDLE handle, std::string_view s, bool allowInterrupts)
if (allowInterrupts) checkInterrupt();
DWORD res;
#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)) {
throw WinError("writing to file %1%:%2%", handle, path);
}

View file

@ -862,7 +862,7 @@ static void opServe(Strings opFlags, Strings opArgs)
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.
// See how the serialization logic in
// `ServeProto::Serialise<ServeProto::BuildOptions>` matches

View file

@ -65,7 +65,7 @@ public:
std::vector<FlakeRef> getFlakeRefsForCompletion() override
{
return {
// Like getFlakeRef but with expandTilde calld first
// Like getFlakeRef but with expandTilde called first
parseFlakeRef(fetchSettings, expandTilde(flakeUrl), std::filesystem::current_path().string())
};
}

View file

@ -226,7 +226,7 @@ foreach linkname : nix_symlinks
# TODO(Ericson2314): Don't do this once we have the `meson.override_find_program` working)
build_by_default: true
)
# TODO(Ericson3214): Dosen't yet work
# TODO(Ericson3214): Doesn't yet work
#meson.override_find_program(linkname, t)
endforeach
@ -246,7 +246,7 @@ custom_target(
# TODO(Ericson2314): Don't do this once we have the `meson.override_find_program` working)
build_by_default: true
)
# TODO(Ericson3214): Dosen't yet work
# TODO(Ericson3214): Doesn't yet work
#meson.override_find_program(linkname, t)
localstatedir = nix_store.get_variable(

View file

@ -481,7 +481,7 @@ static void processStdioConnection(ref<Store> store, TrustedFlag trustClient)
* @param forceTrustClientOpt See `daemonLoop()` and the parameter with
* 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.
*/
static void runDaemon(bool stdio, std::optional<TrustedFlag> forceTrustClientOpt, bool processOps)