From f3752be2ff1ab451324391c2a0d005a9277c657b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sat, 24 May 2025 21:38:02 +0200 Subject: [PATCH] python313Packages.granian: use jemalloc hook to fix aarch64-linux --- .../python-modules/granian/default.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pkgs/development/python-modules/granian/default.nix b/pkgs/development/python-modules/granian/default.nix index 58e6159705d9..33dc373c5685 100644 --- a/pkgs/development/python-modules/granian/default.nix +++ b/pkgs/development/python-modules/granian/default.nix @@ -13,6 +13,7 @@ pytest-asyncio, websockets, httpx, + rust-jemalloc-sys, sniffio, nix-update-script, }: @@ -39,6 +40,21 @@ buildPythonPackage rec { maturinBuildHook ]; + buildInputs = [ + # fix "Unsupported system page size" on aarch64-linux with 16k pages + # https://github.com/NixOS/nixpkgs/issues/410572 + (rust-jemalloc-sys.overrideAttrs ( + { configureFlags, ... }: + { + configureFlags = configureFlags ++ [ + # otherwise import check fails with: + # ImportError: {{storeDir}}/lib/libjemalloc.so.2: cannot allocate memory in static TLS block + "--disable-initial-exec-tls" + ]; + } + )) + ]; + dependencies = [ click ];