-
Notifications
You must be signed in to change notification settings - Fork 409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rerun_py
always enables all of rerun
's default-flags
#2024
Comments
Can confirm that the root manifest does not apply when importing the crates from an external project. E.g. setting up a simple project with the following manifest: [package]
name = "test"
version = "0.1.0"
edition = "2021"
[dependencies]
rerun = { version = "0.5.0", default-features = false } yields
I.e. there is an opportunity here to define default feature sets for internal vs. external use. |
Let's start by banning workspace dependencies from our examples, as they should be copy-pastable. They should still use |
Then they are back to not being copy-pastable though 😕 Maybe we could have the examples depend on the non-released alpha tag ( Then the examples become fully copy-pastable, at least if you're copying them from a commit/branch/tag that has already been released to crates.io. |
Played with it a little more, and basically the problem is that the workspace override rules only apply to direct dependencies. E.g. say you are in an example and import [dependencies]
rerun = { path = "../../../crates/rerun", features = ["web_viewer"] } since you're going through a That's great, but then |
rerun_py
importsrerun
like this:So you'd think you wouldn't get a viewer with that, right? Wrong:
The reason is because
rerun
default features are declared as:and then
rerun
is advertised to the workspace as:which implies
defaults-features = true
, and cannot be overridden since features are implicitly additive!!!!(Note: starting with Rust 1.69, the current setup actually yields a (pretty cryptic) warning:
rerun-io/rerun/rerun_py/Cargo.toml: default-features is ignored for rerun, since default-features was not specified for workspace.dependencies.rerun, this could become a hard error in the future
)Now the issue is that we definitely don't want to change those default features, as they are in fact the correct defaults for anyone importing the main library (including our official Rust examples!).
If the advertised
rerun
feature flags at the workspace level only impact usage from within the workspace, then one possible solution is to setdefault-features = false
at the workspace level, and make the examples import the release crate instead?The text was updated successfully, but these errors were encountered: