From 6112f3e8f6c75230d2bd76d519a4a23623eb4086 Mon Sep 17 00:00:00 2001 From: Rebecca Turner Date: Tue, 28 Oct 2025 11:59:16 -0700 Subject: [PATCH 1/2] python3Packages.gst-python: use `mesonCheckPhase` --- pkgs/development/python-modules/gst-python/default.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/gst-python/default.nix b/pkgs/development/python-modules/gst-python/default.nix index 12e20e097e81..d2f700ecb0ef 100644 --- a/pkgs/development/python-modules/gst-python/default.nix +++ b/pkgs/development/python-modules/gst-python/default.nix @@ -82,9 +82,10 @@ buildPythonPackage rec { "-Dpython-exe=${python.pythonOnBuildForHost.interpreter}" ]; - # TODO: Meson setup hook does not like buildPythonPackage - # https://github.com/NixOS/nixpkgs/issues/47390 - installCheckPhase = "meson test --print-errorlogs"; + # `buildPythonPackage` uses `installCheckPhase` and leaves `checkPhase` + # empty. It renames `doCheck` from its arguments, but not `checkPhase`. + # See: https://github.com/NixOS/nixpkgs/issues/47390 + installCheckPhase = "mesonCheckPhase"; preCheck = lib.optionalString stdenv.hostPlatform.isDarwin '' export DYLD_LIBRARY_PATH="${gst_all_1.gst-plugins-base}/lib" From db781ef3e131c0a6be190110c186991615b70ec8 Mon Sep 17 00:00:00 2001 From: Rebecca Turner Date: Tue, 28 Oct 2025 11:59:16 -0700 Subject: [PATCH 2/2] python3Packages.gst-python: disable tests on darwin Closes #454955 These tests are very flaky on Darwin for whatever reason. Sometimes they just mysteriously time out. When setting `doCheck = !stdenv.hostPlatform.isDarwin`, I discovered that the `checkInputs` entry `gst-rtsp-server` is in fact needed to build the project, so this incorporates #451261 to fix that issue. --- .../python-modules/gst-python/default.nix | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/gst-python/default.nix b/pkgs/development/python-modules/gst-python/default.nix index d2f700ecb0ef..be3bbbc83125 100644 --- a/pkgs/development/python-modules/gst-python/default.nix +++ b/pkgs/development/python-modules/gst-python/default.nix @@ -6,6 +6,9 @@ fetchpatch, meson, ninja, + # TODO: We can get rid of this once `buildPythonPackage` accepts `finalAttrs`. + # See: https://github.com/NixOS/nixpkgs/pull/271387 + gst-python, pkg-config, python, @@ -42,13 +45,6 @@ buildPythonPackage rec { }) ]; - postPatch = lib.optionalString stdenv.hostPlatform.isDarwin '' - # The analytics tests often timeout under load on Darwin (e.g. on Hydra), so remove them - substituteInPlace testsuite/meson.build --replace-fail \ - "['Test analytics', 'test_analytics.py', ['gst-plugins-bad/gst-libs/gst/analytics', 'gst-plugins-base/gst-libs/gst/video']]," \ - "" - ''; - # Python 2.x is not supported. disabled = !isPy3k; @@ -80,8 +76,20 @@ buildPythonPackage rec { "-Dpygi-overrides-dir=${placeholder "out"}/${python.sitePackages}/gi/overrides" # Exec format error during configure "-Dpython-exe=${python.pythonOnBuildForHost.interpreter}" + # This is needed to prevent the project from looking for `gst-rtsp-server` + # from `checkInputs`. + # + # TODO: This should probably be moved at least partially into the Meson hook. + # + # NB: We need to use `doInstallCheck` here because `buildPythonPackage` + # renames `doCheck` to `doInstallCheck`. + (lib.mesonEnable "tests" gst-python.doInstallCheck) ]; + # Tests are very flaky on Darwin. + # See: https://github.com/NixOS/nixpkgs/issues/454955 + doCheck = !stdenv.hostPlatform.isDarwin; + # `buildPythonPackage` uses `installCheckPhase` and leaves `checkPhase` # empty. It renames `doCheck` from its arguments, but not `checkPhase`. # See: https://github.com/NixOS/nixpkgs/issues/47390