From 4891d4e7f41c16aef42f0a384989804f0f6f0e15 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Tue, 24 Mar 2026 10:36:02 -0700 Subject: [PATCH] libretranslate: skip pythonImportsCheck on aarch64 --- .../python-modules/libretranslate/default.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/libretranslate/default.nix b/pkgs/development/python-modules/libretranslate/default.nix index 1b3cc31e3cf4..7a5561effa66 100644 --- a/pkgs/development/python-modules/libretranslate/default.nix +++ b/pkgs/development/python-modules/libretranslate/default.nix @@ -1,5 +1,6 @@ { lib, + stdenv, pkgs, buildPythonPackage, fetchFromGitHub, @@ -32,6 +33,10 @@ lndir, }: +let + inherit (stdenv.hostPlatform) isLinux isAarch64; + isAarch64Linux = isLinux && isAarch64; +in buildPythonPackage (finalAttrs: { pname = "libretranslate"; version = "1.9.5"; @@ -90,7 +95,11 @@ buildPythonPackage (finalAttrs: { # needed to import the argostranslate module nativeCheckInputs = [ writableTmpDirAsHomeHook ]; - pythonImportsCheck = [ "libretranslate" ]; + + # aarch64-linux fails cpuinfo test, because /sys/devices/system/cpu/ does not exist in the sandbox: + # terminate called after throwing an instance of 'onnxruntime::OnnxRuntimeException' + pythonImportsCheck = lib.optional (!isAarch64Linux) "libretranslate"; + doCheck = !isAarch64Linux; passthru = { static-compressed =