Skip to content

Commit 0a47810

Browse files
authored
rbspy: get rid of fork (#193)
1 parent cc4be78 commit 0a47810

File tree

16 files changed

+398
-636
lines changed

16 files changed

+398
-636
lines changed

Cargo.lock

Lines changed: 344 additions & 563 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docker/Dockerfile.manylinux2014_aarch64

Lines changed: 0 additions & 17 deletions
This file was deleted.

docker/Dockerfile.manylinux2014_x86_64

Lines changed: 0 additions & 17 deletions
This file was deleted.

docker/gem.Dockerfile

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
1-
ARG BASE
2-
3-
FROM ${BASE} as builder-native
1+
ARG PLATFORM=x86_64
2+
FROM quay.io/pypa/manylinux2014_${PLATFORM} AS builder
3+
4+
ENV RUST_VERSION=1.82
5+
RUN curl https://static.rust-lang.org/rustup/dist/$(arch)-unknown-linux-musl/rustup-init -o ./rustup-init \
6+
&& chmod +x ./rustup-init \
7+
&& ./rustup-init -y --default-toolchain=${RUST_VERSION} --default-host=$(arch)-unknown-linux-gnu
8+
ENV PATH=/root/.cargo/bin:$PATH
9+
RUN yum -y install gcc libffi-devel openssl-devel wget gcc-c++ glibc-devel make
10+
11+
# for python
12+
ENV LIBUNWIND_VERSION=1.8.1
13+
RUN wget https://github.com/libunwind/libunwind/releases/download/v${LIBUNWIND_VERSION}/libunwind-${LIBUNWIND_VERSION}.tar.gz \
14+
&& tar -zxvf libunwind-${LIBUNWIND_VERSION}.tar.gz \
15+
&& cd libunwind-${LIBUNWIND_VERSION} \
16+
&& ./configure --disable-minidebuginfo --enable-ptrace --disable-tests --disable-documentation \
17+
&& make \
18+
&& make install
419

520
WORKDIR /pyroscope-rs
621

@@ -14,7 +29,7 @@ ADD src src
1429
ADD pyroscope_backends pyroscope_backends
1530
ADD pyroscope_cli pyroscope_cli
1631
ADD pyroscope_ffi/ pyroscope_ffi/
17-
RUN cargo build -p rbspy --release
32+
RUN cargo build -p ffiruby --release
1833
RUN cargo build -p thread_id --release
1934

2035
FROM ruby:3.3 as builder-gem
@@ -23,8 +38,8 @@ ADD pyroscope_ffi/ruby /gem/
2338

2439
RUN bundle install
2540

26-
COPY --from=builder-native /pyroscope-rs/target/release/librbspy.so lib/rbspy/rbspy.so
27-
COPY --from=builder-native /pyroscope-rs/target/release/libthread_id.so lib/thread_id/thread_id.so
41+
COPY --from=builder /pyroscope-rs/target/release/librbspy.so lib/rbspy/rbspy.so
42+
COPY --from=builder /pyroscope-rs/target/release/libthread_id.so lib/thread_id/thread_id.so
2843
ARG TARGET_TASK
2944
RUN rake ${TARGET_TASK}
3045

ffi.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ wheel/mac/arm64:
4747
.phony: gem/linux/amd64
4848
gem/linux/amd64: pyroscope_ffi/clean
4949
docker buildx build \
50-
--build-arg=BASE=$(MANYLINUX_PREFIX)_$(BUILD_ARCH_AMD):$(MANYLINUX_VERSION) \
50+
--build-arg=PLATFORM=x86_64 \
5151
--build-arg="TARGET_TASK=x86_64_linux:gem" \
5252
--output=pyroscope_ffi/ruby \
5353
--platform=linux/amd64 \
@@ -57,7 +57,7 @@ gem/linux/amd64: pyroscope_ffi/clean
5757
.phony: gem/linux/arm64
5858
gem/linux/arm64: pyroscope_ffi/clean
5959
docker buildx build \
60-
--build-arg=BASE=$(MANYLINUX_PREFIX)_$(BUILD_ARCH_ARM):$(MANYLINUX_VERSION) \
60+
--build-arg=PLATFORM=aarch64 \
6161
--build-arg="TARGET_TASK=aarch64_linux:gem" \
6262
--output=pyroscope_ffi/ruby \
6363
--platform=linux/arm64 \

pyroscope_backends/pyroscope_pprofrs/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ readme = "README.md"
1717
[dependencies]
1818
pprof2 = "0.13"
1919
pyroscope = { version = "0.5.7", path = "../..", default-features = false }
20-
thiserror ="1.0"
20+
thiserror = "2.0.11"
2121
log = "0.4"
2222

2323
[features]

pyroscope_backends/pyroscope_pyspy/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ readme = "README.md"
1616
[dependencies]
1717
py-spy = "0.4.0"
1818
pyroscope = { version = "0.5.7", path = "../../" , default-features = false }
19-
thiserror ="1.0"
19+
thiserror = "2.0.11"
2020
log = "0.4"
21-
inferno = "0.11.21"
21+
inferno = "0.12.1"
2222

2323
[features]
2424
default = ["pyroscope/default"]

pyroscope_backends/pyroscope_rbspy/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ repository = "https://github.com/pyroscope-io/pyroscope-rs"
1414
readme = "README.md"
1515

1616
[dependencies]
17-
pyroscope-rbspy-oncpu = { version="0.19.1" }
17+
rbspy = { version="0.31.0" }
1818
pyroscope = { version = "0.5.7", path = "../../", default-features = false }
1919
thiserror ="1.0"
2020
log = "0.4"

pyroscope_backends/pyroscope_rbspy/src/lib.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use pyroscope::{
55
},
66
error::{PyroscopeError, Result},
77
};
8-
use pyroscope_rbspy_oncpu::sampler::Sampler;
8+
use rbspy::sampler::Sampler;
99
use std::{
1010
ops::Deref,
1111
sync::{
@@ -234,8 +234,8 @@ impl Backend for Rbspy {
234234

235235
// Channel for StackTraces generated by the RubySpy Sampler
236236
let (stack_sender, stack_receiver): (
237-
SyncSender<pyroscope_rbspy_oncpu::StackTrace>,
238-
Receiver<pyroscope_rbspy_oncpu::StackTrace>,
237+
SyncSender<rbspy::StackTrace>,
238+
Receiver<rbspy::StackTrace>,
239239
) = sync_channel(queue_size);
240240

241241
// Set Error and Stack Receivers
@@ -312,8 +312,8 @@ impl From<StackFrameWrapper> for StackFrame {
312312
}
313313
}
314314

315-
impl From<pyroscope_rbspy_oncpu::StackFrame> for StackFrameWrapper {
316-
fn from(frame: pyroscope_rbspy_oncpu::StackFrame) -> Self {
315+
impl From<rbspy::StackFrame> for StackFrameWrapper {
316+
fn from(frame: rbspy::StackFrame) -> Self {
317317
StackFrameWrapper(StackFrame {
318318
module: None,
319319
name: Some(frame.name),
@@ -333,8 +333,8 @@ impl From<StackTraceWrapper> for StackTrace {
333333
}
334334
}
335335

336-
impl From<(pyroscope_rbspy_oncpu::StackTrace, &BackendConfig)> for StackTraceWrapper {
337-
fn from(arg: (pyroscope_rbspy_oncpu::StackTrace, &BackendConfig)) -> Self {
336+
impl From<(rbspy::StackTrace, &BackendConfig)> for StackTraceWrapper {
337+
fn from(arg: (rbspy::StackTrace, &BackendConfig)) -> Self {
338338
let (trace, config) = arg;
339339

340340
StackTraceWrapper(StackTrace::new(

pyroscope_cli/Cargo.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ rust-version = "1.64"
1616

1717

1818
[dependencies]
19-
human-panic = "1.0.3"
19+
human-panic = "2.0.2"
2020
pretty_env_logger = "0.5.0"
2121
better-panic = "0.3.0"
22-
log = "=0.4.17"
23-
clap_complete = "3.2"
24-
names= "0.13.0"
22+
log = "0.4.25"
23+
clap_complete = "4.5.44"
24+
names= "0.14.0"
2525
ctrlc = "3.2.2"
2626
duct = "0.13.5"
2727
serde = { version = "1.0", features = ["derive"] }
28-
thiserror = "1.0.30"
29-
color-backtrace = "0.5.1"
28+
thiserror = "2.0.11"
29+
color-backtrace = "0.6.1"
3030
config = "=0.11.0"
3131
lazy_static = "1.4.0"
3232
slog = "2.7.0"
@@ -41,12 +41,12 @@ pyroscope_pyspy = { path = "../pyroscope_backends/pyroscope_pyspy", default-feat
4141
serde_json = "1.0.115"
4242

4343
[dependencies.clap]
44-
version = "3.2"
44+
version = "4.5.28"
4545
features = ["cargo", "derive"]
4646

4747
[dev-dependencies]
4848
assert_cmd = "2.0.4"
49-
predicates = "2.1.1"
49+
predicates = "3.1.3"
5050

5151
[features]
5252
default = ["pyroscope/default", "pyroscope_pprofrs/default", "pyroscope_rbspy/default", "pyroscope_pyspy/default"]

0 commit comments

Comments
 (0)