From 8e093581b5a3e86fce13af4345148c2250faaffe Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Mon, 18 Aug 2025 21:02:36 +0200 Subject: [PATCH] or-tools: re-enable tests on x86_64-linux This needs https://github.com/google/or-tools/pull/4745 to skip SCIP tests if built without SCIP (which we currently do). The tests currently still fail on aarch64-linux (https://github.com/google/or-tools/issues/4746), so we only enable for x86_64-linux. It can be re-tested with a more recent version once or-tools is updated. --- pkgs/by-name/or/or-tools/package.nix | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/or/or-tools/package.nix b/pkgs/by-name/or/or-tools/package.nix index dae04d0b15033..638b77782166c 100644 --- a/pkgs/by-name/or/or-tools/package.nix +++ b/pkgs/by-name/or/or-tools/package.nix @@ -7,6 +7,8 @@ ensureNewerSourcesForZipFilesHook, fetchFromGitHub, fetchpatch, + gtest, + gbenchmark, glpk, highs, lib, @@ -55,6 +57,11 @@ stdenv.mkDerivation (finalAttrs: { url = "https://build.opensuse.org/public/source/science/google-or-tools/0001-Fix-up-broken-CMake-rules-for-bundled-pybind-stuff.patch?rev=19"; hash = "sha256-r38ZbRkEW1ZvJb0Uf56c0+HcnfouZZJeEYlIK7quSjQ="; }) + (fetchpatch { + name = "math_opt-only-run-SCIP-tests-if-enabled.patch"; + url = "https://github.com/google/or-tools/commit/b5a2f8ac40dd4bfa4359c35570733171454ec72b.patch"; + hash = "sha256-h96zJkqTtwfBd+m7Lm9r/ks/n8uvY4iSPgxMZe8vtXI="; + }) ]; # or-tools normally attempts to build Protobuf for the build platform when @@ -108,6 +115,8 @@ stdenv.mkDerivation (finalAttrs: { cbc eigen glpk + gbenchmark + gtest highs python3.pkgs.absl-py python3.pkgs.pybind11 @@ -131,11 +140,15 @@ stdenv.mkDerivation (finalAttrs: { ]; nativeCheckInputs = [ python3.pkgs.matplotlib + python3.pkgs.pandas + python3.pkgs.pytest + python3.pkgs.scipy + python3.pkgs.svgwrite python3.pkgs.virtualenv ]; - # some tests fail on linux and hang on darwin - doCheck = false; + # some tests fail on aarch64-linux and hang on darwin + doCheck = stdenv.hostPlatform.isx86_64 && stdenv.hostPlatform.isLinux; preCheck = '' export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$PWD/lib