Skip to content

chore(ruby): remove thread_id crate #217

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 36 additions & 44 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ members = [
"pyroscope_backends/pyroscope_pyspy",
"pyroscope_cli",
"pyroscope_ffi/ruby/ext/rbspy",
"pyroscope_ffi/ruby/ext/thread_id",
"pyroscope_ffi/python/lib",
"pyroscope_ffi/ffikit",
]
Expand Down
2 changes: 0 additions & 2 deletions docker/gem.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ ADD pyroscope_cli pyroscope_cli
ADD pyroscope_ffi/ pyroscope_ffi/
# TODO --frozen
RUN --mount=type=cache,target=/root/.cargo/registry cargo build -p ffiruby --release
RUN --mount=type=cache,target=/root/.cargo/registry cargo build -p thread_id --release

FROM ruby:3.3 as builder-gem
WORKDIR /gem
Expand All @@ -31,7 +30,6 @@ ADD pyroscope_ffi/ruby /gem/
RUN bundle install

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

Expand Down
2 changes: 0 additions & 2 deletions ffi.mk
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,11 @@ gem/mac/amd64: pyroscope_ffi/clean
cd pyroscope_ffi/ruby && \
bundle && \
RUST_TARGET=x86_64-apple-darwin rake rbspy_install && \
RUST_TARGET=x86_64-apple-darwin rake thread_id_install && \
RUST_TARGET=x86_64-apple-darwin rake x86_64_darwin:gem

.phony: gem/mac/arm64
gem/mac/arm64: pyroscope_ffi/clean
cd pyroscope_ffi/ruby && \
bundle && \
RUST_TARGET=aarch64-apple-darwin rake rbspy_install && \
RUST_TARGET=aarch64-apple-darwin rake thread_id_install && \
RUST_TARGET=aarch64-apple-darwin rake arm64_darwin:gem
3 changes: 0 additions & 3 deletions pyroscope_ffi/ruby/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@
.phony: dev
dev:
cd ext/rbspy && cargo build --frozen --offline
cd ext/thread_id && cargo build --frozen --offline
mkdir -p lib/rbspy/
cp ../../target/debug/librbspy.so lib/rbspy/rbspy.so
mkdir -p lib/thread_id/
cp ../../target/debug/libthread_id.so lib/thread_id/thread_id.so
bundle install
rake x86_64_linux:gem # todo wth is it so slow
for i in $$(ls -tr pkg/pyroscope-*-x86_64-linux.gem | tail -n 1); do gem install ./$$i; done;
Expand Down
5 changes: 0 additions & 5 deletions pyroscope_ffi/ruby/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ rescue Bundler::BundlerError => e
exit e.status_code
end

load File.expand_path('./ext/thread_id/Rakefile', __dir__)
load File.expand_path('./ext/rbspy/Rakefile', __dir__)

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

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

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

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

Gem::PackageTask.new(spec) do |pkg|
Expand Down
1 change: 1 addition & 0 deletions pyroscope_ffi/ruby/ext/rbspy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ ffikit = { path = "../../../ffikit" }
# todo remove this dependency
pretty_env_logger = "0.5"
log = "0.4"
libc = "0.2.171"

[build-dependencies]
cbindgen = "0.28"
Expand Down
4 changes: 2 additions & 2 deletions pyroscope_ffi/ruby/ext/rbspy/include/rbspy.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ bool initialize_agent(const char *application_name,

bool drop_agent(void);

bool add_thread_tag(uint64_t thread_id, const char *key, const char *value);
bool add_thread_tag(const char *key, const char *value);

bool remove_thread_tag(uint64_t thread_id, const char *key, const char *value);
bool remove_thread_tag(const char *key, const char *value);

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

Expand Down
Loading