1
0
Fork 0
mirror of https://github.com/NixOS/hydra.git synced 2024-10-17 16:37:26 -04:00

Compare commits

..

1 commit

Author SHA1 Message Date
RichardWarfield 8d3be6b48e
Merge 29fafeb1d8 into 95003f2eb5 2024-09-26 12:41:47 +00:00
7 changed files with 68 additions and 89 deletions

View file

@ -37,50 +37,33 @@
"type": "github" "type": "github"
} }
}, },
"git-hooks-nix": { "flake-utils": {
"inputs": {
"flake-compat": [
"nix"
],
"gitignore": [
"nix"
],
"nixpkgs": [
"nix",
"nixpkgs"
],
"nixpkgs-stable": [
"nix",
"nixpkgs"
]
},
"locked": { "locked": {
"lastModified": 1726745158, "lastModified": 1667395993,
"narHash": "sha256-D5AegvGoEjt4rkKedmxlSEmC+nNLMBPWFxvmYnVLhjk=", "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "cachix", "owner": "numtide",
"repo": "git-hooks.nix", "repo": "flake-utils",
"rev": "4e743a6920eab45e8ba0fbe49dc459f1423a4b74", "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "cachix", "owner": "numtide",
"repo": "git-hooks.nix", "repo": "flake-utils",
"type": "github" "type": "github"
} }
}, },
"libgit2": { "libgit2": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1715853528, "lastModified": 1697646580,
"narHash": "sha256-J2rCxTecyLbbDdsyBWn9w7r3pbKRMkI9E7RvRgAqBdY=", "narHash": "sha256-oX4Z3S9WtJlwvj0uH9HlYcWv+x1hqp8mhXl7HsLu2f0=",
"owner": "libgit2", "owner": "libgit2",
"repo": "libgit2", "repo": "libgit2",
"rev": "36f7e21ad757a3dacc58cf7944329da6bc1d6e96", "rev": "45fd9ed7ae1a9b74b957ef4f337bc3c8b3df01b5",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "libgit2", "owner": "libgit2",
"ref": "v1.8.1",
"repo": "libgit2", "repo": "libgit2",
"type": "github" "type": "github"
} }
@ -89,61 +72,44 @@
"inputs": { "inputs": {
"flake-compat": "flake-compat", "flake-compat": "flake-compat",
"flake-parts": "flake-parts", "flake-parts": "flake-parts",
"git-hooks-nix": "git-hooks-nix",
"libgit2": "libgit2", "libgit2": "libgit2",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
], ],
"nixpkgs-23-11": "nixpkgs-23-11", "nixpkgs-regression": "nixpkgs-regression",
"nixpkgs-regression": "nixpkgs-regression" "pre-commit-hooks": "pre-commit-hooks"
}, },
"locked": { "locked": {
"lastModified": 1726787955, "lastModified": 1727132408,
"narHash": "sha256-XFznzb8L4SdUm9u+w3DPpMWJhffuv+/6+aiVl00slns=", "narHash": "sha256-esYY9tT7Q79rG4+Xvf32L3AZvVGgdVeT1n0uK6Gd6ls=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nix", "repo": "nix",
"rev": "a7fdef6858dd45b9d7bda7c92324c63faee7f509", "rev": "5ffd239adc9b7fddca7a2a59a8b87da5af14ec4d",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "NixOS",
"ref": "2.24-maintenance", "ref": "2.23-maintenance",
"repo": "nix", "repo": "nix",
"type": "github" "type": "github"
} }
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1726688310, "lastModified": 1712848736,
"narHash": "sha256-Xc9lEtentPCEtxc/F1e6jIZsd4MPDYv4Kugl9WtXlz0=", "narHash": "sha256-CzZwhqyLlebljv1zFS2KWVH/3byHND0LfaO1jKsGuVo=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "dbebdd67a6006bb145d98c8debf9140ac7e651d0", "rev": "1d6a23f11e44d0fb64b3237569b87658a9eb5643",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "NixOS",
"ref": "nixos-24.05-small", "ref": "nixos-23.11-small",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
}, },
"nixpkgs-23-11": {
"locked": {
"lastModified": 1717159533,
"narHash": "sha256-oamiKNfr2MS6yH64rUn99mIZjc45nGJlj9eGth/3Xuw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "a62e6edd6d5e1fa0329b8653c801147986f8d446",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "a62e6edd6d5e1fa0329b8653c801147986f8d446",
"type": "github"
}
},
"nixpkgs-regression": { "nixpkgs-regression": {
"locked": { "locked": {
"lastModified": 1643052045, "lastModified": 1643052045,
@ -160,6 +126,38 @@
"type": "github" "type": "github"
} }
}, },
"pre-commit-hooks": {
"inputs": {
"flake-compat": [
"nix"
],
"flake-utils": "flake-utils",
"gitignore": [
"nix"
],
"nixpkgs": [
"nix",
"nixpkgs"
],
"nixpkgs-stable": [
"nix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1712897695,
"narHash": "sha256-nMirxrGteNAl9sWiOhoN5tIHyjBbVi5e2tgZUgZlK3Y=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "40e6053ecb65fcbf12863338a6dcefb3f55f1bf8",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"nix": "nix", "nix": "nix",

View file

@ -1,8 +1,8 @@
{ {
description = "A Nix-based continuous build system"; description = "A Nix-based continuous build system";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05-small"; inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11-small";
inputs.nix.url = "github:NixOS/nix/2.24-maintenance"; inputs.nix.url = "github:NixOS/nix/2.23-maintenance";
inputs.nix.inputs.nixpkgs.follows = "nixpkgs"; inputs.nix.inputs.nixpkgs.follows = "nixpkgs";
outputs = { self, nixpkgs, nix }: outputs = { self, nixpkgs, nix }:
@ -25,7 +25,6 @@
hydra = final.callPackage ./package.nix { hydra = final.callPackage ./package.nix {
inherit (nixpkgs.lib) fileset; inherit (nixpkgs.lib) fileset;
rawSrc = self; rawSrc = self;
nix-perl-bindings = final.nixComponents.nix-perl-bindings;
}; };
}; };

View file

@ -9,7 +9,6 @@
, perlPackages , perlPackages
, nix , nix
, nix-perl-bindings
, git , git
, makeWrapper , makeWrapper
@ -60,7 +59,7 @@ let
name = "hydra-perl-deps"; name = "hydra-perl-deps";
paths = lib.closePropagation paths = lib.closePropagation
([ ([
nix-perl-bindings nix.perl-bindings
git git
] ++ (with perlPackages; [ ] ++ (with perlPackages; [
AuthenSASL AuthenSASL

View file

@ -1,5 +1,5 @@
bin_PROGRAMS = hydra-eval-jobs bin_PROGRAMS = hydra-eval-jobs
hydra_eval_jobs_SOURCES = hydra-eval-jobs.cc hydra_eval_jobs_SOURCES = hydra-eval-jobs.cc
hydra_eval_jobs_LDADD = $(NIX_LIBS) -lnixcmd -lnixflake hydra_eval_jobs_LDADD = $(NIX_LIBS) -lnixcmd
hydra_eval_jobs_CXXFLAGS = $(NIX_CFLAGS) -I ../libhydra hydra_eval_jobs_CXXFLAGS = $(NIX_CFLAGS) -I ../libhydra

View file

@ -6,7 +6,6 @@
#include "shared.hh" #include "shared.hh"
#include "store-api.hh" #include "store-api.hh"
#include "eval.hh" #include "eval.hh"
#include "eval-gc.hh"
#include "eval-inline.hh" #include "eval-inline.hh"
#include "eval-settings.hh" #include "eval-settings.hh"
#include "signals.hh" #include "signals.hh"
@ -126,14 +125,11 @@ static void worker(
if (myArgs.flake) { if (myArgs.flake) {
using namespace flake; using namespace flake;
auto [flakeRef, fragment, outputSpec] = parseFlakeRefWithFragmentAndExtendedOutputsSpec(fetchSettings, myArgs.releaseExpr, absPath(".")); auto flakeRef = parseFlakeRef(myArgs.releaseExpr);
auto vFlake = state.allocValue(); auto vFlake = state.allocValue();
auto lockedFlake = lockFlake( auto lockedFlake = lockFlake(state, flakeRef,
flakeSettings,
state,
flakeRef,
LockFlags { LockFlags {
.updateLockFile = false, .updateLockFile = false,
.useRegistries = false, .useRegistries = false,
@ -372,11 +368,7 @@ int main(int argc, char * * argv)
]() ]()
{ {
try { try {
auto evalStore = myArgs.evalStoreUrl EvalState state(myArgs.lookupPath, openStore());
? openStore(*myArgs.evalStoreUrl)
: openStore();
EvalState state(myArgs.lookupPath,
evalStore, fetchSettings, evalSettings);
Bindings & autoArgs = *myArgs.getAutoArgs(state); Bindings & autoArgs = *myArgs.getAutoArgs(state);
worker(state, autoArgs, *to, *from); worker(state, autoArgs, *to, *from);
} catch (Error & e) { } catch (Error & e) {

View file

@ -2,7 +2,6 @@
#include <cmath> #include <cmath>
#include <thread> #include <thread>
#include <unordered_map> #include <unordered_map>
#include <unordered_set>
#include "state.hh" #include "state.hh"

View file

@ -54,40 +54,32 @@ struct Extractor : FileSystemObjectSink
}; };
NarMemberDatas & members; NarMemberDatas & members;
std::filesystem::path prefix; Path prefix;
Path toKey(const CanonPath & path)
{
std::filesystem::path p = prefix;
// Conditional to avoid trailing slash
if (!path.isRoot()) p /= path.rel();
return p;
}
Extractor(NarMemberDatas & members, const Path & prefix) Extractor(NarMemberDatas & members, const Path & prefix)
: members(members), prefix(prefix) : members(members), prefix(prefix)
{ } { }
void createDirectory(const CanonPath & path) override void createDirectory(const Path & path) override
{ {
members.insert_or_assign(toKey(path), NarMemberData { .type = SourceAccessor::Type::tDirectory }); members.insert_or_assign(prefix + path, NarMemberData { .type = SourceAccessor::Type::tDirectory });
} }
void createRegularFile(const CanonPath & path, std::function<void(CreateRegularFileSink &)> func) override void createRegularFile(const Path & path, std::function<void(CreateRegularFileSink &)> func) override
{ {
NarMemberConstructor nmc { NarMemberConstructor nmc {
members.insert_or_assign(toKey(path), NarMemberData { members.insert_or_assign(prefix + path, NarMemberData {
.type = SourceAccessor::Type::tRegular, .type = SourceAccessor::Type::tRegular,
.fileSize = 0, .fileSize = 0,
.contents = filesToKeep.count(path.abs()) ? std::optional("") : std::nullopt, .contents = filesToKeep.count(path) ? std::optional("") : std::nullopt,
}).first->second, }).first->second,
}; };
func(nmc); func(nmc);
} }
void createSymlink(const CanonPath & path, const std::string & target) override void createSymlink(const Path & path, const std::string & target) override
{ {
members.insert_or_assign(toKey(path), NarMemberData { .type = SourceAccessor::Type::tSymlink }); members.insert_or_assign(prefix + path, NarMemberData { .type = SourceAccessor::Type::tSymlink });
} }
}; };