Skip to content

Commit 78d77c5

Browse files
authored
Merge pull request #419 from nix-community/skipped-builds
Skip builds fully to avoid delays from worker setup
2 parents de493ea + 3cc5dca commit 78d77c5

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

buildbot_nix/buildbot_nix/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from buildbot.locks import MasterLock
2222
from buildbot.plugins import schedulers, steps, util, worker
2323
from buildbot.process import buildstep, logobserver, remotecommand
24+
from buildbot.process.build import Build
2425
from buildbot.process.project import Project
2526
from buildbot.process.properties import Properties
2627
from buildbot.process.results import ALL_RESULTS, SUCCESS, statusToString, worst_status
@@ -1145,7 +1146,7 @@ def nix_eval_config(
11451146

11461147

11471148
async def do_register_gcroot_if(
1148-
s: steps.BuildStep, branch_config: models.BranchConfigDict
1149+
s: steps.BuildStep | Build, branch_config: models.BranchConfigDict
11491150
) -> bool:
11501151
gc_root = await util.Interpolate(
11511152
"/nix/var/nix/gcroots/per-user/buildbot-worker/%(prop:project)s/%(prop:attr)s"
@@ -1384,8 +1385,8 @@ def nix_skipped_build_config(
13841385
collapseRequests=False,
13851386
env={},
13861387
factory=factory,
1387-
# FIXME: we can enable this after the next buildbot update.
1388-
# do_build_if=lambda build: do_register_gcroot_if(build, branch_config_dict) and outputs_path is not None,
1388+
do_build_if=lambda build: do_register_gcroot_if(build, branch_config_dict)
1389+
and outputs_path is not None,
13891390
)
13901391

13911392

nix/packages.nix

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,15 @@ in
1818

1919
buildbot = lib.mkOption {
2020
type = lib.types.package;
21-
default = pkgs.buildbot;
21+
default = pkgs.buildbot.overrideAttrs (o: {
22+
patches = o.patches ++ [
23+
(pkgs.fetchpatch {
24+
name = "add-Build.skipBuildIf.patch";
25+
url = "https://github.com/buildbot/buildbot/commit/f08eeef96e15c686a4f6ad52368ad08246314751.patch";
26+
hash = "sha256-ACPYXMbjIfw02gsKwmDKIIZkGSxxLWCaW7ceEcgbtIU=";
27+
})
28+
];
29+
});
2230
};
2331

2432
buildbot-worker = lib.mkOption {

0 commit comments

Comments
 (0)