Skip to content

build(sentry): Remove unused optional serde_json dependency - #1389

Merged
szokeasaurusrex merged 3 commits into
masterfrom
szokeasaurusrex/remove-serde-json-dep
Nov 3, 2026
Merged

szokeasaurusrex merged 3 commits into
masterfrom
szokeasaurusrex/remove-serde-json-dep

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

The sentry crate declared serde_json as an optional dependency but never used it. Because it wasn't referenced via dep: in [features], Cargo exposed an implicit serde_json feature that only pulled in the unused crate.

This replaces the optional dependency with an empty serde_json = [] feature, so anyone with features = ["serde_json"] keeps building. The feature is soft-deprecated through a Cargo.toml comment and an Unreleased changelog entry only. Cargo has no way to warn downstream users about deprecated features: build script cargo::warnings and #[deprecated] lints are hidden for non-path dependencies, so no build script or lint was added.

The crate-level feature table in sentry/src/lib.rs doesn't list serde_json, so the crate docs and README are unchanged.

Checks run locally: cargo fmt --check, cargo check -p sentry --all-targets (default and --all-features), cargo check -p sentry --lib --tests --no-default-features --features serde_json, cargo check --workspace --all-features --all-targets --locked, cargo clippy -p sentry --all-features --tests -D warnings, and cargo test -p sentry --all-features. All pass. --all-targets --no-default-features fails on the examples, but it does the same on master. cargo metadata confirms sentry still exposes serde_json as an empty feature.

Fixes #1385
Fixes RUST-311
Removal tracked in #1387
Removal tracked in RUST-313

via @szokeasaurusrex.

--

View Junior Session [Sentry]

The `sentry` crate declared `serde_json` as an optional dependency, but never used it. Because the dependency was not referenced via `dep:` in `[features]`, Cargo exposed an implicit `serde_json` feature that only pulled in the unused crate.

Replace the optional dependency with an empty `serde_json` feature, so existing `features = ["serde_json"]` users keep building. The feature is soft-deprecated via a `Cargo.toml` comment and a changelog entry only: Cargo has no mechanism to warn downstream users about deprecated features (build script `cargo::warning`s and lints are hidden for non-path dependencies). Removal of the feature is tracked in #1387.

Fixes #1385
References #1387

Co-Authored-By: Dr. Daniel Szokenstein <[email protected]>
@sentry-junior
sentry-junior Bot requested a review from a team as a code owner October 29, 2026 10:04
Comment thread CHANGELOG.md Resolved
@szokeasaurusrex
szokeasaurusrex enabled auto-merge (squash) October 29, 2026 10:13
@linear-code

linear-code Bot commented Oct 29, 2026

Copy link
Copy Markdown

RUST-311

@szokeasaurusrex
szokeasaurusrex merged commit b0fa533 into master Nov 3, 2026
32 checks passed
@szokeasaurusrex
szokeasaurusrex deleted the szokeasaurusrex/remove-serde-json-dep branch November 3, 2026 12:06
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.

Make the sentry crate's serde_json feature a no-op

2 participants