Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nix 2.25 #339

Merged
merged 17 commits into from
Nov 25, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
declare explicit const when possible
Mic92 committed Nov 25, 2024
commit a6c535c9e509897181eae6cb3e6650a8d51e1d0b
4 changes: 2 additions & 2 deletions src/nix-eval-jobs.cc
Original file line number Diff line number Diff line change
@@ -469,7 +469,7 @@ auto main(int argc, char **argv) -> int {
job_json["constituents"] = nlohmann::json::array();
}
std::vector<std::string> errors;
for (auto child : *namedConstituents) {
for (const auto &child : *namedConstituents) {
auto childJob = state->jobs.find(child);
if (childJob == state->jobs.end()) {
broken = true;
@@ -522,7 +522,7 @@ auto main(int argc, char **argv) -> int {
nix::writeDerivation(*store, drvAggregate));

if (myArgs.gcRootsDir != "") {
nix::Path root =
const nix::Path root =
myArgs.gcRootsDir + "/" +
std::string(nix::baseNameOf(newDrvPath));
if (!nix::pathExists(root)) {
6 changes: 3 additions & 3 deletions src/worker.cc
Original file line number Diff line number Diff line change
@@ -147,13 +147,13 @@ void worker(
if (args.constituents) {
std::vector<std::string> constituents;
std::vector<std::string> namedConstituents;
auto a = v->attrs()->get(
const auto *a = v->attrs()->get(
state->symbols.create("_hydraAggregate"));
if (a &&
state->forceBool(*a->value, a->pos,
"while evaluating the "
"`_hydraAggregate` attribute")) {
auto a = v->attrs()->get(
const auto *a = v->attrs()->get(
state->symbols.create("constituents"));
if (!a)
state
@@ -167,7 +167,7 @@ void worker(
a->pos, *a->value, context,
"while evaluating the `constituents` attribute",
true, false);
for (auto &c : context)
for (const auto &c : context) {
std::visit(
nix::overloaded{
[&](const nix::NixStringContextElem::