From fbc8fd8ee3a085a4dbe937d6d579a07aabc77a93 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Fri, 26 Jun 2026 01:21:24 +0200 Subject: [PATCH 1/2] python3Packages.cryptography: disable tests failing with overcommit --- .../python-modules/cryptography/default.nix | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/pkgs/development/python-modules/cryptography/default.nix b/pkgs/development/python-modules/cryptography/default.nix index 56fb295e6dd9..148402b9ce78 100644 --- a/pkgs/development/python-modules/cryptography/default.nix +++ b/pkgs/development/python-modules/cryptography/default.nix @@ -1,6 +1,7 @@ { lib, stdenv, + fetchpatch, buildPythonPackage, callPackage, setuptools, @@ -36,6 +37,15 @@ buildPythonPackage rec { hash = "sha256-mp+1Fw8xNBJD1DM8obAqYBP8erxXiP768+ifqRN1Uqs="; }; + patches = [ + (fetchpatch { + # Add test marks where malloc failure is expected on systems with overcommit enabled + name = "malloc-overcommit-mark.patch"; + url = "https://github.com/pyca/cryptography/commit/2efeba9cc67809b67e659bea8eaea680df2135e8.patch"; + hash = "sha256-06Z+sk2JTJ50CCnPf2vXyPL5BZeI98oc43LpccenzNg="; + }) + ]; + postPatch = '' substituteInPlace pyproject.toml \ --replace-fail "--benchmark-disable" "" @@ -71,12 +81,6 @@ buildPythonPackage rec { pytestFlags = [ "--disable-pytest-warnings" ]; - disabledTests = [ - # Tries to allocate 1 TiB with vm.overcommit_memory=1 - # https://github.com/pyca/cryptography/pull/14782 - "test_argon2_malloc_failure" - ]; - disabledTestPaths = [ # save compute time by not running benchmarks "tests/bench" From 6cddca7cc4efb8039bba344749c079c8b6ec400d Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sun, 28 Jun 2026 23:11:36 +0200 Subject: [PATCH 2/2] python3Packages.cryptography: 48.0.0 -> 49.0.0 https://cryptography.io/en/latest/changelog/#v49-0-0 --- pkgs/development/python-modules/cryptography/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/cryptography/default.nix b/pkgs/development/python-modules/cryptography/default.nix index 148402b9ce78..f0560b576078 100644 --- a/pkgs/development/python-modules/cryptography/default.nix +++ b/pkgs/development/python-modules/cryptography/default.nix @@ -22,19 +22,19 @@ buildPythonPackage rec { pname = "cryptography"; - version = "48.0.0"; + version = "49.0.0"; pyproject = true; src = fetchFromGitHub { owner = "pyca"; repo = "cryptography"; tag = version; - hash = "sha256-S1oOLou6tE1atqZ6HXwVQDps9BnjiEpRdoZY5VQm+Kg="; + hash = "sha256-yHUIGauFZYnjcoROvocT1UqQ0B8ZuVTaJ0ZAfri6T1E="; }; cargoDeps = rustPlatform.fetchCargoVendor { inherit pname version src; - hash = "sha256-mp+1Fw8xNBJD1DM8obAqYBP8erxXiP768+ifqRN1Uqs="; + hash = "sha256-yMCBu/RGRcEQST8tEWCNgVvlQsp2KamOqt60qvOYdt8="; }; patches = [