Conversation
Rust's cdylib linker emits a version script with `local: *` that hides all non-Rust symbols, preventing `custom_labels_current_set_v2` from appearing in the dynamic symbol table. Without a dynsym entry, external readers (e.g. the eBPF profiler) cannot locate the thread-local slot. Add a supplementary version script with an explicit `global:` entry for the symbol, which takes precedence over the `local: *` wildcard. Also force lld explicitly, since merging multiple version scripts is not supported by GNU ld. Also adds a temporary dummy FFI wrapper around `ThreadContext::attach` to keep the TLSDESC access live during verification. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Clippy Allow Annotation ReportComparing clippy allow annotations between branches:
Summary by Rule
Annotation Counts by File
Annotation Stats by Crate
About This ReportThis report tracks Clippy allow annotations for specific rules, showing how they've changed in this PR. Decreasing the number of these annotations generally improves code quality. |
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
✨ Fix all issues with BitsAI or with Cursor
|
…mbol Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 05868a50b9
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const SYMBOL: &str = "otel_thread_ctx_v1"; | ||
|
|
||
| fn cdylib_path() -> PathBuf { | ||
| PathBuf::from(env!("CDYLIB_PROFILE_DIR")).join("liblibdd_otel_thread_ctx_ffi.so") |
There was a problem hiding this comment.
Point ELF tests at Cargo's deps output directory
During cargo test, Cargo emits cdylib artifacts under target/<profile>/deps, but cdylib_path() currently looks in target/<profile>. That means readelf is invoked on a non-existent file in normal test runs, so these new ELF-property tests fail even when the library is built correctly. Resolve the path from the deps directory (or otherwise discover the real artifact path) so the assertions run against the actual .so.
Useful? React with 👍 / 👎.
e2bb632 to
e98d81f
Compare
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
e98d81f to
75add55
Compare
What does this PR do?
This PR adds a basic FFI for the OTel thread-level context feature: create a new context, attach, detach, and update in place.
We also make
ThreadContextRecordpublic, or at least exposed in the FFI. The rationale is that:ThreadContextRecordis a way to document its expected memory layout.Generated C header
Motivation
OTel thread-level context has been implemented in #1791 in order to provide better interop with the OTel eBPF profiler. The first user is supposed to be dd-trace-rs, but it turns out the dotnet SDK people are interested in using it as well (and eventually other non-Rust SDKs will use it and thus require an FFI).
Additional Notes
N/A
How to test the change?
There's a test to check that the TLS symbol is properly handled. For real usage, we plan to check when integrating in dotnet (or whichever is the first SDK to use it).