diff --git a/crates.nix b/crates.nix index 8485867..979fb5e 100644 --- a/crates.nix +++ b/crates.nix @@ -18,7 +18,7 @@ buildInputs = with pkgs; [ boost nlohmann_json - nixVersions.nix_2_24.dev + nixVersions.nix_2_30.dev ]; configurePhase = "meson setup build"; diff --git a/flake.lock b/flake.lock index a52e08b..e013ea4 100644 --- a/flake.lock +++ b/flake.lock @@ -27,11 +27,11 @@ "pyproject-nix": "pyproject-nix" }, "locked": { - "lastModified": 1732214960, - "narHash": "sha256-ViyEMSYwaza6y55XTDrsRi2K4YKCLsefMTorjWSE27s=", + "lastModified": 1754978539, + "narHash": "sha256-nrDovydywSKRbWim9Ynmgj8SBm8LK3DI2WuhIqzOHYI=", "owner": "nix-community", "repo": "dream2nix", - "rev": "a8dac99db44307fdecead13a39c584b97812d0d4", + "rev": "fbec3263cb4895ac86ee9506cdc4e6919a1a2214", "type": "github" }, "original": { @@ -85,11 +85,11 @@ "treefmt": "treefmt" }, "locked": { - "lastModified": 1732342495, - "narHash": "sha256-7qfvmnJQByEtl5bS+rTydLCe3Saz9kMRaJxPCdqb1wQ=", + "lastModified": 1755152426, + "narHash": "sha256-N0AUDNEk88ziaj15jAD2mQwC8k1jOVNjRAq6eIEPccQ=", "owner": "yusdacra", "repo": "nix-cargo-integration", - "rev": "ae9de2d06519a3bb26b649e1c0d1cfa22c20dc0e", + "rev": "00a91faa90c1160dab90467a63efd470a155fd63", "type": "github" }, "original": { @@ -100,11 +100,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1732014248, - "narHash": "sha256-y/MEyuJ5oBWrWAic/14LaIr/u5E0wRVzyYsouYY3W6w=", + "lastModified": 1755027561, + "narHash": "sha256-IVft239Bc8p8Dtvf7UAACMG5P3ZV+3/aO28gXpGtMXI=", "owner": "nixos", "repo": "nixpkgs", - "rev": "23e89b7da85c3640bbc2173fe04f4bd114342367", + "rev": "005433b926e16227259a1843015b5b2b7f7d1fc3", "type": "github" }, "original": { @@ -122,11 +122,11 @@ ] }, "locked": { - "lastModified": 1730504689, - "narHash": "sha256-hgmguH29K2fvs9szpq2r3pz2/8cJd2LPS+b4tfNFCwE=", + "lastModified": 1754487366, + "narHash": "sha256-pHYj8gUBapuUzKV/kN/tR3Zvqc7o6gdFB9XKXIp1SQ8=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "506278e768c2a08bec68eb62932193e341f55c90", + "rev": "af66ad14b28a127c5c0f3bbb298218fc63528a18", "type": "github" }, "original": { @@ -142,11 +142,11 @@ ] }, "locked": { - "lastModified": 1730504689, - "narHash": "sha256-hgmguH29K2fvs9szpq2r3pz2/8cJd2LPS+b4tfNFCwE=", + "lastModified": 1754487366, + "narHash": "sha256-pHYj8gUBapuUzKV/kN/tR3Zvqc7o6gdFB9XKXIp1SQ8=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "506278e768c2a08bec68eb62932193e341f55c90", + "rev": "af66ad14b28a127c5c0f3bbb298218fc63528a18", "type": "github" }, "original": { @@ -180,18 +180,23 @@ } }, "pyproject-nix": { - "flake": false, + "inputs": { + "nixpkgs": [ + "nci", + "dream2nix", + "nixpkgs" + ] + }, "locked": { - "lastModified": 1702448246, - "narHash": "sha256-hFg5s/hoJFv7tDpiGvEvXP0UfFvFEDgTdyHIjDVHu1I=", - "owner": "davhau", + "lastModified": 1752481895, + "narHash": "sha256-luVj97hIMpCbwhx3hWiRwjP2YvljWy8FM+4W9njDhLA=", + "owner": "pyproject-nix", "repo": "pyproject.nix", - "rev": "5a06a2697b228c04dd2f35659b4b659ca74f7aeb", + "rev": "16ee295c25107a94e59a7fc7f2e5322851781162", "type": "github" }, "original": { - "owner": "davhau", - "ref": "dream2nix", + "owner": "pyproject-nix", "repo": "pyproject.nix", "type": "github" } @@ -211,11 +216,11 @@ ] }, "locked": { - "lastModified": 1732328983, - "narHash": "sha256-RHt12f/slrzDpSL7SSkydh8wUE4Nr4r23HlpWywed9E=", + "lastModified": 1755139244, + "narHash": "sha256-SN1BFA00m+siVAQiGLtTwjv9LV9TH5n8tQcSziV6Nv4=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "ed8aa5b64f7d36d9338eb1d0a3bb60cf52069a72", + "rev": "aeae248beb2a419e39d483dd9b7fec924aba8d4d", "type": "github" }, "original": { @@ -255,11 +260,11 @@ ] }, "locked": { - "lastModified": 1732292307, - "narHash": "sha256-5WSng844vXt8uytT5djmqBCkopyle6ciFgteuA9bJpw=", + "lastModified": 1754847726, + "narHash": "sha256-2vX8QjO5lRsDbNYvN9hVHXLU6oMl+V/PsmIiJREG4rE=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "705df92694af7093dfbb27109ce16d828a79155f", + "rev": "7d81f6fb2e19bf84f1c65135d1060d829fae2408", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index c58feb1..f8f542b 100644 --- a/flake.nix +++ b/flake.nix @@ -35,7 +35,7 @@ boost meson nlohmann_json - nixVersions.nix_2_24.dev + nixVersions.nix_2_30.dev ]); }); packages.default = crateOutputs.packages.release; diff --git a/worker/inspector.cc b/worker/inspector.cc index 83280ec..c071ee8 100644 --- a/worker/inspector.cc +++ b/worker/inspector.cc @@ -1,22 +1,23 @@ #include "inspector.hh" -#include - #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include "logging.hh" +#include const auto MAX_SIZE = 32768; @@ -82,7 +83,7 @@ std::shared_ptr NixInspector::inspect(std::string &attrPath) { return std::make_shared(vRes); } -int32_t NixInspector::v_int(const Value &value) { return value.integer(); } +int32_t NixInspector::v_int(const Value &value) { return value.integer().value; } float_t NixInspector::v_float(const Value &value) { return value.fpoint(); } bool NixInspector::v_bool(const Value &value) { return value.boolean(); } std::string NixInspector::v_string(const Value &value) { @@ -113,7 +114,7 @@ nlohmann::json NixInspector::v_repr(const Value &value) { case nix::nFloat: return value.fpoint(); case nix::nInt: - return value.integer(); + return value.integer().value; case nix::nNull: return nullptr; case nix::nExternal: @@ -136,7 +137,8 @@ nlohmann::json NixInspector::v_repr(const Value &value) { // } std::unique_ptr> NixInspector::v_list(const Value &value) { auto collected = std::vector(); - for (auto x : value.listItems()) { + auto listItems = value.listView(); + for (auto x : listItems) { collected.emplace_back(*x); } return std::make_unique>(collected); @@ -144,8 +146,8 @@ std::unique_ptr> NixInspector::v_list(const Value &value) { void init_nix_inspector() { nix::initNix(); nix::initGC(); - nix::flake::initLib(nix::flakeSettings); - logger = new CaptureLogger(); + nix::flakeSettings.configureEvalSettings(nix::evalSettings); + logger = std::make_unique(); } ValueType NixInspector::v_type(const Value &value) { return value.type(); } diff --git a/worker/inspector.hh b/worker/inspector.hh index 911ee9f..9521f2a 100644 --- a/worker/inspector.hh +++ b/worker/inspector.hh @@ -1,15 +1,12 @@ #pragma once -#include - #include -#include - -#include "command.hh" -#include "eval.hh" -#include "nixexpr.hh" -#include "types.hh" -#include "value.hh" +#include +#include +#include +#include +#include +#include using Value = nix::Value; struct NixInspector;