Skip to content

Commit a5e85aa

Browse files
committed
fix(ruby): remove thread_id crate
1 parent 2e03575 commit a5e85aa

File tree

17 files changed

+57
-331
lines changed

17 files changed

+57
-331
lines changed

Cargo.lock

+36-44
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ members = [
2424
"pyroscope_backends/pyroscope_pyspy",
2525
"pyroscope_cli",
2626
"pyroscope_ffi/ruby/ext/rbspy",
27-
"pyroscope_ffi/ruby/ext/thread_id",
2827
"pyroscope_ffi/python/lib",
2928
"pyroscope_ffi/ffikit",
3029
]

docker/gem.Dockerfile

-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ ADD pyroscope_cli pyroscope_cli
2222
ADD pyroscope_ffi/ pyroscope_ffi/
2323
# TODO --frozen
2424
RUN --mount=type=cache,target=/root/.cargo/registry cargo build -p ffiruby --release
25-
RUN --mount=type=cache,target=/root/.cargo/registry cargo build -p thread_id --release
2625

2726
FROM ruby:3.3 as builder-gem
2827
WORKDIR /gem
@@ -31,7 +30,6 @@ ADD pyroscope_ffi/ruby /gem/
3130
RUN bundle install
3231

3332
COPY --from=builder /pyroscope-rs/target/release/librbspy.so lib/rbspy/rbspy.so
34-
COPY --from=builder /pyroscope-rs/target/release/libthread_id.so lib/thread_id/thread_id.so
3533
ARG TARGET_TASK
3634
RUN rake ${TARGET_TASK}
3735

pyroscope_ffi/ruby/Makefile

-3
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@
22
.phony: dev
33
dev:
44
cd ext/rbspy && cargo build --frozen --offline
5-
cd ext/thread_id && cargo build --frozen --offline
65
mkdir -p lib/rbspy/
76
cp ../../target/debug/librbspy.so lib/rbspy/rbspy.so
8-
mkdir -p lib/thread_id/
9-
cp ../../target/debug/libthread_id.so lib/thread_id/thread_id.so
107
bundle install
118
rake x86_64_linux:gem # todo wth is it so slow
129
for i in $$(ls -tr pkg/pyroscope-*-x86_64-linux.gem | tail -n 1); do gem install ./$$i; done;

pyroscope_ffi/ruby/Rakefile

-5
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ rescue Bundler::BundlerError => e
1313
exit e.status_code
1414
end
1515

16-
load File.expand_path('./ext/thread_id/Rakefile', __dir__)
1716
load File.expand_path('./ext/rbspy/Rakefile', __dir__)
1817

1918
task default: %w[hello]
@@ -33,7 +32,6 @@ namespace :x86_64_darwin do
3332
spec = Bundler.load_gemspec('pyroscope.gemspec')
3433
spec.platform = 'x86_64-darwin'
3534
spec.files += FileList['lib/rbspy/rbspy.*']
36-
spec.files += FileList['lib/thread_id/thread_id.*']
3735
spec.extensions = []
3836

3937
Gem::PackageTask.new(spec) do |pkg|
@@ -44,7 +42,6 @@ namespace :arm64_darwin do
4442
spec = Bundler.load_gemspec('pyroscope.gemspec')
4543
spec.platform = 'arm64-darwin'
4644
spec.files += FileList['lib/rbspy/rbspy.*']
47-
spec.files += FileList['lib/thread_id/thread_id.*']
4845
spec.extensions = []
4946

5047
Gem::PackageTask.new(spec) do |pkg|
@@ -56,7 +53,6 @@ namespace :x86_64_linux do
5653
spec.platform = 'x86_64-linux'
5754
spec.files += FileList['lib/rbspy/rbspy.*']
5855
spec.files += FileList['lib/rbspy.libs/*']
59-
spec.files += FileList['lib/thread_id/thread_id.*']
6056
spec.extensions = []
6157

6258
Gem::PackageTask.new(spec) do |pkg|
@@ -68,7 +64,6 @@ namespace :aarch64_linux do
6864
spec.platform = 'aarch64-linux'
6965
spec.files += FileList['lib/rbspy/rbspy.*']
7066
spec.files += FileList['lib/rbspy.libs/*']
71-
spec.files += FileList['lib/thread_id/thread_id.*']
7267
spec.extensions = []
7368

7469
Gem::PackageTask.new(spec) do |pkg|

pyroscope_ffi/ruby/ext/rbspy/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ ffikit = { path = "../../../ffikit" }
1515
# todo remove this dependency
1616
pretty_env_logger = "0.5"
1717
log = "0.4"
18+
libc = "0.2.171"
1819

1920
[build-dependencies]
2021
cbindgen = "0.28"

pyroscope_ffi/ruby/ext/rbspy/include/rbspy.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ bool initialize_agent(const char *application_name,
3232

3333
bool drop_agent(void);
3434

35-
bool add_thread_tag(uint64_t thread_id, const char *key, const char *value);
35+
bool add_thread_tag(const char *key, const char *value);
3636

37-
bool remove_thread_tag(uint64_t thread_id, const char *key, const char *value);
37+
bool remove_thread_tag(const char *key, const char *value);
3838

3939
bool add_global_tag(const char *key, const char *value);
4040

0 commit comments

Comments
 (0)