diff --git a/pkgs/by-name/on/onnxruntime/package.nix b/pkgs/by-name/on/onnxruntime/package.nix index 2aa4bbf6baad..adf858797a23 100644 --- a/pkgs/by-name/on/onnxruntime/package.nix +++ b/pkgs/by-name/on/onnxruntime/package.nix @@ -135,7 +135,6 @@ effectiveStdenv.mkDerivation rec { ]; buildInputs = [ - cpuinfo eigen glibcLocales howard-hinnant-date @@ -145,6 +144,9 @@ effectiveStdenv.mkDerivation rec { pytorch_clog zlib ] + ++ lib.optionals (lib.meta.availableOn effectiveStdenv.hostPlatform cpuinfo) [ + cpuinfo + ] ++ lib.optionals pythonSupport ( with python3Packages; [ @@ -234,11 +236,24 @@ effectiveStdenv.mkDerivation rec { NIX_CFLAGS_COMPILE = "-Wno-error"; }; - # aarch64-linux fails cpuinfo test, because /sys/devices/system/cpu/ does not exist in the sandbox - doCheck = !(cudaSupport || effectiveStdenv.buildPlatform.system == "aarch64-linux"); + doCheck = + !( + cudaSupport + || builtins.elem effectiveStdenv.buildPlatform.system [ + # aarch64-linux fails cpuinfo test, because /sys/devices/system/cpu/ does not exist in the sandbox + "aarch64-linux" + # 1 - onnxruntime_test_all (Failed) + # 4761 tests from 311 test suites ran, 57 failed. + "loongarch64-linux" + ] + ); requiredSystemFeatures = lib.optionals cudaSupport [ "big-parallel" ]; + hardeningEnable = lib.optionals (effectiveStdenv.hostPlatform.system == "loongarch64-linux") [ + "nostrictaliasing" + ]; + postPatch = '' substituteInPlace cmake/libonnxruntime.pc.cmake.in \ --replace-fail '$'{prefix}/@CMAKE_INSTALL_ @CMAKE_INSTALL_