From 6d76a6826798059f49632b8e36bead838cf00fdd Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone <exarkun@twistedmatrix.com> Date: Wed, 6 May 2020 20:34:34 -0400 Subject: [PATCH] lean heavily on tahoe-lafs packaging --- eliot.nix | 30 ------------------------------ overlays.nix | 5 +---- tahoe-lafs-repo.nix | 9 +++++++++ tahoe-lafs.nix | 25 ++++++++++++++++++------- zkapauthorizer.nix | 5 +++-- 5 files changed, 31 insertions(+), 43 deletions(-) delete mode 100644 eliot.nix create mode 100644 tahoe-lafs-repo.nix diff --git a/eliot.nix b/eliot.nix deleted file mode 100644 index 06698e3..0000000 --- a/eliot.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ lib, buildPythonPackage, fetchPypi, zope_interface, pyrsistent, boltons -, hypothesis, testtools, pytest }: -buildPythonPackage rec { - pname = "eliot"; - version = "1.7.0"; - - src = fetchPypi { - inherit pname version; - sha256 = "0ylyycf717s5qsrx8b9n6m38vyj2k8328lfhn8y6r31824991wv8"; - }; - - postPatch = '' - substituteInPlace setup.py \ - --replace "boltons >= 19.0.1" boltons - # depends on eliot.prettyprint._main which we don't have here. - rm eliot/tests/test_prettyprint.py - ''; - - checkInputs = [ testtools pytest hypothesis ]; - propagatedBuildInputs = [ zope_interface pyrsistent boltons ]; - - # https://github.com/itamarst/eliot/issues/436 - doCheck = false; - - meta = with lib; { - homepage = https://github.com/itamarst/eliot/; - description = "Logging library that tells you why it happened"; - license = licenses.asl20; - }; -} diff --git a/overlays.nix b/overlays.nix index ed2d8d1..3d548fa 100644 --- a/overlays.nix +++ b/overlays.nix @@ -15,12 +15,9 @@ self: super: { # 2 support. typing = python-self.callPackage ./typing.nix { }; - # new tahoe-lafs dependency - eliot = python-self.callPackage ./eliot.nix { }; - # tahoe-lafs in nixpkgs is packaged as an application! so we have to # re-package it ourselves as a library. - tahoe-lafs = python-self.callPackage ((import ./tahoe-lafs.nix) + "/nix") { }; + tahoe-lafs = python-self.callPackage ./tahoe-lafs.nix { }; # we depend on the challenge-bypass-ristretto python package, a set of # bindings to the challenge-bypass-ristretto Rust crate. diff --git a/tahoe-lafs-repo.nix b/tahoe-lafs-repo.nix new file mode 100644 index 0000000..fc944e5 --- /dev/null +++ b/tahoe-lafs-repo.nix @@ -0,0 +1,9 @@ +let + pkgs = import <nixpkgs> {}; +in + pkgs.fetchFromGitHub { + owner = "tahoe-lafs"; + repo = "tahoe-lafs"; + rev = "tahoe-lafs-1.14.0"; + sha256 = "1ahdiapg57g6icv7p2wbzgkwl9lzdlgrsvbm5485414m7z2d6las"; + } diff --git a/tahoe-lafs.nix b/tahoe-lafs.nix index c305267..6090151 100644 --- a/tahoe-lafs.nix +++ b/tahoe-lafs.nix @@ -1,9 +1,20 @@ +{ python2Packages }: let - pkgs = import <nixpkgs> {}; + # Manually assemble the tahoe-lafs build inputs because tahoe-lafs 1.14.0 + # eliot package runs the eliot test suite which is flaky. Doing this gives + # us a place to insert a `doCheck = false` (at the cost of essentially + # duplicating tahoe-lafs' default.nix). Not ideal but at least we can throw + # it away when we upgrade to the next tahoe-lafs version. + repo = ((import ./tahoe-lafs-repo.nix) + "/nix"); + nevow-drv = repo + "/nevow.nix"; + nevow = python2Packages.callPackage nevow-drv { }; + eliot-drv = repo + "/eliot.nix"; + eliot = (python2Packages.callPackage eliot-drv { }).overrideAttrs (old: { + doCheck = false; + }); + tahoe-lafs-drv = repo + "/tahoe-lafs.nix"; + tahoe-lafs = python2Packages.callPackage tahoe-lafs-drv { + inherit nevow eliot; + }; in - pkgs.fetchFromGitHub { - owner = "tahoe-lafs"; - repo = "tahoe-lafs"; - rev = "34aeefd3ddbf28dafbc3477e52461eafa53b545d"; - sha256 = "0l8n4njbzgiwmn3qsmvzyzqlb0y9bj9g2jvpdynvsn1ggxrqmvsq"; - } \ No newline at end of file + tahoe-lafs diff --git a/zkapauthorizer.nix b/zkapauthorizer.nix index a5e611b..a718487 100644 --- a/zkapauthorizer.nix +++ b/zkapauthorizer.nix @@ -1,6 +1,6 @@ { lib , buildPythonPackage, sphinx, git -, attrs, zope_interface, eliot, aniso8601, twisted, tahoe-lafs, challenge-bypass-ristretto, treq +, attrs, zope_interface, aniso8601, twisted, tahoe-lafs, challenge-bypass-ristretto, treq , fixtures, testtools, hypothesis, pyflakes, coverage , hypothesisProfile ? null , collectCoverage ? false @@ -31,7 +31,8 @@ buildPythonPackage rec { attrs zope_interface aniso8601 - eliot + # Inherit eliot from tahoe-lafs + # eliot twisted tahoe-lafs challenge-bypass-ristretto -- GitLab