1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-09 03:56:01 +01:00

Merge pull request #13786 from NixOS/mergify/bp/2.28-maintenance/pr-13785

flake: nixpkgs: nixos-unstable -> nixos-25.05-small (backport #13785)
This commit is contained in:
John Ericson 2025-08-18 16:57:02 -04:00 committed by GitHub
commit 265e535650
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
61 changed files with 655 additions and 570 deletions

View file

@ -1,2 +1,6 @@
# bulk initial re-formatting with clang-format
a5264aa46eadb89c055b4d1442e814edb2d4414e # !autorebase ./maintainers/format.sh --until-stable
# clang-format 18 -> clang-format 19
945d9d7264b0dc7d0a8c8edf1cab34f38cd49a7f # !autorebase ./maintainers/format.sh --until-stable
# nixfmt 1.0.0
448bbbe0fd1fbe09cb46a238fec25b220f172122 # !autorebase ./maintainers/format.sh --until-stable

View file

@ -38,8 +38,7 @@ let
]
++ extraPkgs;
users =
{
users = {
root = {
uid = 0;
@ -82,8 +81,7 @@ let
}) (lib.lists.range 1 32)
);
groups =
{
groups = {
root.gid = 0;
nixbld.gid = 30000;
nobody.gid = 65534;

8
flake.lock generated
View file

@ -63,16 +63,16 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1734359947,
"narHash": "sha256-1Noao/H+N8nFB4Beoy8fgwrcOQLVm9o4zKW1ODaqK9E=",
"lastModified": 1755442223,
"narHash": "sha256-VtMQg02B3kt1oejwwrGn50U9Xbjgzfbb5TV5Wtx8dKI=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "48d12d5e70ee91fe8481378e540433a7303dbf6a",
"rev": "cd32a774ac52caaa03bcfc9e7591ac8c18617ced",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "release-24.11",
"ref": "nixos-25.05-small",
"repo": "nixpkgs",
"type": "github"
}

View file

@ -1,7 +1,7 @@
{
description = "The purely functional package manager";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/release-24.11";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05-small";
inputs.nixpkgs-regression.url = "github:NixOS/nixpkgs/215d4d0fd80ca5163643b03a33fde804a29cc1e2";
inputs.nixpkgs-23-11.url = "github:NixOS/nixpkgs/a62e6edd6d5e1fa0329b8653c801147986f8d446";

View file

@ -148,7 +148,8 @@ let
nativeBuildInputs = [
meson
ninja
] ++ prevAttrs.nativeBuildInputs or [ ];
]
++ prevAttrs.nativeBuildInputs or [ ];
mesonCheckFlags = prevAttrs.mesonCheckFlags or [ ] ++ [
"--print-errorlogs"
];

View file

@ -46,8 +46,7 @@
}:
let
libs =
{
libs = {
inherit
nix-util
nix-util-c
@ -63,7 +62,8 @@ let
nix-cmd
;
}
// lib.optionalAttrs
//
lib.optionalAttrs
(!stdenv.hostPlatform.isStatic && stdenv.buildPlatform.canExecute stdenv.hostPlatform)
{
# Currently fails in static build
@ -125,8 +125,7 @@ stdenv.mkDerivation (finalAttrs: {
*/
dontFixup = true;
checkInputs =
[
checkInputs = [
# Make sure the unit tests have passed
nix-util-tests.tests.run
nix-store-tests.tests.run
@ -137,8 +136,8 @@ stdenv.mkDerivation (finalAttrs: {
# Make sure the functional tests have passed
nix-functional-tests
]
++ lib.optionals
(!stdenv.hostPlatform.isStatic && stdenv.buildPlatform.canExecute stdenv.hostPlatform)
++
lib.optionals (!stdenv.hostPlatform.isStatic && stdenv.buildPlatform.canExecute stdenv.hostPlatform)
[
# Perl currently fails in static build
# TODO: Split out tests into a separate derivation?

View file

@ -505,8 +505,9 @@ Installables SourceExprCommand::parseInstallables(ref<Store> store, std::vector<
for (auto & s : ss) {
auto [prefix, extendedOutputsSpec] = ExtendedOutputsSpec::parse(s);
result.push_back(make_ref<InstallableAttrPath>(
InstallableAttrPath::parse(state, *this, vFile, std::move(prefix), std::move(extendedOutputsSpec))));
result.push_back(
make_ref<InstallableAttrPath>(InstallableAttrPath::parse(
state, *this, vFile, std::move(prefix), std::move(extendedOutputsSpec))));
}
} else {
@ -521,7 +522,8 @@ Installables SourceExprCommand::parseInstallables(ref<Store> store, std::vector<
if (prefix.find('/') != std::string::npos) {
try {
result.push_back(make_ref<InstallableDerivedPath>(
result.push_back(
make_ref<InstallableDerivedPath>(
InstallableDerivedPath::parse(store, prefix, extendedOutputsSpec.raw)));
continue;
} catch (BadStorePath &) {
@ -534,7 +536,8 @@ Installables SourceExprCommand::parseInstallables(ref<Store> store, std::vector<
try {
auto [flakeRef, fragment] =
parseFlakeRefWithFragment(fetchSettings, std::string{prefix}, absPath(getCommandBaseDir()));
result.push_back(make_ref<InstallableFlake>(
result.push_back(
make_ref<InstallableFlake>(
this,
getEvalState(),
std::move(flakeRef),
@ -610,7 +613,8 @@ static void throwBuildErrors(std::vector<KeyedBuildResult> & buildResults, const
StringSet failedPaths;
for (; failedResult != failed.end(); failedResult++) {
if (!failedResult->errorMsg.empty()) {
logError(ErrorInfo{
logError(
ErrorInfo{
.level = lvlError,
.msg = failedResult->errorMsg,
});

View file

@ -53,7 +53,8 @@ mkMesonLibrary (finalAttrs: {
buildInputs = [
({ inherit editline readline; }.${readlineFlavor})
] ++ lib.optional enableMarkdown lowdown;
]
++ lib.optional enableMarkdown lowdown;
propagatedBuildInputs = [
nix-util

View file

@ -650,7 +650,7 @@ ProcessLineResult NixRepl::processLine(std::string line)
for (auto & arg : args)
arg = "*" + arg + "*";
markdown += "**Synopsis:** `builtins." + (std::string)(*doc->name) + "` " + concatStringsSep(" ", args)
markdown += "**Synopsis:** `builtins." + (std::string) (*doc->name) + "` " + concatStringsSep(" ", args)
+ "\n\n";
}

View file

@ -223,20 +223,23 @@ INSTANTIATE_TEST_SUITE_P(
#define X4(w, x, y, z) \
TEST_F(TrivialExpressionTest, nestedAttrsetMerge##w##x##y##z) \
{ \
auto v = eval("{ a.b = { c = 1; d = 2; }; } == { " X_EXPAND_IF##w( \
auto v = eval( \
"{ a.b = { c = 1; d = 2; }; } == { " X_EXPAND_IF##w( \
"a", X_EXPAND_IF##x("b", "c = 1;")) " " X_EXPAND_IF##y("a", X_EXPAND_IF##z("b", "d = 2;")) " }"); \
ASSERT_THAT(v, IsTrue()); \
}; \
TEST_F(TrivialExpressionTest, nestedAttrsetMergeDup##w##x##y##z) \
{ \
ASSERT_THROW( \
eval("{ " X_EXPAND_IF##w("a", X_EXPAND_IF##x("b", "c = 1;")) " " X_EXPAND_IF##y( \
eval( \
"{ " X_EXPAND_IF##w("a", X_EXPAND_IF##x("b", "c = 1;")) " " X_EXPAND_IF##y( \
"a", X_EXPAND_IF##z("b", "c = 2;")) " }"), \
Error); \
}; \
TEST_F(TrivialExpressionTest, nestedAttrsetMergeLet##w##x##y##z) \
{ \
auto v = eval("{ b = { c = 1; d = 2; }; } == (let " X_EXPAND_IF##w( \
auto v = eval( \
"{ b = { c = 1; d = 2; }; } == (let " X_EXPAND_IF##w( \
"a", X_EXPAND_IF##x("b", "c = 1;")) " " X_EXPAND_IF##y("a", X_EXPAND_IF##z("b", "d = 2;")) " in a)"); \
ASSERT_THAT(v, IsTrue()); \
};

View file

@ -123,13 +123,13 @@ struct AttrDb
return doSQLite([&]() {
auto state(_state->lock());
state->insertAttribute.use()(key.first)(symbols[key.second])(AttrType::FullAttrs)(0, false).exec();
state->insertAttribute.use()(key.first)(symbols[key.second])(AttrType::FullAttrs) (0, false).exec();
AttrId rowId = state->db.getLastInsertedRowId();
assert(rowId);
for (auto & attr : attrs)
state->insertAttribute.use()(rowId)(symbols[attr])(AttrType::Placeholder)(0, false).exec();
state->insertAttribute.use()(rowId)(symbols[attr])(AttrType::Placeholder) (0, false).exec();
return rowId;
});
@ -147,10 +147,10 @@ struct AttrDb
ctx.push_back(' ');
ctx.append(*p);
}
state->insertAttributeWithContext.use()(key.first)(symbols[key.second])(AttrType::String)(s) (ctx)
state->insertAttributeWithContext.use()(key.first)(symbols[key.second])(AttrType::String) (s) (ctx)
.exec();
} else {
state->insertAttribute.use()(key.first)(symbols[key.second])(AttrType::String)(s).exec();
state->insertAttribute.use()(key.first)(symbols[key.second])(AttrType::String) (s).exec();
}
return state->db.getLastInsertedRowId();
@ -162,7 +162,7 @@ struct AttrDb
return doSQLite([&]() {
auto state(_state->lock());
state->insertAttribute.use()(key.first)(symbols[key.second])(AttrType::Bool)(b ? 1 : 0).exec();
state->insertAttribute.use()(key.first)(symbols[key.second])(AttrType::Bool) (b ? 1 : 0).exec();
return state->db.getLastInsertedRowId();
});
@ -173,7 +173,7 @@ struct AttrDb
return doSQLite([&]() {
auto state(_state->lock());
state->insertAttribute.use()(key.first)(symbols[key.second])(AttrType::Int)(n).exec();
state->insertAttribute.use()(key.first)(symbols[key.second])(AttrType::Int) (n).exec();
return state->db.getLastInsertedRowId();
});
@ -185,8 +185,8 @@ struct AttrDb
auto state(_state->lock());
state->insertAttribute
.use()(key.first)(symbols[key.second])(AttrType::ListOfStrings)(
dropEmptyInitThenConcatStringsSep("\t", l))
.use()(key.first)(symbols[key.second])(
AttrType::ListOfStrings) (dropEmptyInitThenConcatStringsSep("\t", l))
.exec();
return state->db.getLastInsertedRowId();
@ -198,7 +198,7 @@ struct AttrDb
return doSQLite([&]() {
auto state(_state->lock());
state->insertAttribute.use()(key.first)(symbols[key.second])(AttrType::Placeholder)(0, false).exec();
state->insertAttribute.use()(key.first)(symbols[key.second])(AttrType::Placeholder) (0, false).exec();
return state->db.getLastInsertedRowId();
});
@ -209,7 +209,7 @@ struct AttrDb
return doSQLite([&]() {
auto state(_state->lock());
state->insertAttribute.use()(key.first)(symbols[key.second])(AttrType::Missing)(0, false).exec();
state->insertAttribute.use()(key.first)(symbols[key.second])(AttrType::Missing) (0, false).exec();
return state->db.getLastInsertedRowId();
});
@ -220,7 +220,7 @@ struct AttrDb
return doSQLite([&]() {
auto state(_state->lock());
state->insertAttribute.use()(key.first)(symbols[key.second])(AttrType::Misc)(0, false).exec();
state->insertAttribute.use()(key.first)(symbols[key.second])(AttrType::Misc) (0, false).exec();
return state->db.getLastInsertedRowId();
});
@ -231,7 +231,7 @@ struct AttrDb
return doSQLite([&]() {
auto state(_state->lock());
state->insertAttribute.use()(key.first)(symbols[key.second])(AttrType::Failed)(0, false).exec();
state->insertAttribute.use()(key.first)(symbols[key.second])(AttrType::Failed) (0, false).exec();
return state->db.getLastInsertedRowId();
});

View file

@ -44,7 +44,8 @@ EvalErrorBuilder<T> & EvalErrorBuilder<T>::withFrame(const Env & env, const Expr
// NOTE: This is abusing side-effects.
// TODO: check compatibility with nested debugger calls.
// TODO: What side-effects??
error.state.debugTraces.push_front(DebugTrace{
error.state.debugTraces.push_front(
DebugTrace{
.pos = expr.getPos(),
.expr = expr,
.env = env,

View file

@ -795,7 +795,8 @@ void EvalState::runDebugRepl(const Error * error, const Env & env, const Expr &
printError("%s\n", error->what());
if (trylevel > 0 && error->info().level != lvlInfo)
printError("This exception occurred in a 'tryEval' call. Use " ANSI_GREEN "--ignore-try" ANSI_NORMAL
printError(
"This exception occurred in a 'tryEval' call. Use " ANSI_GREEN "--ignore-try" ANSI_NORMAL
" to skip these.\n");
}

View file

@ -70,13 +70,15 @@ mkMesonLibrary (finalAttrs: {
nix-util
nix-store
nix-fetchers
] ++ finalAttrs.passthru.externalPropagatedBuildInputs;
]
++ finalAttrs.passthru.externalPropagatedBuildInputs;
# Hack for sake of the dev shell
passthru.externalPropagatedBuildInputs = [
boost
nlohmann_json
] ++ lib.optional enableGC boehmgc;
]
++ lib.optional enableGC boehmgc;
mesonFlags = [
(lib.mesonEnable "gc" enableGC)

View file

@ -68,7 +68,8 @@ StringMap EvalState::realiseContext(const NixStringContext & context, StorePathS
std::visit(
overloaded{
[&](const NixStringContextElem::Built & b) {
drvs.push_back(DerivedPath::Built{
drvs.push_back(
DerivedPath::Built{
.drvPath = b.drvPath,
.outputs = OutputsSpec::Names{b.output},
});
@ -117,7 +118,8 @@ StringMap EvalState::realiseContext(const NixStringContext & context, StorePathS
/* Get all the output paths corresponding to the placeholders we had */
if (experimentalFeatureSettings.isEnabled(Xp::CaDerivations)) {
res.insert_or_assign(
DownstreamPlaceholder::fromSingleDerivedPathBuilt(SingleDerivedPath::Built{
DownstreamPlaceholder::fromSingleDerivedPathBuilt(
SingleDerivedPath::Built{
.drvPath = drv.drvPath,
.output = outputName,
})
@ -297,7 +299,8 @@ static void import(EvalState & state, const PosIdx pos, Value & vPath, Value * v
}
}
static RegisterPrimOp primop_scopedImport(PrimOp{
static RegisterPrimOp primop_scopedImport(
PrimOp{
.name = "scopedImport", .arity = 2, .fun = [](EvalState & state, const PosIdx pos, Value ** args, Value & v) {
import(state, pos, *args[1], args[0], v);
}});
@ -806,7 +809,8 @@ static void prim_genericClosure(EvalState & state, const PosIdx pos, Value ** ar
v.mkList(list);
}
static RegisterPrimOp primop_genericClosure(PrimOp{
static RegisterPrimOp primop_genericClosure(
PrimOp{
.name = "__genericClosure",
.args = {"attrset"},
.arity = 1,
@ -861,7 +865,7 @@ static RegisterPrimOp primop_genericClosure(PrimOp{
> ```
)",
.fun = prim_genericClosure,
});
});
static RegisterPrimOp primop_break(
{.name = "break",
@ -872,7 +876,8 @@ static RegisterPrimOp primop_break(
)",
.fun = [](EvalState & state, const PosIdx pos, Value ** args, Value & v) {
if (state.canDebug()) {
auto error = Error(ErrorInfo{
auto error = Error(
ErrorInfo{
.level = lvlInfo,
.msg = HintFmt("breakpoint reached"),
.pos = state.positions[pos],
@ -940,13 +945,14 @@ static void prim_addErrorContext(EvalState & state, const PosIdx pos, Value ** a
}
}
static RegisterPrimOp primop_addErrorContext(PrimOp{
static RegisterPrimOp primop_addErrorContext(
PrimOp{
.name = "__addErrorContext",
.arity = 2,
// The normal trace item is redundant
.addTrace = false,
.fun = prim_addErrorContext,
});
});
static void prim_ceil(EvalState & state, const PosIdx pos, Value ** args, Value & v)
{
@ -1656,11 +1662,12 @@ static void derivationStrictInternal(EvalState & state, const std::string & drvN
v.mkAttrs(result);
}
static RegisterPrimOp primop_derivationStrict(PrimOp{
static RegisterPrimOp primop_derivationStrict(
PrimOp{
.name = "derivationStrict",
.arity = 1,
.fun = prim_derivationStrict,
});
});
/* Return a placeholder string for the specified output that will be
substituted by the corresponding output path at build time. For
@ -1898,7 +1905,8 @@ static void prim_readFile(EvalState & state, const PosIdx pos, Value ** args, Va
}
NixStringContext context;
for (auto && p : std::move(refs)) {
context.insert(NixStringContextElem::Opaque{
context.insert(
NixStringContextElem::Opaque{
.path = std::move((StorePath &&) p),
});
}
@ -1956,7 +1964,8 @@ static void prim_findFile(EvalState & state, const PosIdx pos, Value ** args, Va
.debugThrow();
}
lookupPath.elements.emplace_back(LookupPath::Elem{
lookupPath.elements.emplace_back(
LookupPath::Elem{
.prefix = LookupPath::Prefix{.s = prefix},
.path = LookupPath::Path{.s = path},
});
@ -1968,7 +1977,8 @@ static void prim_findFile(EvalState & state, const PosIdx pos, Value ** args, Va
v.mkPath(state.findFile(lookupPath, path, pos));
}
static RegisterPrimOp primop_findFile(PrimOp{
static RegisterPrimOp primop_findFile(
PrimOp{
.name = "__findFile",
.args = {"search-path", "lookup-path"},
.doc = R"(
@ -2100,7 +2110,7 @@ static RegisterPrimOp primop_findFile(PrimOp{
> makes `<nixpkgs>` refer to a particular branch of the `NixOS/nixpkgs` repository on GitHub.
)",
.fun = prim_findFile,
});
});
/* Return the cryptographic hash of a file in base-16. */
static void prim_hashFile(EvalState & state, const PosIdx pos, Value ** args, Value & v)
@ -2871,11 +2881,12 @@ static void prim_unsafeGetAttrPos(EvalState & state, const PosIdx pos, Value **
state.mkPos(v, i->pos);
}
static RegisterPrimOp primop_unsafeGetAttrPos(PrimOp{
static RegisterPrimOp primop_unsafeGetAttrPos(
PrimOp{
.name = "__unsafeGetAttrPos",
.arity = 2,
.fun = prim_unsafeGetAttrPos,
});
});
// access to exact position information (ie, line and colum numbers) is deferred
// due to the cost associated with calculating that information and how rarely

View file

@ -276,7 +276,8 @@ static void prim_appendContext(EvalState & state, const PosIdx pos, Value ** arg
if (auto attr = i.value->attrs()->get(sPath)) {
if (state.forceBool(*attr->value, attr->pos, "while evaluating the `path` attribute of a string context"))
context.emplace(NixStringContextElem::Opaque{
context.emplace(
NixStringContextElem::Opaque{
.path = namePath,
});
}
@ -291,7 +292,8 @@ static void prim_appendContext(EvalState & state, const PosIdx pos, Value ** arg
.atPos(i.pos)
.debugThrow();
}
context.emplace(NixStringContextElem::DrvDeep{
context.emplace(
NixStringContextElem::DrvDeep{
.drvPath = namePath,
});
}
@ -309,7 +311,8 @@ static void prim_appendContext(EvalState & state, const PosIdx pos, Value ** arg
for (auto elem : attr->value->listItems()) {
auto outputName =
state.forceStringNoCtx(*elem, attr->pos, "while evaluating an output name within a string context");
context.emplace(NixStringContextElem::Built{
context.emplace(
NixStringContextElem::Built{
.drvPath = makeConstantStorePathRef(namePath),
.output = std::string{outputName},
});

View file

@ -44,7 +44,8 @@ static void downloadToSink(
static std::string getLfsApiToken(const ParsedURL & url)
{
auto [status, output] = runProgram(RunOptions{
auto [status, output] = runProgram(
RunOptions{
.program = "ssh",
.args = {*url.authority, "git-lfs-authenticate", url.path, "download"},
});

View file

@ -389,7 +389,8 @@ struct GitRepoImpl : GitRepo, std::enable_shared_from_this<GitRepoImpl>
continue;
std::string key2(key, 0, key.size() - 5);
auto path = CanonPath(value);
result.push_back(Submodule{
result.push_back(
Submodule{
.path = path,
.url = entries[key2 + ".url"],
.branch = entries[key2 + ".branch"],
@ -533,7 +534,8 @@ struct GitRepoImpl : GitRepo, std::enable_shared_from_this<GitRepoImpl>
append(gitArgs, {"--depth", "1"});
append(gitArgs, {std::string("--"), url, refspec});
runProgram(RunOptions{
runProgram(
RunOptions{
.program = "git",
.lookupPath = true,
// FIXME: git stderr messes up our progress indicator, so
@ -566,7 +568,8 @@ struct GitRepoImpl : GitRepo, std::enable_shared_from_this<GitRepoImpl>
writeFile(allowedSignersFile, allowedSigners);
// Run verification command
auto [status, output] = runProgram(RunOptions{
auto [status, output] = runProgram(
RunOptions{
.program = "git",
.args =
{"-c",

View file

@ -56,7 +56,8 @@ Path getCachePath(std::string_view key, bool shallow)
// ...
std::optional<std::string> readHead(const Path & path)
{
auto [status, output] = runProgram(RunOptions{
auto [status, output] = runProgram(
RunOptions{
.program = "git",
// FIXME: use 'HEAD' to avoid returning all refs
.args = {"ls-remote", "--symref", path},
@ -325,7 +326,8 @@ struct GitInputScheme : InputScheme
writeFile(*repoPath / path.rel(), contents);
auto result = runProgram(RunOptions{
auto result = runProgram(
RunOptions{
.program = "git",
.args =
{"-C",

View file

@ -35,7 +35,8 @@ std::shared_ptr<Registry> Registry::read(const Settings & settings, const Path &
toAttrs.erase(j);
}
auto exact = i.find("exact");
registry->entries.push_back(Entry{
registry->entries.push_back(
Entry{
.from = Input::fromAttrs(settings, jsonToAttrs(i["from"])),
.to = Input::fromAttrs(settings, std::move(toAttrs)),
.extraAttrs = extraAttrs,

View file

@ -14,7 +14,8 @@ Gen<OutputsSpec> Arbitrary<OutputsSpec>::arbitrary()
return gen::just((OutputsSpec) OutputsSpec::All{});
case 1:
return gen::map(
gen::nonEmpty(gen::container<StringSet>(
gen::nonEmpty(
gen::container<StringSet>(
gen::map(gen::arbitrary<StorePathName>(), [](StorePathName n) { return n.name; }))),
[](StringSet names) { return (OutputsSpec) OutputsSpec::Names{names}; });
default:

View file

@ -82,13 +82,15 @@ VERSIONED_CHARACTERIZATION_TEST(
.path = StorePath{"g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo"},
},
DerivedPath::Built{
.drvPath = makeConstantStorePathRef(StorePath{
.drvPath = makeConstantStorePathRef(
StorePath{
"g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-bar.drv",
}),
.outputs = OutputsSpec::All{},
},
DerivedPath::Built{
.drvPath = makeConstantStorePathRef(StorePath{
.drvPath = makeConstantStorePathRef(
StorePath{
"g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-bar.drv",
}),
.outputs = OutputsSpec::Names{"x", "y"},
@ -108,13 +110,15 @@ VERSIONED_CHARACTERIZATION_TEST(
.path = StorePath{"g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo.drv"},
},
DerivedPath::Built{
.drvPath = makeConstantStorePathRef(StorePath{
.drvPath = makeConstantStorePathRef(
StorePath{
"g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-bar.drv",
}),
.outputs = OutputsSpec::All{},
},
DerivedPath::Built{
.drvPath = makeConstantStorePathRef(StorePath{
.drvPath = makeConstantStorePathRef(
StorePath{
"g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-bar.drv",
}),
.outputs = OutputsSpec::Names{"x", "y"},
@ -369,7 +373,8 @@ VERSIONED_CHARACTERIZATION_TEST(WorkerProtoTest, keyedBuildResult_1_29, "keyed-b
},
/* .path = */
DerivedPath::Built{
.drvPath = makeConstantStorePathRef(StorePath{
.drvPath = makeConstantStorePathRef(
StorePath{
"g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-bar.drv",
}),
.outputs = OutputsSpec::Names{"out"},

View file

@ -1456,7 +1456,8 @@ std::pair<bool, SingleDrvOutputs> DerivationGoal::checkPathValidity()
// derivation, and the output path is valid, but we don't have
// its realisation stored (probably because it has been built
// without the `ca-derivations` experimental flag).
worker.store.registerDrvOutput(Realisation{
worker.store.registerDrvOutput(
Realisation{
drvOutput,
info.known->path,
});
@ -1551,7 +1552,8 @@ void DerivationGoal::waiteeDone(GoalPtr waitee, ExitCode result)
auto & outputs = nodeP->value;
for (auto & outputName : outputs) {
auto buildResult = dg->getBuildResult(DerivedPath::Built{
auto buildResult = dg->getBuildResult(
DerivedPath::Built{
.drvPath = makeConstantStorePathRef(dg->drvPath),
.outputs = OutputsSpec::Names{outputName},
});

View file

@ -68,7 +68,8 @@ std::vector<KeyedBuildResult> Store::buildPathsWithResults(
results.reserve(state.size());
for (auto & [req, goalPtr] : state)
results.emplace_back(KeyedBuildResult{
results.emplace_back(
KeyedBuildResult{
goalPtr->getBuildResult(req),
/* .path = */ req,
});
@ -88,7 +89,8 @@ BuildResult Store::buildDerivation(const StorePath & drvPath, const BasicDerivat
try {
worker.run(Goals{goal});
return goal->getBuildResult(DerivedPath::Built{
return goal->getBuildResult(
DerivedPath::Built{
.drvPath = makeConstantStorePathRef(drvPath),
.outputs = OutputsSpec::All{},
});

View file

@ -279,7 +279,8 @@ void Worker::run(const Goals & _topGoals)
for (auto & i : _topGoals) {
topGoals.insert(i);
if (auto goal = dynamic_cast<DerivationGoal *>(i.get())) {
topPaths.push_back(DerivedPath::Built{
topPaths.push_back(
DerivedPath::Built{
.drvPath = makeConstantStorePathRef(goal->drvPath),
.outputs = goal->wantedOutputs,
});

View file

@ -39,7 +39,8 @@ LegacySSHStore::LegacySSHStore(std::string_view scheme, std::string_view host, c
, CommonSSHStoreConfig(scheme, host, params)
, LegacySSHStoreConfig(scheme, host, params)
, Store(params)
, connections(make_ref<Pool<Connection>>(
, connections(
make_ref<Pool<Connection>>(
std::max(1, (int) maxConnections),
[this]() { return openConnection(); },
[](const ref<Connection> & r) { return r->good; }))

View file

@ -15,7 +15,8 @@ Machine::Machine(
decltype(supportedFeatures) supportedFeatures,
decltype(mandatoryFeatures) mandatoryFeatures,
decltype(sshPublicHostKey) sshPublicHostKey)
: storeUri(StoreReference::parse(
: storeUri(
StoreReference::parse(
// Backwards compatibility: if the URI is schemeless, is not a path,
// and is not one of the special store connection words, prepend
// ssh://.
@ -171,7 +172,8 @@ static Machine parseBuilderLine(const std::set<std::string> & defaultSystems, co
// TODO use designated initializers, once C++ supports those with
// custom constructors.
return {// `storeUri`
return {
// `storeUri`
tokens[0],
// `systemTypes`
isSet(1) ? tokenizeString<std::set<std::string>>(tokens[1], ",") : defaultSystems,

View file

@ -58,8 +58,7 @@ mkMesonLibrary (finalAttrs: {
nativeBuildInputs = lib.optional embeddedSandboxShell unixtools.hexdump;
buildInputs =
[
buildInputs = [
boost
curl
sqlite
@ -74,8 +73,7 @@ mkMesonLibrary (finalAttrs: {
nlohmann_json
];
mesonFlags =
[
mesonFlags = [
(lib.mesonEnable "seccomp-sandboxing" stdenv.hostPlatform.isLinux)
(lib.mesonBool "embedded-sandbox-shell" embeddedSandboxShell)
]

View file

@ -27,7 +27,8 @@ namespace nix {
RemoteStore::RemoteStore(const Params & params)
: RemoteStoreConfig(params)
, Store(params)
, connections(make_ref<Pool<Connection>>(
, connections(
make_ref<Pool<Connection>>(
std::max(1, (int) maxConnections),
[this]() {
auto conn = openConnectionWrapper();
@ -655,7 +656,8 @@ std::vector<KeyedBuildResult> RemoteStore::buildPathsWithResults(
std::visit(
overloaded{
[&](const DerivedPath::Opaque & bo) {
results.push_back(KeyedBuildResult{
results.push_back(
KeyedBuildResult{
{
.status = BuildResult::Substituted,
},

View file

@ -93,8 +93,10 @@ static void initAWS()
S3Helper::S3Helper(
const std::string & profile, const std::string & region, const std::string & scheme, const std::string & endpoint)
: config(makeConfig(region, scheme, endpoint))
, client(make_ref<Aws::S3::S3Client>(
profile == "" ? std::dynamic_pointer_cast<Aws::Auth::AWSCredentialsProvider>(
, client(
make_ref<Aws::S3::S3Client>(
profile == ""
? std::dynamic_pointer_cast<Aws::Auth::AWSCredentialsProvider>(
std::make_shared<Aws::Auth::DefaultAWSCredentialsProviderChain>())
: std::dynamic_pointer_cast<Aws::Auth::AWSCredentialsProvider>(
std::make_shared<Aws::Auth::ProfileConfigFileAWSCredentialsProvider>(profile.c_str())),

View file

@ -88,7 +88,8 @@ void handleDiffHook(
if (diffHookOpt && settings.runDiffHook) {
auto & diffHook = *diffHookOpt;
try {
auto diffRes = runProgram(RunOptions{
auto diffRes = runProgram(
RunOptions{
.program = diffHook,
.lookupPath = true,
.args = {tryA, tryB, drvPath, tmpDir},
@ -2715,7 +2716,8 @@ SingleDrvOutputs LocalDerivationGoal::registerOutputs()
std::filesystem::rename(tmpOutput, actualPath);
auto newInfo0 = newInfoFromCA(DerivationOutput::CAFloating{
auto newInfo0 = newInfoFromCA(
DerivationOutput::CAFloating{
.method = dof.ca.method,
.hashAlgo = wanted.algo,
});
@ -2754,7 +2756,8 @@ SingleDrvOutputs LocalDerivationGoal::registerOutputs()
},
[&](const DerivationOutput::Impure & doi) {
return newInfoFromCA(DerivationOutput::CAFloating{
return newInfoFromCA(
DerivationOutput::CAFloating{
.method = doi.method,
.hashAlgo = doi.hashAlgo,
});

View file

@ -314,7 +314,8 @@ TEST(Config, applyConfigFailsOnMissingIncludes)
Setting<std::string> setting{&config, "", "name-of-the-setting", "description"};
ASSERT_THROW(
config.applyConfig("name-of-the-setting = value-from-file\n"
config.applyConfig(
"name-of-the-setting = value-from-file\n"
"# name-of-the-setting = foo\n"
"include /nix/store/does/not/exist.nix"),
Error);

View file

@ -31,7 +31,8 @@ TEST(to_json, vectorOfOptionalInts)
TEST(to_json, optionalVectorOfInts)
{
std::optional<std::vector<int>> val = std::make_optional(std::vector<int>{
std::optional<std::vector<int>> val = std::make_optional(
std::vector<int>{
-420,
420,
});

View file

@ -50,7 +50,8 @@ mkMesonLibrary (finalAttrs: {
libblake3
libsodium
openssl
] ++ lib.optional stdenv.hostPlatform.isx86_64 libcpuid;
]
++ lib.optional stdenv.hostPlatform.isx86_64 libcpuid;
propagatedBuildInputs = [
boost

View file

@ -41,7 +41,8 @@ Suggestions Suggestions::bestMatches(const std::set<std::string> & allMatches, s
{
std::set<Suggestion> res;
for (const auto & possibleMatch : allMatches) {
res.insert(Suggestion{
res.insert(
Suggestion{
.distance = levenshteinDistance(query, possibleMatch),
.suggestion = possibleMatch,
});

View file

@ -253,8 +253,13 @@ pid_t startProcess(std::function<void()> fun, const ProcessOptions & options)
std::string runProgram(
Path program, bool lookupPath, const Strings & args, const std::optional<std::string> & input, bool isInteractive)
{
auto res = runProgram(RunOptions{
.program = program, .lookupPath = lookupPath, .args = args, .input = input, .isInteractive = isInteractive});
auto res = runProgram(
RunOptions{
.program = program,
.lookupPath = lookupPath,
.args = args,
.input = input,
.isInteractive = isInteractive});
if (!statusOk(res.first))
throw ExecError(res.first, "program '%1%' %2%", program, statusToString(res.first));

View file

@ -84,8 +84,13 @@ int Pid::wait()
std::string runProgram(
Path program, bool lookupPath, const Strings & args, const std::optional<std::string> & input, bool isInteractive)
{
auto res = runProgram(RunOptions{
.program = program, .lookupPath = lookupPath, .args = args, .input = input, .isInteractive = isInteractive});
auto res = runProgram(
RunOptions{
.program = program,
.lookupPath = lookupPath,
.args = args,
.input = input,
.isInteractive = isInteractive});
if (!statusOk(res.first))
throw ExecError(res.first, "program '%1%' %2%", program, statusToString(res.first));

View file

@ -480,7 +480,8 @@ static void main_nix_build(int argc, char ** argv)
throw Error("the 'bashInteractive' attribute in <nixpkgs> did not evaluate to a derivation");
auto bashDrv = drv->requireDrvPath();
pathsToBuild.push_back(DerivedPath::Built{
pathsToBuild.push_back(
DerivedPath::Built{
.drvPath = makeConstantStorePathRef(bashDrv),
.outputs = OutputsSpec::Names{"out"},
});
@ -499,7 +500,8 @@ static void main_nix_build(int argc, char ** argv)
accumDerivedPath = [&](ref<SingleDerivedPath> inputDrv,
const DerivedPathMap<StringSet>::ChildNode & inputNode) {
if (!inputNode.value.empty())
pathsToBuild.push_back(DerivedPath::Built{
pathsToBuild.push_back(
DerivedPath::Built{
.drvPath = inputDrv,
.outputs = OutputsSpec::Names{inputNode.value},
});
@ -687,7 +689,8 @@ static void main_nix_build(int argc, char ** argv)
if (outputName == "")
throw Error("derivation '%s' lacks an 'outputName' attribute", store->printStorePath(drvPath));
pathsToBuild.push_back(DerivedPath::Built{
pathsToBuild.push_back(
DerivedPath::Built{
.drvPath = makeConstantStorePathRef(drvPath),
.outputs = OutputsSpec::Names{outputName},
});

View file

@ -467,7 +467,8 @@ static void printMissing(EvalState & state, PackageInfos & elems)
};
targets.emplace_back(std::move(path));
} else
targets.emplace_back(DerivedPath::Opaque{
targets.emplace_back(
DerivedPath::Opaque{
.path = i.queryOutPath(),
});
@ -1108,7 +1109,7 @@ static void opQuery(Globals & globals, Strings opFlags, Strings opArgs)
attrs["substitutable"] = hasSubs ? "1" : "0";
} else
columns.push_back(
(std::string)(isInstalled ? "I" : "-") + (isValid ? "P" : "-") + (hasSubs ? "S" : "-"));
(std::string) (isInstalled ? "I" : "-") + (isValid ? "P" : "-") + (hasSubs ? "S" : "-"));
}
if (xmlOutput)

View file

@ -70,7 +70,8 @@ UnresolvedApp InstallableValue::toApp(EvalState & state)
std::vector<DerivedPath> context2;
for (auto & c : context) {
context2.emplace_back(std::visit(
context2.emplace_back(
std::visit(
overloaded{
[&](const NixStringContextElem::DrvDeep & d) -> DerivedPath {
/* We want all outputs of the drv */

View file

@ -402,7 +402,8 @@ void mainWrapped(int argc, char ** argv)
self-aware. That is, it has to know where it is installed. We
don't think it's sentient.
*/
settings.buildHook.setDefault(Strings{
settings.buildHook.setDefault(
Strings{
getNixBin({}).string(),
"__build-remote",
});

View file

@ -15,7 +15,8 @@ void runNix(Path program, const Strings & args, const std::optional<std::string>
auto subprocessEnv = getEnv();
subprocessEnv["NIX_CONFIG"] = globalConfig.toKeyValue();
// isInteractive avoid grabling interactive commands
runProgram2(RunOptions{
runProgram2(
RunOptions{
.program = getNixBin(program).string(),
.args = args,
.environment = subprocessEnv,

View file

@ -34,7 +34,8 @@ struct CmdSearch : InstallableValueCommand, MixJSON
CmdSearch()
{
expectArgs("regex", &res);
addFlag(Flag{
addFlag(
Flag{
.longName = "exclude",
.shortName = 'e',
.description = "Hide packages whose attribute path, name or description contain *regex*.",

View file

@ -45,7 +45,8 @@ perl.pkgs.toPerlModule (
buildInputs = [
nix-store
] ++ finalAttrs.passthru.externalBuildInputs;
]
++ finalAttrs.passthru.externalBuildInputs;
# Hack for sake of the dev shell
passthru.externalBuildInputs = [

View file

@ -2,8 +2,7 @@ with import ./lib.nix;
let
attrs =
{
attrs = {
y = "y";
x = "x";
foo = "foo";

View file

@ -1,6 +1,5 @@
let {
as =
{
as = {
x = 123;
y = 456;
}

View file

@ -1,6 +1,5 @@
let {
as =
{
as = {
x = 123;
y = 456;
}

View file

@ -6,7 +6,8 @@ let
scopedImport = attrs: fn: scopedImport (overrides // attrs) fn;
builtins = builtins // overrides;
} // import ./lib.nix;
}
// import ./lib.nix;
in
scopedImport overrides ./imported.nix

View file

@ -6,8 +6,7 @@ mkDerivation {
name = "nested-sandboxing";
busybox = builtins.getEnv "busybox";
EXTRA_SANDBOX = builtins.getEnv "EXTRA_SANDBOX";
buildCommand =
''
buildCommand = ''
set -x
set -eu -o pipefail
''

View file

@ -46,8 +46,7 @@ mkMesonDerivation (
];
# Hack for sake of the dev shell
passthru.externalNativeBuildInputs =
[
passthru.externalNativeBuildInputs = [
meson
ninja
pkg-config

View file

@ -77,7 +77,15 @@ let
{ lib, pkgs, ... }:
{
imports = [ checkOverrideNixVersion ];
nix.package = lib.mkForce pkgs.nixVersions.nix_2_3;
nix.package = lib.mkForce (
pkgs.nixVersions.nix_2_3.overrideAttrs (o: {
meta = o.meta // {
# This version shouldn't be used by end-users, but we run tests against
# it to ensure we don't break protocol compatibility.
knownVulnerabilities = [ ];
};
})
);
};
otherNixes.nix_2_13.setNixPackage =
@ -88,6 +96,8 @@ let
nixpkgs-23-11.legacyPackages.${pkgs.stdenv.hostPlatform.system}.nixVersions.nix_2_13.overrideAttrs
(o: {
meta = o.meta // {
# This version shouldn't be used by end-users, but we run tests against
# it to ensure we don't break protocol compatibility.
knownVulnerabilities = [ ];
};
})
@ -98,7 +108,9 @@ let
{ lib, pkgs, ... }:
{
imports = [ checkOverrideNixVersion ];
nix.package = lib.mkForce pkgs.nixVersions.nix_2_18;
nix.package =
lib.mkForce
nixpkgs-23-11.legacyPackages.${pkgs.stdenv.hostPlatform.system}.nixVersions.nix_2_18;
};
in

View file

@ -45,14 +45,14 @@
client.succeed("chmod 600 /root/.ssh/id_ed25519")
# Install the SSH key on the builders.
client.wait_for_unit("network-online.target")
client.wait_for_unit("network-addresses-eth1.service")
remote.succeed("mkdir -p -m 700 /root/.ssh")
remote.copy_from_host("key.pub", "/root/.ssh/authorized_keys")
remote.wait_for_unit("sshd")
remote.wait_for_unit("multi-user.target")
remote.wait_for_unit("network-online.target")
client.wait_for_unit("network-online.target")
remote.wait_for_unit("network-addresses-eth1.service")
client.wait_for_unit("network-addresses-eth1.service")
client.succeed(f"ssh -o StrictHostKeyChecking=no {remote.name} 'echo hello world'")
remote.succeed("""

View file

@ -187,9 +187,9 @@ in
github.succeed("cat /var/log/httpd/*.log >&2")
github.wait_for_unit("httpd.service")
github.wait_for_unit("network-online.target")
github.wait_for_unit("network-addresses-eth1.service")
client.wait_for_unit("network-online.target")
client.wait_for_unit("network-addresses-eth1.service")
client.succeed("curl -v https://github.com/ >&2")
out = client.succeed("nix registry list")
print(out)

View file

@ -70,9 +70,9 @@ in
server.copy_from_host("key.pub", "/root/.ssh/authorized_keys")
server.wait_for_unit("sshd")
server.wait_for_unit("multi-user.target")
server.wait_for_unit("network-online.target")
server.wait_for_unit("network-addresses-eth1.service")
client.wait_for_unit("network-online.target")
client.wait_for_unit("network-addresses-eth1.service")
client.succeed(f"ssh -o StrictHostKeyChecking=no {server.name} 'echo hello world'")
# Copy the closure of package A from the client to the server.

View file

@ -79,9 +79,9 @@ in
server.wait_for_unit("sshd")
server.wait_for_unit("multi-user.target")
server.wait_for_unit("network-online.target")
server.wait_for_unit("network-addresses-eth1.service")
client.wait_for_unit("network-online.target")
client.wait_for_unit("network-addresses-eth1.service")
client.wait_for_unit("getty@tty1.service")
# Either the prompt: ]#
# or an OCR misreading of it: 1#

View file

@ -61,7 +61,7 @@ in
{ nodes }:
''
cache.wait_for_unit("harmonia.service")
cache.wait_for_unit("network-online.target")
cache.wait_for_unit("network-addresses-eth1.service")
machine.succeed("mkdir -p /etc/containers")
machine.succeed("""echo '{"default":[{"type":"insecureAcceptAnything"}]}' > /etc/containers/policy.json""")

View file

@ -145,7 +145,7 @@ in
testScript =
{ nodes, ... }:
''
http_dns.wait_for_unit("network-online.target")
http_dns.wait_for_unit("network-addresses-eth1.service")
http_dns.wait_for_unit("nginx")
http_dns.wait_for_open_port(80)
http_dns.wait_for_unit("unbound")
@ -153,7 +153,7 @@ in
client.start()
client.wait_for_unit('multi-user.target')
client.wait_for_unit('network-online.target')
client.wait_for_unit('network-addresses-eth1.service')
with subtest("can fetch data from a remote server outside sandbox"):
client.succeed("nix --version >&2")

View file

@ -102,12 +102,12 @@ in
client.succeed("chmod 600 /root/.ssh/id_ed25519")
# Install the SSH key on the builder.
client.wait_for_unit("network-online.target")
client.wait_for_unit("network-addresses-eth1.service")
builder.succeed("mkdir -p -m 700 /root/.ssh")
builder.copy_from_host("key.pub", "/root/.ssh/authorized_keys")
builder.wait_for_unit("sshd")
builder.wait_for_unit("multi-user.target")
builder.wait_for_unit("network-online.target")
builder.wait_for_unit("network-addresses-eth1.service")
client.succeed(f"ssh -o StrictHostKeyChecking=no {builder.name} 'echo hello world'")

View file

@ -123,12 +123,12 @@ in
client.succeed("chmod 600 /root/.ssh/id_ed25519")
# Install the SSH key on the builders.
client.wait_for_unit("network-online.target")
client.wait_for_unit("network-addresses-eth1.service")
for builder in [builder1, builder2]:
builder.succeed("mkdir -p -m 700 /root/.ssh")
builder.copy_from_host("key.pub", "/root/.ssh/authorized_keys")
builder.wait_for_unit("sshd")
builder.wait_for_unit("network-online.target")
builder.wait_for_unit("network-addresses-eth1.service")
# Make sure the builder can handle our login correctly
builder.wait_for_unit("multi-user.target")
# Make sure there's no funny business on the client either

View file

@ -67,14 +67,14 @@ in
# Create a binary cache.
server.wait_for_unit("minio")
server.wait_for_unit("network-online.target")
server.wait_for_unit("network-addresses-eth1.service")
server.succeed("mc config host add minio http://localhost:9000 ${accessKey} ${secretKey} --api s3v4")
server.succeed("mc mb minio/my-cache")
server.succeed("${env} nix copy --to '${storeUrl}' ${pkgA}")
client.wait_for_unit("network-online.target")
client.wait_for_unit("network-addresses-eth1.service")
# Test fetchurl on s3:// URLs while we're at it.
client.succeed("${env} nix eval --impure --expr 'builtins.fetchurl { name = \"foo\"; url = \"s3://my-cache/nix-cache-info?endpoint=http://server:9000&region=eu-west-1\"; }'")

View file

@ -139,8 +139,8 @@ in
start_all()
sourcehut.wait_for_unit("httpd.service")
sourcehut.wait_for_unit("network-online.target")
client.wait_for_unit("network-online.target")
sourcehut.wait_for_unit("network-addresses-eth1.service")
client.wait_for_unit("network-addresses-eth1.service")
client.succeed("curl -v https://git.sr.ht/ >&2")
client.succeed("nix registry list | grep nixpkgs")