diff --git a/flake.lock b/flake.lock index 42977f3..f4e0bf9 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1680392223, - "narHash": "sha256-n3g7QFr85lDODKt250rkZj2IFS3i4/8HBU2yKHO3tqw=", + "lastModified": 1685662779, + "narHash": "sha256-cKDDciXGpMEjP1n6HlzKinN0H+oLmNpgeCTzYnsA2po=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "dcc36e45d054d7bb554c9cdab69093debd91a0b5", + "rev": "71fb97f0d875fd4de4994dfb849f2c75e17eb6c3", "type": "github" }, "original": { @@ -22,11 +22,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1681347147, - "narHash": "sha256-B+hTioRc3Jdf4SJyeCiO0fW5ShIznJk2OTiW2vOV+mc=", + "lastModified": 1686186815, + "narHash": "sha256-h6OTafX2eLgFQpu5yJf65JHDKrEVoMLLtTn8ksu1+qE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "1a9d9175ecc48ecd033062fa09b1834d13ae9c69", + "rev": "5715d6b452b97d12c6f9077321d202a0cb50b8fc", "type": "github" }, "original": { diff --git a/src/meson.build b/src/meson.build index ef01a7d..f8fb528 100644 --- a/src/meson.build +++ b/src/meson.build @@ -13,4 +13,4 @@ executable('nix-eval-jobs', src, threads_dep ], install: true, - cpp_args: ['-std=c++17', '-fvisibility=hidden']) + cpp_args: ['-std=c++2a', '-fvisibility=hidden']) diff --git a/src/nix-eval-jobs.cc b/src/nix-eval-jobs.cc index 62f14fe..2fce82c 100644 --- a/src/nix-eval-jobs.cc +++ b/src/nix-eval-jobs.cc @@ -84,11 +84,11 @@ struct MyArgs : MixEvalArgs, MixCommonArgs { .labels = {"path"}, .handler = {&gcRootsDir}}); - addFlag( - {.longName = "workers", - .description = "number of evaluate workers", - .labels = {"workers"}, - .handler = {[=](std::string s) { nrWorkers = std::stoi(s); }}}); + addFlag({.longName = "workers", + .description = "number of evaluate workers", + .labels = {"workers"}, + .handler = { + [=, this](std::string s) { nrWorkers = std::stoi(s); }}}); addFlag( {.longName = "max-memory-size", @@ -96,7 +96,7 @@ struct MyArgs : MixEvalArgs, MixCommonArgs { "maximum evaluation memory size (4GiB per worker by default)", .labels = {"size"}, .handler = { - [=](std::string s) { maxMemorySize = std::stoi(s); }}}); + [=, this](std::string s) { maxMemorySize = std::stoi(s); }}}); addFlag({.longName = "flake", .description = "build a flake", @@ -140,7 +140,8 @@ static Value *releaseExprTopLevelValue(EvalState &state, Bindings &autoArgs) { Value vTop; if (myArgs.fromArgs) { - Expr *e = state.parseExprFromString(myArgs.releaseExpr, absPath(".")); + Expr *e = state.parseExprFromString( + myArgs.releaseExpr, state.rootPath(CanonPath::fromCwd())); state.eval(e, vTop); } else { state.evalFile(lookupFileArg(state, myArgs.releaseExpr), vTop); @@ -202,7 +203,7 @@ struct Drv { if (myArgs.meta) { nlohmann::json meta_; for (auto &metaName : drvInfo.queryMetaNames()) { - PathSet context; + NixStringContext context; std::stringstream ss; auto metaValue = drvInfo.queryMeta(metaName);