From 4b971453b8cb6095b1e8c560c73ad4a4267fdd43 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Sat, 17 Jan 2026 15:10:53 +0000 Subject: [PATCH] python3Packages.onnxruntime: add pythonImportsCheckHook https://github.com/NixOS/nixpkgs/pull/450587#issuecomment-3763825059 --- .../python-modules/onnxruntime/default.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkgs/development/python-modules/onnxruntime/default.nix b/pkgs/development/python-modules/onnxruntime/default.nix index 4d2ed826d456..9685d85a72a3 100644 --- a/pkgs/development/python-modules/onnxruntime/default.nix +++ b/pkgs/development/python-modules/onnxruntime/default.nix @@ -80,5 +80,16 @@ buildPythonPackage { packaging ]; + # 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' + # + # While this problem has existed for a while, it started occuring at import time since the update + # of onnxruntime to 1.23.1 (https://github.com/NixOS/nixpkgs/pull/450587) + pythonImportsCheck = + lib.optionals (!(stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64)) + [ + "onnxruntime" + ]; + meta = onnxruntime.meta; }