diff --git a/buildbot_nix/__init__.py b/buildbot_nix/__init__.py index 34ae933..3f5fd19 100644 --- a/buildbot_nix/__init__.py +++ b/buildbot_nix/__init__.py @@ -377,6 +377,9 @@ def nix_eval_config( haltOnFailure=True, ), ) + drv_gcroots_dir = util.Interpolate( + "/nix/var/nix/gcroots/per-user/buildbot-worker/%(prop:project)s/drvs/", + ) factory.addStep( NixEvalCommand( @@ -393,8 +396,7 @@ def nix_eval_config( "accept-flake-config", "true", "--gc-roots-dir", - # FIXME: don't hardcode this - "/var/lib/buildbot-worker/gcroot", + drv_gcroots_dir, "--force-recurse", "--check-cache-status", "--flake", @@ -405,6 +407,17 @@ def nix_eval_config( ), ) + factory.addStep( + steps.ShellCommand( + name="Cleanup drv paths", + command=[ + "rm", + "-rf", + drv_gcroots_dir, + ], + ), + ) + return util.BuilderConfig( name=f"{project.name}/nix-eval", workernames=worker_names, diff --git a/nix/master.nix b/nix/master.nix index 8057f06..6383d5e 100644 --- a/nix/master.nix +++ b/nix/master.nix @@ -234,8 +234,11 @@ in }; }; - # Allow buildbot-master to write to this directory - systemd.tmpfiles.rules = lib.optional (cfg.outputsPath != null) + systemd.tmpfiles.rules = [ + # delete legacy gcroot location, can be dropped after 2024-06-01 + "R /var/lib/buildbot-worker/gcroot - - - - -" + ] ++ lib.optional (cfg.outputsPath != null) + # Allow buildbot-master to write to this directory "d ${cfg.outputsPath} 0755 buildbot buildbot - -"; }; }