Repository navigation
Disable brotli's default ffi-api feature in the Rust SDK - #6444
Open
Tyagiquamar wants to merge 1 commit into
Open
Tyagiquamar wants to merge 1 commit into
Tyagiquamar wants to merge 1 commit into
Conversation
Collaborator
|
Thank you for opening this fix! Our repo requires verified commit signatures - are you able to set that up and re-push the commit on this branch? |
Collaborator
|
also it looks like you(r agent) had some trouble completing testing:
|
`brotli`'s default features include `ffi-api`, which exports the `Brotli*` C API from any `cdylib` that links `spacetimedb-sdk`. A host that also loads a libcrypto built with Brotli support binds those imports to the extension, so the extension stays mapped after unload and hot reloading breaks. Only the Rust API is used: `BrotliDecompress` in the SDK and `BrotliCompress` in `spacetimedb-core`, both of which need just the `std` feature. Keep the dependency at the workspace level so feature unification cannot re-enable `ffi-api` through another member. Adds `sdks/rust/tests/brotli_ffi_api.rs`, which fails if the defaults or the `ffi-api` feature come back.
Tyagiquamar
force-pushed
the
fix/6430-brotli-ffi-symbols
branch
from
November 7, 2026 16:15
18f3d54 to
689adb7
Compare
Contributor
Author
|
Hi @bfops, re-signed the commit with verified GPG signature and pushed to the branch. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
spacetimedb-sdkdepends onbrotli = "3.5"with its default features. Those defaults arestdandffi-api, andffi-apimakesbrotliexport its C API (BrotliDecoder*and friends) from anycdylibthat links the SDK. A host process that also loads a libcrypto built with Brotli support then binds those imports to the extension, keeps it mapped after unload, and breaks hot reloading (the reported symptom is godot-rust'shot reloading should only be set oncepanic).Fixes #6430.
Root cause
Cargo.toml:brotli = "3.5"pulls inffi-apitransitively through default features.brotli::BrotliDecompressinsdks/rust/src/compression.rs), so the C surface is dead weight that leaks into everycdylibconsumer.Changes
Cargo.toml:brotli = { version = "3.5", default-features = false, features = ["std"] }, with a comment explaining why the defaults must stay off.sdks/rust/Cargo.toml: inheritbrotlifrom the workspace (it already did) and addtomlas a dev-dependency for the new policy test.sdks/rust/tests/brotli_ffi_api.rs: new test that parses the workspace and SDK manifests and fails if the SDK stops inheritingbrotli, ifdefault-featuresis re-enabled, or ifffi-apiis listed.Test plan
Feature resolution before and after (
cargo tree -e features -p spacetimedb-sdk --invert brotli):master:brotli feature "ffi-api"is present.ffi-apiin the tree.cargo fmt --check -p spacetimedb-sdkpasses, andrustfmt --edition 2021 --check sdks/rust/tests/brotli_ffi_api.rspasses.Local
cargo testfor the new target could not complete on this machine: there is no MSVC toolchain on Windows, and the Linux container build was killed by the Docker VM memory limit while compiling jemalloc/wasmtime. The dependency graph and formatting checks above ran locally; compilation and execution ofbrotli_ffi_apiare left to CI.