buildbot: move out of python3.pkgs

By moving it out we can start apply overrides to python dependendencies
starting with sqlalchemy.

This fixes the build with the current version.
This commit is contained in:
Jörg Thalheim 2023-04-07 18:34:08 +02:00
parent cd07e0258c
commit 90b750456e
13 changed files with 68 additions and 31 deletions

View File

@ -8,7 +8,8 @@ let
cfg = config.services.buildbot-master; cfg = config.services.buildbot-master;
opt = options.services.buildbot-master; opt = options.services.buildbot-master;
python = cfg.package.pythonModule; package = pkgs.python3.pkgs.toPythonModule cfg.package;
python = package.pythonModule;
escapeStr = escape [ "'" ]; escapeStr = escape [ "'" ];
@ -212,10 +213,10 @@ in {
package = mkOption { package = mkOption {
type = types.package; type = types.package;
default = pkgs.python3Packages.buildbot-full; default = pkgs.buildbot-full;
defaultText = literalExpression "pkgs.python3Packages.buildbot-full"; defaultText = literalExpression "pkgs.buildbot-full";
description = lib.mdDoc "Package to use for buildbot."; description = lib.mdDoc "Package to use for buildbot.";
example = literalExpression "pkgs.python3Packages.buildbot"; example = literalExpression "pkgs.buildbot";
}; };
packages = mkOption { packages = mkOption {
@ -255,7 +256,7 @@ in {
after = [ "network-online.target" ]; after = [ "network-online.target" ];
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
path = cfg.packages ++ cfg.pythonPackages python.pkgs; path = cfg.packages ++ cfg.pythonPackages python.pkgs;
environment.PYTHONPATH = "${python.withPackages (self: cfg.pythonPackages self ++ [ cfg.package ])}/${python.sitePackages}"; environment.PYTHONPATH = "${python.withPackages (self: cfg.pythonPackages self ++ [ package ])}/${python.sitePackages}";
preStart = '' preStart = ''
mkdir -vp "${cfg.buildbotDir}" mkdir -vp "${cfg.buildbotDir}"

View File

@ -8,7 +8,8 @@ let
cfg = config.services.buildbot-worker; cfg = config.services.buildbot-worker;
opt = options.services.buildbot-worker; opt = options.services.buildbot-worker;
python = cfg.package.pythonModule; package = pkgs.python3.pkgs.toPythonModule cfg.package;
python = package.pythonModule;
tacFile = pkgs.writeText "aur-buildbot-worker.tac" '' tacFile = pkgs.writeText "aur-buildbot-worker.tac" ''
import os import os
@ -129,7 +130,7 @@ in {
package = mkOption { package = mkOption {
type = types.package; type = types.package;
default = pkgs.python3Packages.buildbot-worker; default = pkgs.buildbot-worker;
defaultText = literalExpression "pkgs.python3Packages.buildbot-worker"; defaultText = literalExpression "pkgs.python3Packages.buildbot-worker";
description = lib.mdDoc "Package to use for buildbot worker."; description = lib.mdDoc "Package to use for buildbot worker.";
example = literalExpression "pkgs.python2Packages.buildbot-worker"; example = literalExpression "pkgs.python2Packages.buildbot-worker";
@ -168,7 +169,7 @@ in {
after = [ "network.target" "buildbot-master.service" ]; after = [ "network.target" "buildbot-master.service" ];
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
path = cfg.packages; path = cfg.packages;
environment.PYTHONPATH = "${python.withPackages (p: [ cfg.package ])}/${python.sitePackages}"; environment.PYTHONPATH = "${python.withPackages (p: [ package ])}/${python.sitePackages}";
preStart = '' preStart = ''
mkdir -vp "${cfg.buildbotDir}/info" mkdir -vp "${cfg.buildbotDir}/info"

View File

@ -23,7 +23,7 @@ import ./make-test-python.nix {
]; ];
}; };
networking.firewall.allowedTCPPorts = [ 8010 8011 9989 ]; networking.firewall.allowedTCPPorts = [ 8010 8011 9989 ];
environment.systemPackages = with pkgs; [ git python3Packages.buildbot-full ]; environment.systemPackages = with pkgs; [ git buildbot-full ];
}; };
bbworker = { pkgs, ... }: { bbworker = { pkgs, ... }: {
@ -31,7 +31,7 @@ import ./make-test-python.nix {
enable = true; enable = true;
masterUrl = "bbmaster:9989"; masterUrl = "bbmaster:9989";
}; };
environment.systemPackages = with pkgs; [ git python3Packages.buildbot-worker ]; environment.systemPackages = with pkgs; [ git buildbot-worker ];
}; };
gitrepo = { pkgs, ... }: { gitrepo = { pkgs, ... }: {

View File

@ -0,0 +1,42 @@
{ python3
, recurseIntoAttrs
, callPackage
}:
let
python = python3.override {
packageOverrides = self: super: {
sqlalchemy = super.sqlalchemy.overridePythonAttrs (oldAttrs: rec {
version = "1.4.40";
src = super.fetchPypi {
pname = "SQLAlchemy";
inherit version;
hash = "sha256-RKZgUGCAzJdeHfpXdv5fYxXdxiane1C/Du4YsDieomU=";
};
});
moto = super.moto.overridePythonAttrs (oldAttrs: rec {
# a lot of tests -> very slow, we already build them when building python packages
doCheck = false;
});
};
};
buildbot-pkg = python.pkgs.callPackage ./pkg.nix {
inherit buildbot;
};
buildbot-worker = python3.pkgs.callPackage ./worker.nix {
inherit buildbot;
};
buildbot = python.pkgs.callPackage ./master.nix {
inherit buildbot-pkg buildbot-worker buildbot-plugins;
};
buildbot-plugins = recurseIntoAttrs (callPackage ./plugins.nix {
inherit buildbot-pkg;
});
in
{
inherit buildbot buildbot-plugins buildbot-worker;
buildbot-ui = buildbot.withPlugins (with buildbot-plugins; [ www ]);
buildbot-full = buildbot.withPlugins (with buildbot-plugins; [
www console-view waterfall-view grid-view wsgi-dashboards badges
]);
}

View File

@ -1,6 +1,7 @@
{ lib { lib
, stdenv , stdenv
, buildPythonPackage , buildPythonPackage
, buildPythonApplication
, fetchPypi , fetchPypi
, makeWrapper , makeWrapper
, pythonOlder , pythonOlder
@ -25,17 +26,18 @@
, lz4 , lz4
, setuptoolsTrial , setuptoolsTrial
, buildbot-worker , buildbot-worker
, buildbot-pkg
, buildbot-plugins , buildbot-plugins
, buildbot-pkg
, parameterized , parameterized
, git , git
, openssh , openssh
, glibcLocales , glibcLocales
, nixosTests , nixosTests
, callPackage
}: }:
let let
withPlugins = plugins: buildPythonPackage { withPlugins = plugins: buildPythonApplication {
pname = "${package.pname}-with-plugins"; pname = "${package.pname}-with-plugins";
inherit (package) version; inherit (package) version;
format = "other"; format = "other";
@ -61,7 +63,7 @@ let
}; };
}; };
package = buildPythonPackage rec { package = buildPythonApplication rec {
pname = "buildbot"; pname = "buildbot";
version = "3.7.0"; version = "3.7.0";
format = "setuptools"; format = "setuptools";

View File

@ -1,5 +1,4 @@
{ lib, buildPythonPackage, fetchPypi, buildbot-pkg, mock, cairosvg, klein, jinja2 }: { lib, buildPythonPackage, fetchPypi, callPackage, mock, cairosvg, klein, jinja2, buildbot-pkg }:
{ {
www = buildPythonPackage rec { www = buildPythonPackage rec {
pname = "buildbot-www"; pname = "buildbot-www";

View File

@ -3079,10 +3079,8 @@ with pkgs;
bucklespring-libinput = callPackage ../applications/audio/bucklespring { }; bucklespring-libinput = callPackage ../applications/audio/bucklespring { };
bucklespring-x11 = callPackage ../applications/audio/bucklespring { legacy = true; }; bucklespring-x11 = callPackage ../applications/audio/bucklespring { legacy = true; };
buildbot = with python3Packages; toPythonApplication buildbot; inherit (python3.pkgs.callPackage ../development/tools/continuous-integration/buildbot {})
buildbot-ui = with python3Packages; toPythonApplication buildbot-ui; buildbot buildbot-ui buildbot-full buildbot-plugins buildbot-worker;
buildbot-full = with python3Packages; toPythonApplication buildbot-full;
buildbot-worker = with python3Packages; toPythonApplication buildbot-worker;
bunyan-rs = callPackage ../development/tools/bunyan-rs { }; bunyan-rs = callPackage ../development/tools/bunyan-rs { };

View File

@ -48,6 +48,12 @@ mapAliases ({
blockdiagcontrib-cisco = throw "blockdiagcontrib-cisco is not compatible with blockdiag 2.0.0 and has been removed."; # added 2020-11-29 blockdiagcontrib-cisco = throw "blockdiagcontrib-cisco is not compatible with blockdiag 2.0.0 and has been removed."; # added 2020-11-29
bsblan = python-bsblan; # added 2022-11-04 bsblan = python-bsblan; # added 2022-11-04
btchip = btchip-python; # added 2023-03-03 btchip = btchip-python; # added 2023-03-03
buildbot = throw "use pkgs.buildbot instead"; # added 2022-04-07
buildbot-ui = throw "use pkgs.buildbot-ui instead"; # added 2022-04-07
buildbot-full = throw "use pkgs.buildbot-full instead"; # added 2022-04-07
buildbot-plugins = throw "use pkgs.buildbot-plugins instead"; # added 2022-04-07
buildbot-worker = throw "use pkgs.buildbot-worker instead"; # added 2022-04-07
buildbot-pkg = throw "buildbot-pkg has been removed, it's only internally used in buildbot"; # added 2022-04-07
bt_proximity = bt-proximity; # added 2021-07-02 bt_proximity = bt-proximity; # added 2021-07-02
BTrees = btrees; # added 2023-02-19 BTrees = btrees; # added 2023-02-19
carrot = throw "carrot has been removed, as its development was discontinued in 2012"; # added 2022-01-18 carrot = throw "carrot has been removed, as its development was discontinued in 2012"; # added 2022-01-18

View File

@ -1513,18 +1513,6 @@ self: super: with self; {
buienradar = callPackage ../development/python-modules/buienradar { }; buienradar = callPackage ../development/python-modules/buienradar { };
buildbot = callPackage ../development/python-modules/buildbot { };
buildbot-ui = self.buildbot.withPlugins (with self.buildbot-plugins; [ www ]);
buildbot-full = self.buildbot.withPlugins (with self.buildbot-plugins; [ www console-view waterfall-view grid-view wsgi-dashboards badges ]);
buildbot-pkg = callPackage ../development/python-modules/buildbot/pkg.nix { };
buildbot-plugins = pkgs.recurseIntoAttrs (callPackage ../development/python-modules/buildbot/plugins.nix { });
buildbot-worker = callPackage ../development/python-modules/buildbot/worker.nix { };
build = callPackage ../development/python-modules/build { }; build = callPackage ../development/python-modules/build { };
buildcatrust = callPackage ../development/python-modules/buildcatrust { }; buildcatrust = callPackage ../development/python-modules/buildcatrust { };