Repository navigation
build: Declare every third-party dependency in [workspace.dependencies] - #2061
Merged
Merged
Conversation
[workspace.dependencies] holds only libloading. The other 16 crates.io dependencies are declared in each crate, with different version requirements (cc "1" and "=1.6.0", pkg-config "0.3" and "=0.3.34") and with the feature choices spread over 13 manifests. ci/test_workspace_dependencies.py requires: - every third-party dependency of a workspace member, in every dependency table and target table, uses `workspace = true`; - every [workspace.dependencies] entry is a table, pins the one version in Cargo.lock with `=`, sets `default-features = false` and has no `features` (crates enable what they need); - every entry is used by a member. On master, 2 of the 3 tests fail: 38 dependency declarations do not inherit, and libloading is a plain string with default features on. Refs obs-rust#2056 Co-Authored-By: Claude Opus 5.5 <[email protected]>
[workspace.dependencies] now holds all 16 crates.io dependencies (it held only libloading). Each entry pins the one version in Cargo.lock with `=` and sets `default-features = false`. The 13 member manifests inherit them with `workspace = true` and keep their previous feature choices: - `default-features = true` where the crate used the dependency's defaults before (also for cc, dunce, libloading and pkg-config, which define no default features today, so a later version cannot change what these crates get); - `features = [...]` unchanged (cc parallel, criterion cargo_bench_support, flate2 rust_backend, serde derive, tungstenite handshake). The pins are the Cargo.lock versions, so Cargo.lock does not change. The requirements that were caret before (cc "1", libc "0.2", proptest "1", pkg-config "0.3", ...) are now exact; obs-build, obs-data and the root table already used exact pins. A version bump is now one line in the root Cargo.toml plus Cargo.lock. `cargo tree --locked --target all -e features,normal,build,dev` is byte-identical before and after for the workspace, for every member (`-p`), and for `-p libobs-rust --no-default-features`, `-p obs-util` and `-p obs-studio-rust --features libobs-integration,bundled-native` (30 outputs). cargo metadata prints no warnings. ci/test_workspace_dependencies.py: 3/3. Refs obs-rust#2056 Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 27, 2026
6 of 7 tasks
MCPVOT
pushed a commit
to MCPVOT/obs-studio
that referenced
this pull request
Oct 30, 2026
…rust#2603) (obs-rust#2604) Since obs-rust#2061 the root [workspace.dependencies] declares serde_json with default-features = false, and obs-build, obs-preflight and obs-studio-rust turn the defaults on again with default-features = true. Cargo honours that, but the cargo-chef recipe of soldr cook does not: serde_json builds with neither std nor alloc and fails. setup-soldr then continues without cooked dependencies and never saves the cook cache, so every Rust CI lane compiles all external crates on every run. The three members now name the feature: features = ["std"]. std is serde_json's default feature, so the normal build and Cargo.lock do not change. Verified on Linux (soldr 0.9.31): before, soldr cook --release and --profile dev exit 101 on serde_json; after, both exit 0. cargo check --workspace --locked passes; ci.test_workspace_dependencies passes. Fixes obs-rust#2603 Co-authored-by: Claude Opus 5.5 <[email protected]>
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.
Refs #2056 (proposal 2; proposal 1 is #2059. Proposal 3,
cargo denyor aci_lintrule, is not in this PR:ci/test_workspace_dependencies.pycovers the rule inside the repository.)What and why
[workspace.dependencies]held onlylibloading. The other 15 crates.io dependencies were declared in each crate, with different version requirements (cc"1"and"=1.6.0",pkg-config"0.3"and"=0.3.34",serde_json"1.0.151"and"=1.0.151"), and their features were set in 13 manifests.Cargo.toml: all 16 third-party dependencies are in[workspace.dependencies]. Each entry pins the one version inCargo.lockwith=and setsdefault-features = false. Exact pins were already used for the root table,obs-build,foldhashandcriterion.dep = { workspace = true, ... }, with the same choices as before:default-features = truewhere the crate used the defaults before. This includescc,dunce,libloadingandpkg-config, which have no default features today, so a later version cannot change what these crates get.features = [...]unchanged (ccparallel,criterioncargo_bench_support,flate2rust_backend,serdederive,tungstenitehandshake).ci/test_workspace_dependencies.pykeeps it that way:workspace = true;Cargo.lockversion with=, setsdefault-features = falseand has nofeatures;A version bump is now one line in the root
Cargo.tomlplusCargo.lock.No change in what is built.
Cargo.lockis unchanged.cargo tree --locked --target all -e features,normal,build,devgives byte-identical output before and after (30 outputs):--workspace;-p;-p libobs-rust --no-default-features,-p obs-util,-p obs-studio-rust --features libobs-integration,bundled-native.cargo metadata --lockedprints no warnings.RED → GREEN
ci/test_workspace_dependencies.py. On master, 2 of 3 tests fail: 38 declarations do not inherit, andlibloadingis a string with default features on.ci/test_workspace_dependencies.py3/3. Linux (Debian 13, soldr 0.9.38, Rust 1.98.1):OBS_GATE_SKIP_SELF_TEST=1 uv run ci/local_gate.py --lane lint(as the Fast Gate runs it): ok, 43 s.SOLDR_RUSTC_WRAPPER=none soldr cargo test --workspace --locked --no-run: ok.ci/self-tests: 1177 run. 3 errors intest_hybrid_packaging.py, because this host has nozstd; master gives the same 3 errors on this host.Checklist
master🤖 Generated with Claude Code