or-tools: fix python installation

- python: add --no-index, and --no-build-isolation to pip install
  to prevent network access and environment isolation in the sandbox.

- python: Disable 3.14.

This fixes the build for downstream consumers like openroad/librelane
which were failing due to sandbox violations during the python install phase.

This also disables Python 3.14 which is only supported in or-tools 9.15
and pybind11 3.0.0.
This commit is contained in:
Gon Solo
2026-01-29 00:13:41 +01:00
parent 68aef776b7
commit fdf6dbde9f
+11 -1
View File
@@ -232,7 +232,12 @@ stdenv.mkDerivation (finalAttrs: {
installPhase = ''
cmake . -DBUILD_EXAMPLES=OFF -DBUILD_PYTHON=OFF -DBUILD_SAMPLES=OFF
cmake --install .
pip install --prefix="$python" python/
# Install the Python bindings.
# --no-build-isolation: Required because Nix provides build tools (setuptools/wheel)
# locally; without this, pip tries to download them from the internet.
# --no-index: Prevents pip from searching PyPI for packages.
pip install --no-index --no-build-isolation --prefix="$python" python/
'';
outputs = [
@@ -249,5 +254,10 @@ stdenv.mkDerivation (finalAttrs: {
mainProgram = "fzn-cp-sat";
maintainers = with lib.maintainers; [ andersk ];
platforms = with lib.platforms; linux ++ darwin;
# Only version 9.15 adds support for Python 3.14: https://github.com/google/or-tools/releases/tag/v9.15
# Also this package is tied to pybind 2.13.6, and only 3.0.0 supports Python 3.14: https://github.com/pybind/pybind11/releases/tag/v3.0.0
# Also, nix review fails to build python314Packages.ortools
broken = python3.pythonAtLeast "3.14";
};
})