Skip to content

[rustjava-tracing-attributes-pin-removal] fix: unfreeze tracing family by replacing the sole #[instrument] with a manual span - #4

Merged
Jun025 merged 3 commits into
mainfrom
tracing-attributes-pin-removal
Jul 22, 2026
Merged

[rustjava-tracing-attributes-pin-removal] fix: unfreeze tracing family by replacing the sole #[instrument] with a manual span#4
Jun025 merged 3 commits into
mainfrom
tracing-attributes-pin-removal

Conversation

@Jun025

@Jun025 Jun025 commented Jul 22, 2026

Copy link
Copy Markdown
Owner

What

java_runtime carried a direct tracing-attributes = "<0.1.29" pin to avoid the no_std compile error from #[tracing::instrument] (tokio-rs/tracing#3388). That pin froze the entire tracing family at 0.1.41 — tracing 0.1.44 requires tracing-attributes 0.1.31, so dependabot PRs (dlunch#149, dlunch#147) died as "no longer updatable". The only code forcing the pin was one #[tracing::instrument] in Thread's spawn callback.

Changes

  • thread.rs: #[tracing::instrument(name = "java thread", fields(id = self.thread_id), skip_all)] → manual tracing::info_span!("java thread", id = self.thread_id) + .instrument(span) on the body. Same span name, field, level (INFO — instrument's default), and target; no attribute macro, so no_std-safe.
  • java_runtime/Cargo.toml: direct tracing-attributes dependency + pin removed.
  • workspace Cargo.toml: tracing's attributes feature dropped (no #[instrument] remains in the workspace).
  • Cargo.lock (tracing family only, zero unrelated crates):
    • tracing 0.1.41 → 0.1.44 — the resolution that was previously impossible, proving the freeze is lifted
    • tracing-subscriber 0.3.20 → 0.3.23
    • tracing-attributes removed from the dependency graph entirely
  • rust.yml: the wasm32 clippy step was missing workspace coverage (only the root package). Now --workspace --exclude test_utils. The exclusion is structural, not cosmetic: test_utils needs tokio rt-multi-thread, which hits tokio's compile_error! on wasm — a naive --all can never pass. Zero new warnings from the newly covered crates (classfile, java_runtime, jvm, jvm_rust, java_class_proto, java_constants) — no suppressions added, no follow-up split needed.

Evidence

  • cargo test --all: 140 passed, 0 failed.
  • cargo clippy --all -- -D warnings and cargo clippy --workspace --exclude test_utils --target wasm32-unknown-unknown -- -D warnings: clean. wasm32 is the no_std target the pin existed to protect — it builds clean without the pin.
  • Span regression check: ran a Thread.start() demo binary with RUST_LOG=java_runtime=trace before and after; after stripping timestamps and the run-dependent thread id (a hashCode), the outputs are byte-identical:
    TRACE java thread{id=N}: java_runtime::classes::java::lang::thread: Thread start
    

Merge note

Same as #3: this PR also adds STATE.md/REPORT.md — later merges hit add/add conflicts; resolve by merging main into the remaining branch and taking the newest branch's superset versions.

Non-goals (per ticket)

  • Pushing tracing to absolute latest is not the goal — unfreezing is; dependabot can take it from here.
  • No upstream (dlunch/RustJava) contact.
  • No observability redesign.

🤖 Generated with Claude Code

jun0 and others added 3 commits July 22, 2026 18:37
java_runtime carried a direct tracing-attributes = "<0.1.29" dependency
to dodge the no_std compile error in tokio-rs/tracing#3388, which froze
the whole tracing family at 0.1.41 and made dependabot PRs unresolvable
(tracing 0.1.44 requires tracing-attributes 0.1.31, conflicting with
the pin). The only code forcing this was a single #[tracing::instrument]
in Thread's spawn callback.

- thread.rs: replace #[tracing::instrument(name = "java thread",
  fields(id = self.thread_id), skip_all)] with a manual
  tracing::info_span! + Instrument combinator (no_std-safe; identical
  span name, field, level, and target — verified by comparing RUST_LOG
  output before/after)
- java_runtime/Cargo.toml: drop the tracing-attributes direct dep + pin
- workspace Cargo.toml: drop tracing's now-unused "attributes" feature
- Cargo.lock: tracing family only — tracing 0.1.41 -> 0.1.44 (the
  previously impossible resolution), tracing-subscriber 0.3.20 -> 0.3.23,
  tracing-attributes removed from the graph; zero unrelated crates
- rust.yml: wasm32 clippy was missing workspace coverage; now
  --workspace --exclude test_utils (test_utils requires tokio
  rt-multi-thread, which has a compile_error! on wasm)

Verified: cargo test --all green (140 passed), clippy -D warnings clean
natively and on wasm32-unknown-unknown (the no_std target the pin
existed to protect).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Superset content covering all three in-flight PRs so later add/add
merges resolve by taking the newest branch's version.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…esolution

STATE.md/REPORT.md superset per recorded strategy. No code changes vs
approved pin 0a19f38.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Jun025
Jun025 merged commit fa92ef9 into main Jul 22, 2026
7 of 8 checks passed
@Jun025
Jun025 deleted the tracing-attributes-pin-removal branch July 22, 2026 22:26
Jun025 pushed a commit that referenced this pull request Jul 22, 2026
…arset-exception

STATE.md/REPORT.md superset resolution.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Jun025 added a commit that referenced this pull request Jul 31, 2026
Judged the two remaining remote branches on the fork:

- dependabot/cargo/tracing-attributes-0.1.31: deleted. PR #4 (fa92ef9)
  removed the tracing-attributes direct dependency outright, so the
  branch patches a Cargo.toml line that no longer exists.
- wie-ktf-hardening: preserved. 8 of its 12 commits are already in
  upstream/main via squash merges (dlunch#174 dlunch#175 dlunch#176 dlunch#177 dlunch#180 dlunch#182);
  git cherry missed this because origin/main trails upstream/main by
  20 commits. 4 commits carry residual value.

No code changes.

Co-authored-by: jun0 <junyoung.choi.a@miraeasset.com>
Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant