|
| 1 | +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Ludovic Henry <git@ludovic.dev> |
| 3 | +Date: Sat, 10 Oct 2026 07:57:26 +0000 |
| 4 | +Subject: [PATCH] cargo: build py-spy from a locally patched checkout |
| 5 | + |
| 6 | +py-spy does not compile for riscv64: pyruntime::get_tstate_current_offset |
| 7 | +is defined once per architecture and riscv64 matches none of the arms, so |
| 8 | +the build fails with |
| 9 | + |
| 10 | + error[E0425]: cannot find function `get_tstate_current_offset` in module `pyruntime` |
| 11 | + |
| 12 | +py-spy is pulled in as a git dependency pinned to a revision, so the fix |
| 13 | +cannot be applied in place. Redirect the git source to a checkout of that |
| 14 | +same revision carrying the one-line riscv64 addition, see |
| 15 | +0002-python_bindings-return-no-tstate_current-offset-on-riscv64.patch. |
| 16 | + |
| 17 | +Only the source line of the py-spy entry changes in Cargo.lock, so every |
| 18 | +other dependency stays pinned exactly as upstream released it and the |
| 19 | +build keeps running with --locked. |
| 20 | + |
| 21 | +Upstream-Status: Inappropriate [redirects a pinned dependency to a local checkout; the fix itself belongs in py-spy] |
| 22 | + |
| 23 | +Signed-off-by: Ludovic Henry <git@ludovic.dev> |
| 24 | +--- |
| 25 | + rust/Cargo.lock | 1 - |
| 26 | + rust/Cargo.toml | 3 +++ |
| 27 | + 2 files changed, 3 insertions(+), 1 deletion(-) |
| 28 | + |
| 29 | +diff --git a/rust/Cargo.lock b/rust/Cargo.lock |
| 30 | +index 111e9f2..6ac561f 100644 |
| 31 | +--- a/rust/Cargo.lock |
| 32 | ++++ b/rust/Cargo.lock |
| 33 | +@@ -1180,7 +1180,6 @@ dependencies = [ |
| 34 | + [[package]] |
| 35 | + name = "py-spy" |
| 36 | + version = "0.4.2" |
| 37 | +-source = "git+https://github.com/grafana/pyroscope-py-spy?rev=ad722cc#ad722cce3599f3ee8072be59b2661974170b8721" |
| 38 | + dependencies = [ |
| 39 | + "anyhow", |
| 40 | + "chrono", |
| 41 | +diff --git a/rust/Cargo.toml b/rust/Cargo.toml |
| 42 | +index 883de47..a23032e 100644 |
| 43 | +--- a/rust/Cargo.toml |
| 44 | ++++ b/rust/Cargo.toml |
| 45 | +@@ -28,3 +28,6 @@ pyo3 = { version = "0.29.0", features = ["extension-module"] } |
| 46 | + |
| 47 | + [build-dependencies] |
| 48 | + cmake = "0.1" |
| 49 | ++ |
| 50 | ++[patch."https://github.com/grafana/pyroscope-py-spy"] |
| 51 | ++py-spy = { path = "../py-spy" } |
0 commit comments