From 0e6e4d427616be99574b9537a0fc553ec4cb8b8e Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Mon, 12 Jul 2021 23:40:50 +0200 Subject: [PATCH 1/2] borgbackup: 1.1.16 -> 1.1.17 https://github.com/borgbackup/borg/blob/1.1.17/docs/changes.rst#version-1117-2021-07-12 --- pkgs/tools/backup/borgbackup/default.nix | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/pkgs/tools/backup/borgbackup/default.nix b/pkgs/tools/backup/borgbackup/default.nix index d0e48454a368..89e1f3e7e47b 100644 --- a/pkgs/tools/backup/borgbackup/default.nix +++ b/pkgs/tools/backup/borgbackup/default.nix @@ -1,23 +1,14 @@ -{ lib, stdenv, python3, fetchpatch, acl, libb2, lz4, zstd, openssl, openssh, nixosTests }: +{ lib, stdenv, python3, acl, libb2, lz4, zstd, openssl, openssh, nixosTests }: python3.pkgs.buildPythonApplication rec { pname = "borgbackup"; - version = "1.1.16"; + version = "1.1.17"; src = python3.pkgs.fetchPypi { inherit pname version; - sha256 = "0l1dqfwrd9l34rg30cmzmq5bs6yha6kg4vy313jq611jsqj94mmw"; + sha256 = "0x0ncy0b0bmf586hbdgrif3gjmkdw760vfnfxndr493v07y29fbs"; }; - patches = [ - # fix compatibility with sphinx 4 - (fetchpatch { - url = "https://github.com/borgbackup/borg/commit/6a1f31bf2914d167e2f5051f1d531d5d4a19f54b.patch"; - includes = [ "docs/conf.py" ]; - sha256 = "0aa4kyb3j4apgwqcy1hzg6lxvpf60m2mijcj60vh101b42410hiz"; - }) - ]; - nativeBuildInputs = with python3.pkgs; [ setuptools-scm # For building documentation: @@ -27,6 +18,7 @@ python3.pkgs.buildPythonApplication rec { libb2 lz4 zstd openssl ] ++ lib.optionals stdenv.isLinux [ acl ]; propagatedBuildInputs = with python3.pkgs; [ + packaging cython llfuse ]; From 3848948f778baea87e52ff8757d54905dd0ccd79 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Tue, 13 Jul 2021 01:38:38 +0200 Subject: [PATCH 2/2] borgbackup: enable tests, clean up --- pkgs/tools/backup/borgbackup/default.nix | 70 ++++++++++++++++++++---- 1 file changed, 59 insertions(+), 11 deletions(-) diff --git a/pkgs/tools/backup/borgbackup/default.nix b/pkgs/tools/backup/borgbackup/default.nix index 89e1f3e7e47b..ad78dcacd78d 100644 --- a/pkgs/tools/backup/borgbackup/default.nix +++ b/pkgs/tools/backup/borgbackup/default.nix @@ -1,4 +1,15 @@ -{ lib, stdenv, python3, acl, libb2, lz4, zstd, openssl, openssh, nixosTests }: +{ lib +, stdenv +, acl +, e2fsprogs +, libb2 +, lz4 +, openssh +, openssl +, python3 +, zstd +, nixosTests +}: python3.pkgs.buildPythonApplication rec { pname = "borgbackup"; @@ -9,17 +20,33 @@ python3.pkgs.buildPythonApplication rec { sha256 = "0x0ncy0b0bmf586hbdgrif3gjmkdw760vfnfxndr493v07y29fbs"; }; + postPatch = '' + # sandbox does not support setuid/setgid/sticky bits + substituteInPlace src/borg/testsuite/archiver.py \ + --replace "0o4755" "0o0755" + ''; + nativeBuildInputs = with python3.pkgs; [ setuptools-scm # For building documentation: - sphinx guzzle_sphinx_theme + sphinx + guzzle_sphinx_theme ]; + buildInputs = [ - libb2 lz4 zstd openssl - ] ++ lib.optionals stdenv.isLinux [ acl ]; + libb2 + lz4 + zstd + openssl + ] ++ lib.optionals stdenv.isLinux [ + acl + ]; + propagatedBuildInputs = with python3.pkgs; [ + cython + llfuse packaging - cython llfuse + pyfuse3 ]; preConfigure = '' @@ -53,15 +80,36 @@ python3.pkgs.buildPythonApplication rec { ''; checkInputs = with python3.pkgs; [ - pytest + e2fsprogs + pytest-benchmark + pytest-xdist + pytestCheckHook ]; - checkPhase = '' - HOME=$(mktemp -d) py.test --pyargs borg.testsuite - ''; + pytestFlagsArray = [ + "--numprocesses" "auto" + "--benchmark-skip" + "--pyargs" "borg.testsuite" + ]; - # 64 failures, needs pytest-benchmark - doCheck = false; + disabledTests = [ + # fuse: device not found, try 'modprobe fuse' first + "test_fuse" + "test_fuse_allow_damaged_files" + "test_fuse_mount_hardlinks" + "test_fuse_mount_options" + "test_fuse_versions_view" + "test_readonly_mount" + # Error: Permission denied while trying to write to /var/{,tmp} + "test_get_cache_dir" + "test_get_keys_dir" + "test_get_security_dir" + "test_get_config_dir" + ]; + + preCheck = '' + export HOME=$TEMP + ''; passthru.tests = { inherit (nixosTests) borgbackup;