From aecf396c4c1f574c8fc4cf2a8548d2d01efc9194 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Mon, 26 Jan 2026 15:28:26 +0000 Subject: [PATCH] python3Packages.rapidocr-onnruntime: disable checks on aarch64-linux --- .../rapidocr-onnxruntime/default.nix | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/rapidocr-onnxruntime/default.nix b/pkgs/development/python-modules/rapidocr-onnxruntime/default.nix index 869ff38fc791..2a61da96c617 100644 --- a/pkgs/development/python-modules/rapidocr-onnxruntime/default.nix +++ b/pkgs/development/python-modules/rapidocr-onnxruntime/default.nix @@ -1,5 +1,6 @@ { lib, + stdenv, config, buildPythonPackage, fetchFromGitHub, @@ -32,6 +33,8 @@ let stripRoot = false; } + "/required_for_whl_v1.3.0/resources/models"; + + isNotAarch64Linux = !(stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64); in buildPythonPackage (finalAttrs: { pname = "rapidocr-onnxruntime"; @@ -99,7 +102,13 @@ buildPythonPackage (finalAttrs: { tqdm ]; - pythonImportsCheck = [ "rapidocr_onnxruntime" ]; + # 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' + # + # -> Skip all tests that require importing markitdown + pythonImportsCheck = lib.optionals isNotAarch64Linux [ + "rapidocr_onnxruntime" + ]; nativeCheckInputs = [ pytestCheckHook @@ -117,10 +126,14 @@ buildPythonPackage (finalAttrs: { "test_long_img" ]; - # Tests require access to a physical GPU to work, otherwise the interpreter crashes: - # Fatal Python error: Aborted - # File "/nix/store/..onnxruntime/capi/onnxruntime_inference_collection.py", line 561 in _create_inference_session - doCheck = !cudaSupport; + doCheck = + # Tests require access to a physical GPU to work, otherwise the interpreter crashes: + # Fatal Python error: Aborted + # File "/nix/store/..onnxruntime/capi/onnxruntime_inference_collection.py", line 561 in _create_inference_session + (!cudaSupport) + # See comment above + # 'onnxruntime::OnnxRuntimeException' + && isNotAarch64Linux; # rapidocr-onnxruntime has been renamed to rapidocr by upstream since 2.0.0. However, some packages like open-webui still requires rapidocr-onnxruntime 1.4.4. Therefore we set no auto update here. # nixpkgs-update: no auto update