diff --git a/docs/packages/pyroscope-io.yaml b/docs/packages/pyroscope-io.yaml index c6d0104c75d4..9d88bce06c4b 100644 --- a/docs/packages/pyroscope-io.yaml +++ b/docs/packages/pyroscope-io.yaml @@ -67,3 +67,5 @@ versions: - filename: pyroscope_io-1.2.5-cp314-cp314-manylinux_2_38_riscv64.manylinux_2_39_riscv64.whl sha256: 02c2fa5e21b22154a90404c596ff2bf68c55525648868374d16a988424bc9ee4 requires-python: '>=3.10' +- version: 1.3.0 +- version: 1.4.0 diff --git a/patches/pyroscope-io/1.3.0/0001-cargo-build-py-spy-from-a-locally-patched-checkout.patch b/patches/pyroscope-io/1.3.0/0001-cargo-build-py-spy-from-a-locally-patched-checkout.patch new file mode 100644 index 000000000000..bc477731c299 --- /dev/null +++ b/patches/pyroscope-io/1.3.0/0001-cargo-build-py-spy-from-a-locally-patched-checkout.patch @@ -0,0 +1,51 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Ludovic Henry +Date: Sat, 10 Oct 2026 07:57:26 +0000 +Subject: [PATCH] cargo: build py-spy from a locally patched checkout + +py-spy does not compile for riscv64: pyruntime::get_tstate_current_offset +is defined once per architecture and riscv64 matches none of the arms, so +the build fails with + + error[E0425]: cannot find function `get_tstate_current_offset` in module `pyruntime` + +py-spy is pulled in as a git dependency pinned to a revision, so the fix +cannot be applied in place. Redirect the git source to a checkout of that +same revision carrying the one-line riscv64 addition, see +0002-python_bindings-return-no-tstate_current-offset-on-riscv64.patch. + +Only the source line of the py-spy entry changes in Cargo.lock, so every +other dependency stays pinned exactly as upstream released it and the +build keeps running with --locked. + +Upstream-Status: Inappropriate [redirects a pinned dependency to a local checkout; the fix itself belongs in py-spy] + +Signed-off-by: Ludovic Henry +--- + rust/Cargo.lock | 1 - + rust/Cargo.toml | 3 +++ + 2 files changed, 3 insertions(+), 1 deletion(-) + +diff --git a/rust/Cargo.lock b/rust/Cargo.lock +index 111e9f2..6ac561f 100644 +--- a/rust/Cargo.lock ++++ b/rust/Cargo.lock +@@ -1180,7 +1180,6 @@ dependencies = [ + [[package]] + name = "py-spy" + version = "0.4.2" +-source = "git+https://github.com/grafana/pyroscope-py-spy?rev=ad722cc#ad722cce3599f3ee8072be59b2661974170b8721" + dependencies = [ + "anyhow", + "chrono", +diff --git a/rust/Cargo.toml b/rust/Cargo.toml +index 883de47..a23032e 100644 +--- a/rust/Cargo.toml ++++ b/rust/Cargo.toml +@@ -28,3 +28,6 @@ pyo3 = { version = "0.29.0", features = ["extension-module"] } + + [build-dependencies] + cmake = "0.1" ++ ++[patch."https://github.com/grafana/pyroscope-py-spy"] ++py-spy = { path = "../py-spy" } diff --git a/patches/pyroscope-io/1.3.0/0002-python_bindings-return-no-tstate_current-offset-on-riscv64.patch b/patches/pyroscope-io/1.3.0/0002-python_bindings-return-no-tstate_current-offset-on-riscv64.patch new file mode 100644 index 000000000000..43854e058787 --- /dev/null +++ b/patches/pyroscope-io/1.3.0/0002-python_bindings-return-no-tstate_current-offset-on-riscv64.patch @@ -0,0 +1,37 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Ludovic Henry +Date: Thu, 27 Aug 2026 00:00:00 +0000 +Subject: [PATCH] python_bindings: return no tstate_current offset on riscv64 + +Applied to the py-spy checkout that pyroscope-python pins as a git +dependency. + +pyruntime::get_tstate_current_offset has one definition per architecture +and riscv64 matches none of them, so any riscv64 build of py-spy fails to +compile: + + error[E0425]: cannot find function `get_tstate_current_offset` in module `pyruntime` + +Add riscv64 to the arm that returns None, the same answer powerpc, powerpc64 +and mips give. The offset is only consulted for CPython 3.7 to 3.11, where +the caller already handles None by reporting an unknown offset; 3.12 and +later read the GIL through a struct offset instead. + +Upstream-Status: To upstream [targets the py-spy dependency rather than pyroscope-python; not yet submitted to benfred/py-spy] + +Signed-off-by: Ludovic Henry +--- +diff --git a/src/python_bindings/mod.rs b/src/python_bindings/mod.rs +index 772e4de..df9e4cb 100644 +--- a/src/python_bindings/mod.rs ++++ b/src/python_bindings/mod.rs +@@ -195,7 +195,8 @@ pub mod pyruntime { + any( + target_arch = "powerpc64", + target_arch = "powerpc", +- target_arch = "mips" ++ target_arch = "mips", ++ target_arch = "riscv64" + ) + ))] + pub fn get_tstate_current_offset(version: &Version) -> Option { diff --git a/patches/pyroscope-io/1.4.0/0001-cargo-build-py-spy-from-a-locally-patched-checkout.patch b/patches/pyroscope-io/1.4.0/0001-cargo-build-py-spy-from-a-locally-patched-checkout.patch new file mode 100644 index 000000000000..0a5803111754 --- /dev/null +++ b/patches/pyroscope-io/1.4.0/0001-cargo-build-py-spy-from-a-locally-patched-checkout.patch @@ -0,0 +1,51 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Ludovic Henry +Date: Sat, 10 Oct 2026 07:57:26 +0000 +Subject: [PATCH] cargo: build py-spy from a locally patched checkout + +py-spy does not compile for riscv64: pyruntime::get_tstate_current_offset +is defined once per architecture and riscv64 matches none of the arms, so +the build fails with + + error[E0425]: cannot find function `get_tstate_current_offset` in module `pyruntime` + +py-spy is pulled in as a git dependency pinned to a revision, so the fix +cannot be applied in place. Redirect the git source to a checkout of that +same revision carrying the one-line riscv64 addition, see +0002-python_bindings-return-no-tstate_current-offset-on-riscv64.patch. + +Only the source line of the py-spy entry changes in Cargo.lock, so every +other dependency stays pinned exactly as upstream released it and the +build keeps running with --locked. + +Upstream-Status: Inappropriate [redirects a pinned dependency to a local checkout; the fix itself belongs in py-spy] + +Signed-off-by: Ludovic Henry +--- + rust/Cargo.lock | 1 - + rust/Cargo.toml | 3 +++ + 2 files changed, 3 insertions(+), 1 deletion(-) + +diff --git a/rust/Cargo.lock b/rust/Cargo.lock +index 10c2d0b..3f6a646 100644 +--- a/rust/Cargo.lock ++++ b/rust/Cargo.lock +@@ -1182,7 +1182,6 @@ dependencies = [ + [[package]] + name = "py-spy" + version = "0.4.2" +-source = "git+https://github.com/grafana/pyroscope-py-spy?rev=44736d9#44736d9a6fa69f29cd067790e11637018952de61" + dependencies = [ + "anyhow", + "chrono", +diff --git a/rust/Cargo.toml b/rust/Cargo.toml +index d7ca23b..4f61bef 100644 +--- a/rust/Cargo.toml ++++ b/rust/Cargo.toml +@@ -28,3 +28,6 @@ pyo3 = { version = "0.30.1", features = ["extension-module"] } + + [build-dependencies] + cmake = "0.1" ++ ++[patch."https://github.com/grafana/pyroscope-py-spy"] ++py-spy = { path = "../py-spy" } diff --git a/patches/pyroscope-io/1.4.0/0002-python_bindings-return-no-tstate_current-offset-on-riscv64.patch b/patches/pyroscope-io/1.4.0/0002-python_bindings-return-no-tstate_current-offset-on-riscv64.patch new file mode 100644 index 000000000000..43854e058787 --- /dev/null +++ b/patches/pyroscope-io/1.4.0/0002-python_bindings-return-no-tstate_current-offset-on-riscv64.patch @@ -0,0 +1,37 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Ludovic Henry +Date: Thu, 27 Aug 2026 00:00:00 +0000 +Subject: [PATCH] python_bindings: return no tstate_current offset on riscv64 + +Applied to the py-spy checkout that pyroscope-python pins as a git +dependency. + +pyruntime::get_tstate_current_offset has one definition per architecture +and riscv64 matches none of them, so any riscv64 build of py-spy fails to +compile: + + error[E0425]: cannot find function `get_tstate_current_offset` in module `pyruntime` + +Add riscv64 to the arm that returns None, the same answer powerpc, powerpc64 +and mips give. The offset is only consulted for CPython 3.7 to 3.11, where +the caller already handles None by reporting an unknown offset; 3.12 and +later read the GIL through a struct offset instead. + +Upstream-Status: To upstream [targets the py-spy dependency rather than pyroscope-python; not yet submitted to benfred/py-spy] + +Signed-off-by: Ludovic Henry +--- +diff --git a/src/python_bindings/mod.rs b/src/python_bindings/mod.rs +index 772e4de..df9e4cb 100644 +--- a/src/python_bindings/mod.rs ++++ b/src/python_bindings/mod.rs +@@ -195,7 +195,8 @@ pub mod pyruntime { + any( + target_arch = "powerpc64", + target_arch = "powerpc", +- target_arch = "mips" ++ target_arch = "mips", ++ target_arch = "riscv64" + ) + ))] + pub fn get_tstate_current_offset(version: &Version) -> Option {