diff --git a/pkgs/development/libraries/raft-canonical/default.nix b/pkgs/development/libraries/raft-canonical/default.nix index eae446831849..0fc885033e64 100644 --- a/pkgs/development/libraries/raft-canonical/default.nix +++ b/pkgs/development/libraries/raft-canonical/default.nix @@ -2,13 +2,13 @@ stdenv.mkDerivation rec { pname = "raft-canonical"; - version = "0.11.2"; + version = "0.16.0"; src = fetchFromGitHub { owner = "canonical"; repo = "raft"; - rev = "v${version}"; - sha256 = "050dwy34jh8dihfwfm0r1by2i3sy9crapipp9idw32idm79y4izb"; + rev = "refs/tags/v${version}"; + hash = "sha256-qDLAEhknY+BB83OC6tfi7w/ZY/K492J5ZglLNUoBwbc="; }; nativeBuildInputs = [ autoreconfHook file pkg-config ]; @@ -16,13 +16,13 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - # Ignore broken test, likely not causing huge breakage - # (https://github.com/canonical/raft/issues/292) - postPatch = '' - substituteInPlace test/integration/test_uv_tcp_connect.c --replace \ - "TEST(tcp_connect, closeDuringHandshake, setUp, tearDownDeps, 0, NULL)" \ - "TEST(tcp_connect, closeDuringHandshake, setUp, tearDownDeps, MUNIT_TEST_OPTION_TODO, NULL)" - ''; + patches = [ + # network tests either hang indefinitely, or fail outright + ./disable-net-tests.patch + + # missing dir check is flaky + ./disable-missing-dir-test.patch + ]; preConfigure = '' substituteInPlace configure --replace /usr/bin/ " " diff --git a/pkgs/development/libraries/raft-canonical/disable-missing-dir-test.patch b/pkgs/development/libraries/raft-canonical/disable-missing-dir-test.patch new file mode 100644 index 000000000000..ddfec9b22e14 --- /dev/null +++ b/pkgs/development/libraries/raft-canonical/disable-missing-dir-test.patch @@ -0,0 +1,23 @@ +diff --git a/test/unit/test_uv_fs.c b/test/unit/test_uv_fs.c +index 638c39c..c8758d2 100644 +--- a/test/unit/test_uv_fs.c ++++ b/test/unit/test_uv_fs.c +@@ -40,18 +40,6 @@ TEST(UvFsCheckDir, exists, DirSetUp, DirTearDown, 0, NULL) + return MUNIT_OK; + } + +-/* If the directory doesn't exist, it an error is returned. */ +-TEST(UvFsCheckDir, doesNotExist, DirSetUp, DirTearDown, 0, NULL) +-{ +- const char *parent = data; +- char errmsg[RAFT_ERRMSG_BUF_SIZE]; +- char dir[128]; +- sprintf(errmsg, "%s/sub", parent); +- sprintf(errmsg, "directory '%s' does not exist", dir); +- CHECK_DIR_ERROR(dir, RAFT_NOTFOUND, errmsg); +- return MUNIT_OK; +-} +- + /* If the process can't access the directory, an error is returned. */ + TEST(UvFsCheckDir, permissionDenied, NULL, NULL, 0, NULL) + { diff --git a/pkgs/development/libraries/raft-canonical/disable-net-tests.patch b/pkgs/development/libraries/raft-canonical/disable-net-tests.patch new file mode 100644 index 000000000000..7c8be29feafd --- /dev/null +++ b/pkgs/development/libraries/raft-canonical/disable-net-tests.patch @@ -0,0 +1,16 @@ +diff --git a/Makefile.am b/Makefile.am +index 2137932..93abdb6 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -198,11 +198,7 @@ test_integration_uv_SOURCES = \ + test/integration/test_uv_bootstrap.c \ + test/integration/test_uv_load.c \ + test/integration/test_uv_recover.c \ +- test/integration/test_uv_recv.c \ +- test/integration/test_uv_send.c \ + test/integration/test_uv_set_term.c \ +- test/integration/test_uv_tcp_connect.c \ +- test/integration/test_uv_tcp_listen.c \ + test/integration/test_uv_snapshot_put.c \ + test/integration/test_uv_truncate.c \ + test/integration/test_uv_work.c