Merge pull request #1460 from NixOS/nix-2.27

Nix 2.27
This commit is contained in:
John Ericson 2025-04-07 11:37:43 -04:00 committed by GitHub
commit 257b211832
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 20 additions and 14 deletions

15
flake.lock generated
View File

@ -12,16 +12,16 @@
"nixpkgs-regression": []
},
"locked": {
"lastModified": 1739899400,
"narHash": "sha256-q/RgA4bB7zWai4oPySq9mch7qH14IEeom2P64SXdqHs=",
"lastModified": 1744029599,
"narHash": "sha256-u6RhBWQ1XohTZ4Ub5ml1PTcaxQgtqFNng6Sohy1rojw=",
"owner": "NixOS",
"repo": "nix",
"rev": "e310c19a1aeb1ce1ed4d41d5ab2d02db596e0918",
"rev": "d0f98c76f962147610489e84c10033ca92e9c532",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "2.26-maintenance",
"ref": "2.27-maintenance",
"repo": "nix",
"type": "github"
}
@ -29,15 +29,16 @@
"nix-eval-jobs": {
"flake": false,
"locked": {
"lastModified": 1743008255,
"narHash": "sha256-Lo4KFBNcY8tmBuCmEr2XV0IUZtxXHmbXPNLkov/QSU0=",
"lastModified": 1744009874,
"narHash": "sha256-PypQspB7h7EENe4RQQUQj2Ay8J1+O49AKNO9JbAU4Ek=",
"owner": "nix-community",
"repo": "nix-eval-jobs",
"rev": "f7418fc1fa45b96d37baa95ff3c016dd5be3876b",
"rev": "62f9c9e8d00d2ff6ab27a6197ab459a8e0808e59",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "v2.27.0",
"repo": "nix-eval-jobs",
"type": "github"
}

View File

@ -4,7 +4,7 @@
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11-small";
inputs.nix = {
url = "github:NixOS/nix/2.26-maintenance";
url = "github:NixOS/nix/2.27-maintenance";
inputs.nixpkgs.follows = "nixpkgs";
# hide nix dev tooling from our lock file
@ -16,7 +16,7 @@
};
inputs.nix-eval-jobs = {
url = "github:nix-community/nix-eval-jobs";
url = "github:nix-community/nix-eval-jobs/v2.27.0";
# We want to control the deps precisely
flake = false;
};

View File

@ -1,6 +1,7 @@
#include "state.hh"
#include "hydra-build-result.hh"
#include "globals.hh"
#include "parsed-derivations.hh"
#include <cstring>
@ -463,14 +464,17 @@ Step::ptr State::createStep(ref<Store> destStore,
it's not runnable yet, and other threads won't make it
runnable while step->created == false. */
step->drv = std::make_unique<Derivation>(localStore->readDerivation(drvPath));
step->parsedDrv = std::make_unique<ParsedDerivation>(drvPath, *step->drv);
{
auto parsedDrv = ParsedDerivation{drvPath, *step->drv};
step->drvOptions = std::make_unique<DerivationOptions>(DerivationOptions::fromParsedDerivation(parsedDrv));
}
step->preferLocalBuild = step->parsedDrv->willBuildLocally(*localStore);
step->preferLocalBuild = step->drvOptions->willBuildLocally(*localStore, *step->drv);
step->isDeterministic = getOr(step->drv->env, "isDetermistic", "0") == "1";
step->systemType = step->drv->platform;
{
StringSet features = step->requiredSystemFeatures = step->parsedDrv->getRequiredSystemFeatures();
StringSet features = step->requiredSystemFeatures = step->drvOptions->getRequiredSystemFeatures(*step->drv);
if (step->preferLocalBuild)
features.insert("local");
if (!features.empty()) {

View File

@ -13,7 +13,8 @@
#include "db.hh"
#include "parsed-derivations.hh"
#include "derivations.hh"
#include "derivation-options.hh"
#include "pathlocks.hh"
#include "pool.hh"
#include "build-result.hh"
@ -167,7 +168,7 @@ struct Step
nix::StorePath drvPath;
std::unique_ptr<nix::Derivation> drv;
std::unique_ptr<nix::ParsedDerivation> parsedDrv;
std::unique_ptr<nix::DerivationOptions> drvOptions;
std::set<std::string> requiredSystemFeatures;
bool preferLocalBuild;
bool isDeterministic;