Commit 90b75045 authored by Jörg Thalheim's avatar Jörg Thalheim
Browse files

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.
parent cd07e025
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -8,7 +8,8 @@ let
  cfg = config.services.buildbot-master;
  opt = options.services.buildbot-master;

  python = cfg.package.pythonModule;
  package = pkgs.python3.pkgs.toPythonModule cfg.package;
  python = package.pythonModule;

  escapeStr = escape [ "'" ];

@@ -212,10 +213,10 @@ in {

      package = mkOption {
        type = types.package;
        default = pkgs.python3Packages.buildbot-full;
        defaultText = literalExpression "pkgs.python3Packages.buildbot-full";
        default = pkgs.buildbot-full;
        defaultText = literalExpression "pkgs.buildbot-full";
        description = lib.mdDoc "Package to use for buildbot.";
        example = literalExpression "pkgs.python3Packages.buildbot";
        example = literalExpression "pkgs.buildbot";
      };

      packages = mkOption {
@@ -255,7 +256,7 @@ in {
      after = [ "network-online.target" ];
      wantedBy = [ "multi-user.target" ];
      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 = ''
        mkdir -vp "${cfg.buildbotDir}"
+4 −3
Original line number Diff line number Diff line
@@ -8,7 +8,8 @@ let
  cfg = config.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" ''
    import os
@@ -129,7 +130,7 @@ in {

      package = mkOption {
        type = types.package;
        default = pkgs.python3Packages.buildbot-worker;
        default = pkgs.buildbot-worker;
        defaultText = literalExpression "pkgs.python3Packages.buildbot-worker";
        description = lib.mdDoc "Package to use for buildbot worker.";
        example = literalExpression "pkgs.python2Packages.buildbot-worker";
@@ -168,7 +169,7 @@ in {
      after = [ "network.target" "buildbot-master.service" ];
      wantedBy = [ "multi-user.target" ];
      path = cfg.packages;
      environment.PYTHONPATH = "${python.withPackages (p: [ cfg.package ])}/${python.sitePackages}";
      environment.PYTHONPATH = "${python.withPackages (p: [ package ])}/${python.sitePackages}";

      preStart = ''
        mkdir -vp "${cfg.buildbotDir}/info"
+2 −2
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ import ./make-test-python.nix {
        ];
      };
      networking.firewall.allowedTCPPorts = [ 8010 8011 9989 ];
      environment.systemPackages = with pkgs; [ git python3Packages.buildbot-full ];
      environment.systemPackages = with pkgs; [ git buildbot-full ];
    };

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

    gitrepo = { pkgs, ... }: {
+42 −0
Original line number Diff line number Diff line
{ 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
  ]);
}
+5 −3
Original line number Diff line number Diff line
{ lib
, stdenv
, buildPythonPackage
, buildPythonApplication
, fetchPypi
, makeWrapper
, pythonOlder
@@ -25,17 +26,18 @@
, lz4
, setuptoolsTrial
, buildbot-worker
, buildbot-pkg
, buildbot-plugins
, buildbot-pkg
, parameterized
, git
, openssh
, glibcLocales
, nixosTests
, callPackage
}:

let
  withPlugins = plugins: buildPythonPackage {
  withPlugins = plugins: buildPythonApplication {
    pname = "${package.pname}-with-plugins";
    inherit (package) version;
    format = "other";
@@ -61,7 +63,7 @@ let
    };
  };

  package = buildPythonPackage rec {
  package = buildPythonApplication rec {
    pname = "buildbot";
    version = "3.7.0";
    format = "setuptools";
Loading