Skip to content

Commit 6c46b98

Browse files
committed
fix: avoid problematic serde release
serde 1.0.172 and up rely on opaque non-reproducible binary blobs to function, explicitly not providing a library-level opt-out. This is problematic for two reasons: - directly, unauditable binary blobs are a security issue. - indirectly, it becomes much harder to predict future behaviors of the crate. As such, I am willing to go on a limb here and forbid building rust-analyzer with those versions of serde. Normally, my philosophy is to defer the choice to the end user, but it's also a design constraint of rust-analyzer that we don't run random binaries downloaded from the internet without explicit user's concent. Concretely, this upper-bounds serde for both rust-analyzer workspace, as well as the lsp-server lib. See serde-rs/serde#2538 for wider context.
1 parent 721e0e3 commit 6c46b98

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

Cargo.lock

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

Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ smallvec = { version = "1.10.0", features = [
9797
smol_str = "0.2.0"
9898
nohash-hasher = "0.2.0"
9999
text-size = "1.1.0"
100-
serde = { version = "1.0.156", features = ["derive"] }
100+
# See https://github.com/serde-rs/serde/issues/2538#issuecomment-1684517372 for why we pin serde
101+
serde = { version = "1.0.156, < 1.0.172", features = ["derive"] }
101102
serde_json = "1.0.96"
102103
triomphe = { version = "0.1.8", default-features = false, features = ["std"] }
103104
# can't upgrade due to dashmap depending on 0.12.3 currently

lib/lsp-server/Cargo.toml

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "lsp-server"
3-
version = "0.7.2"
3+
version = "0.7.3"
44
description = "Generic LSP server scaffold."
55
license = "MIT OR Apache-2.0"
66
repository = "https://github.com/rust-lang/rust-analyzer/tree/master/lib/lsp-server"
@@ -9,7 +9,8 @@ edition = "2021"
99
[dependencies]
1010
log = "0.4.17"
1111
serde_json = "1.0.96"
12-
serde = { version = "1.0.156", features = ["derive"] }
12+
# See https://github.com/serde-rs/serde/issues/2538#issuecomment-1684517372 for why we pin serde
13+
serde = { version = "1.0.156, < 1.0.172", features = ["derive"] }
1314
crossbeam-channel = "0.5.6"
1415

1516
[dev-dependencies]

0 commit comments

Comments
 (0)