Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b254962aa8 | ||
|
|
281b49208c | ||
|
|
241ab71800 | ||
|
|
78ed8d7aa5 | ||
|
|
4bd941daa8 | ||
|
|
d7b40c4233 |
@@ -104,9 +104,9 @@ static void copyClosureTo(
|
||||
std::unique_lock<std::timed_mutex> sendLock(conn.machine->state->sendLock,
|
||||
std::chrono::seconds(600));
|
||||
|
||||
conn.importPaths(destStore, [&](Sink & sink) {
|
||||
exportPaths(destStore, missing, sink);
|
||||
});
|
||||
conn.to << ServeProto::Command::ImportPaths;
|
||||
exportPaths(destStore, missing, conn.to);
|
||||
conn.to.flush();
|
||||
|
||||
if (readInt(conn.from) != 1)
|
||||
throw Error("remote machine failed to import closure");
|
||||
@@ -301,10 +301,11 @@ static void copyPathFromRemote(
|
||||
lambda function only gets executed if someone tries to read
|
||||
from source2, we will send the command from here rather
|
||||
than outside the lambda. */
|
||||
conn.narFromPath(localStore, info.path, [&](Source & source) {
|
||||
TeeSource tee(source, sink);
|
||||
extractNarData(tee, localStore.printStorePath(info.path), narMembers);
|
||||
});
|
||||
conn.to << ServeProto::Command::DumpStorePath << localStore.printStorePath(info.path);
|
||||
conn.to.flush();
|
||||
|
||||
TeeSource tee(conn.from, sink);
|
||||
extractNarData(tee, localStore.printStorePath(info.path), narMembers);
|
||||
});
|
||||
|
||||
destStore.addToStore(info, *source2, NoRepair, NoCheckSigs);
|
||||
|
||||
@@ -18,9 +18,8 @@ tags) from GitHub following a certain naming scheme
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
This plugin reads the list of branches or tags using GitHub's REST API. The name
|
||||
of the reference must follow a particular prefix. This list is stored in the
|
||||
nix-store and used as an input to declarative jobsets.
|
||||
This plugin reads the list of branches or tags using GitHub's REST API. This
|
||||
list is stored in the nix-store and used as an input to declarative jobsets.
|
||||
|
||||
=head1 CONFIGURATION
|
||||
|
||||
@@ -34,7 +33,7 @@ The declarative project C<spec.json> file must contains an input such as
|
||||
|
||||
"pulls": {
|
||||
"type": "github_refs",
|
||||
"value": "[owner] [repo] heads|tags - [prefix]",
|
||||
"value": "[owner] [repo] [type] - [prefix]",
|
||||
"emailresponsible": false
|
||||
}
|
||||
|
||||
@@ -42,12 +41,11 @@ In the above snippet, C<[owner]> is the repository owner and C<[repo]> is the
|
||||
repository name. Also note a literal C<->, which is placed there for the future
|
||||
use.
|
||||
|
||||
C<heads|tags> denotes that one of these two is allowed, that is, the third
|
||||
position should hold either the C<heads> or the C<tags> keyword. In case of the former, the plugin
|
||||
will fetch all branches, while in case of the latter, it will fetch the tags.
|
||||
C<[type]> is the type of ref to list. Typical values are "heads", "tags", and
|
||||
"pull". "." will include all types.
|
||||
|
||||
C<prefix> denotes the prefix the reference name must start with, in order to be
|
||||
included.
|
||||
included. "." will include all references.
|
||||
|
||||
For example, C<"value": "nixos hydra heads - release/"> refers to
|
||||
L<https://github.com/nixos/hydra> repository, and will fetch all branches that
|
||||
@@ -102,8 +100,6 @@ sub fetchInput {
|
||||
return undef if $input_type ne "github_refs";
|
||||
|
||||
my ($owner, $repo, $type, $fut, $prefix) = split ' ', $value;
|
||||
die "type field is neither 'heads' nor 'tags', but '$type'"
|
||||
unless $type eq 'heads' or $type eq 'tags';
|
||||
|
||||
my $auth = $self->{config}->{github_authorization}->{$owner};
|
||||
my $githubEndpoint = $self->{config}->{github_endpoint} // "https://api.github.com";
|
||||
|
||||
@@ -358,21 +358,14 @@ sub evalJobs {
|
||||
my @cmd;
|
||||
|
||||
if (defined $flakeRef) {
|
||||
my $nix_expr =
|
||||
"let " .
|
||||
"flake = builtins.getFlake (toString \"$flakeRef\"); " .
|
||||
"in " .
|
||||
"flake.hydraJobs " .
|
||||
"or flake.checks " .
|
||||
"or (throw \"flake '$flakeRef' does not provide any Hydra jobs or checks\")";
|
||||
|
||||
@cmd = ("nix-eval-jobs",
|
||||
# Disable the eval cache to prevent SQLite database contention.
|
||||
# Since Hydra typically evaluates each revision only once,
|
||||
# parallel workers would compete for database locks without
|
||||
# providing any benefit from caching.
|
||||
"--option", "eval-cache", "false",
|
||||
"--expr", $nix_expr);
|
||||
"--flake", $flakeRef,
|
||||
"--select", "flake: flake.outputs.hydraJobs or flake.outputs.checks or (throw \"flake '$flakeRef' does not provide any Hydra jobs or checks\")");
|
||||
} else {
|
||||
my $nixExprInput = $inputInfo->{$nixExprInputName}->[0]
|
||||
or die "cannot find the input containing the job expression\n";
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
with import ./config.nix;
|
||||
{ system ? builtins.currentSystem }:
|
||||
|
||||
with import ./config.nix { inherit system; };
|
||||
{
|
||||
empty_dir =
|
||||
mkDerivation {
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
{ system ? builtins.currentSystem }:
|
||||
|
||||
rec {
|
||||
path = "@testPath@";
|
||||
|
||||
mkDerivation = args:
|
||||
derivation ({
|
||||
system = builtins.currentSystem;
|
||||
inherit system;
|
||||
PATH = path;
|
||||
} // args);
|
||||
mkContentAddressedDerivation = args: mkDerivation ({
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
{
|
||||
outputs = { ... }: {
|
||||
checks =
|
||||
import ./basic.nix;
|
||||
};
|
||||
outputs = { self, ... }:
|
||||
let
|
||||
systems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
|
||||
forAllSystems = f: builtins.listToAttrs (map (system: { name = system; value = f system; }) systems);
|
||||
in {
|
||||
checks = forAllSystems (system:
|
||||
import ./basic.nix { inherit system; }
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
{
|
||||
outputs = { ... }: {
|
||||
hydraJobs =
|
||||
import ./basic.nix;
|
||||
};
|
||||
outputs = { self, ... }:
|
||||
let
|
||||
systems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
|
||||
forAllSystems = f: builtins.listToAttrs (map (system: { name = system; value = f system; }) systems);
|
||||
in {
|
||||
hydraJobs = forAllSystems (system:
|
||||
import ./basic.nix { inherit system; }
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user