From 209390eda65619e43f7ad7ef7eccd2a2cd470adb Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Tue, 4 Aug 2026 23:46:24 +0000 Subject: [PATCH 1/4] py-spy: cleanup, fix build --- pkgs/by-name/py/py-spy/package.nix | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/pkgs/by-name/py/py-spy/package.nix b/pkgs/by-name/py/py-spy/package.nix index ac7f74773793..beb8120fccf3 100644 --- a/pkgs/by-name/py/py-spy/package.nix +++ b/pkgs/by-name/py/py-spy/package.nix @@ -1,11 +1,15 @@ { lib, stdenv, - fetchFromGitHub, - libunwind, - python3, rustPlatform, + fetchFromGitHub, + + # buildInputs + libunwind, xz, + + # tests + python3, }: let @@ -17,17 +21,20 @@ in rustPlatform.buildRustPackage (finalAttrs: { pname = "py-spy"; version = "0.4.2"; + __structuredAttrs = true; src = fetchFromGitHub { owner = "benfred"; repo = "py-spy"; - rev = "v${finalAttrs.version}"; + tag = "v${finalAttrs.version}"; hash = "sha256-5T6R2Neslw8rNYWJbXncLH78kH1o42fR6kidhip6/Bg="; }; cargoHash = "sha256-ZhtQjX15pZe3CM898LBj/79kXa6ESgPOSFkNghq0Ywo="; - buildFeatures = lib.optional supportsUnwind "unwind"; + buildFeatures = lib.optionals supportsUnwind [ + "unwind" + ]; # https://github.com/benfred/remoteprocess/blob/v0.5.2/build.rs buildInputs = lib.optionals (supportsUnwind && stdenv.hostPlatform.isLinux) [ @@ -43,11 +50,17 @@ rustPlatform.buildRustPackage (finalAttrs: { (python3.withPackages (ps: [ ps.numpy ])) ]; + checkFlags = [ + # thread 'test_thread_names' (3078) panicked at tests/integration_test.rs:159:53: + # called `Option::unwrap()` on a `None` value + "--skip=test_thread_names" + ]; + meta = { description = "Sampling profiler for Python programs"; mainProgram = "py-spy"; homepage = "https://github.com/benfred/py-spy"; - changelog = "https://github.com/benfred/py-spy/releases/tag/v${finalAttrs.version}"; + changelog = "https://github.com/benfred/py-spy/releases/tag/${finalAttrs.src.tag}"; license = lib.licenses.mit; maintainers = [ ]; }; From a722c751a90c6ef6adf5c74e367aedf277c40fb9 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Tue, 4 Aug 2026 23:46:38 +0000 Subject: [PATCH 2/4] py-spy: add versionCheckHook --- pkgs/by-name/py/py-spy/package.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/by-name/py/py-spy/package.nix b/pkgs/by-name/py/py-spy/package.nix index beb8120fccf3..b49b32253836 100644 --- a/pkgs/by-name/py/py-spy/package.nix +++ b/pkgs/by-name/py/py-spy/package.nix @@ -10,6 +10,7 @@ # tests python3, + versionCheckHook, }: let @@ -56,6 +57,11 @@ rustPlatform.buildRustPackage (finalAttrs: { "--skip=test_thread_names" ]; + nativeInstallCheckInputs = [ + versionCheckHook + ]; + doInstallCheck = true; + meta = { description = "Sampling profiler for Python programs"; mainProgram = "py-spy"; From 3d9872bd09909a4b958d60f33ada2f39a44c59a8 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Tue, 4 Aug 2026 23:47:04 +0000 Subject: [PATCH 3/4] py-spy: add updateScript --- pkgs/by-name/py/py-spy/package.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/by-name/py/py-spy/package.nix b/pkgs/by-name/py/py-spy/package.nix index b49b32253836..7912f0d4a920 100644 --- a/pkgs/by-name/py/py-spy/package.nix +++ b/pkgs/by-name/py/py-spy/package.nix @@ -11,6 +11,9 @@ # tests python3, versionCheckHook, + + # passthru + nix-update-script, }: let @@ -62,6 +65,8 @@ rustPlatform.buildRustPackage (finalAttrs: { ]; doInstallCheck = true; + passthru.updateScript = nix-update-script { }; + meta = { description = "Sampling profiler for Python programs"; mainProgram = "py-spy"; From 2bf0e25ac62426473c58ab049e7bde5ce20e17d2 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Tue, 4 Aug 2026 23:52:19 +0000 Subject: [PATCH 4/4] py-spy: add GaetanLepage to maintainers --- pkgs/by-name/py/py-spy/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/py/py-spy/package.nix b/pkgs/by-name/py/py-spy/package.nix index 7912f0d4a920..f6f00ab87341 100644 --- a/pkgs/by-name/py/py-spy/package.nix +++ b/pkgs/by-name/py/py-spy/package.nix @@ -73,6 +73,6 @@ rustPlatform.buildRustPackage (finalAttrs: { homepage = "https://github.com/benfred/py-spy"; changelog = "https://github.com/benfred/py-spy/releases/tag/${finalAttrs.src.tag}"; license = lib.licenses.mit; - maintainers = [ ]; + maintainers = with lib.maintainers; [ GaetanLepage ]; }; })