-
Notifications
You must be signed in to change notification settings - Fork 567
Labels
sdk-rustRust logging APIRust logging API📉 performanceOptimization, memory use, etcOptimization, memory use, etc😤 annoyingSomething in the UI / SDK is annoying to useSomething in the UI / SDK is annoying to use🧑💻 dev experiencedeveloper experience (excluding CI)developer experience (excluding CI)
Description
A lot of users of the rerun rust library will never want to call the spawn method, yet the native_viewer is a default feature, pulling in a huge dependency tree leading to very long compile times.
We have it as a default dependency, because that's what we want for the rerun binary, i.e. when using cargo install rerun.
Solutions
Different default features for library and binary
Ideally we would have different default features for the library and the binary, but that is not yet possible:
- Add
defaultfeatures for each [[bin]] rust-lang/cargo#10409 - Cargo target features rust-lang/rfcs#3374
Tell people to use opt-out of native_viewer
We can add a library feature set with everything except the native_viewer and ask people to do:
rerun = { version = "0.6", default-features=false, features=["library"] }
Downsides:
- Longer and more complicated usage instructions
- People don't read the instruction and will still just do
cargo add rerunorrerun = "0.6"
Push people towards using re_sdk as a library
We can push users towards using re_sdk instead of using the rerun crate as a library.
Downsides:
- Much less appealing crate name
- You cannot opt-in to
native_viewer
Remove native_viewer from defaults
And change our install instructions to suggest cargo install rerun --all-features
Downsides:
cargo r -p rerunno longer has the native viewer- We may not want to suggest using
--all-featuresbecause that will enable experimental features, butcargo install rerun --features native_vieweris quite the mouthful
Remove native_viewer from defaults, add to [[bin]] required-features
That is:
[package]
name = "rerun"
[[bin]]
required-features = ["native_viewer"]
[features]
default-features = ["analytics"]Downsides:
- We cannot build a
rerunbinary without thenative_viewerfeature. cargo install rerunwon't work. Users will need to runcargo install rerun --features native_viewer(Revert "native_vieweris now an opt-in feature of thererunlibrary" #2067)
Metadata
Metadata
Assignees
Labels
sdk-rustRust logging APIRust logging API📉 performanceOptimization, memory use, etcOptimization, memory use, etc😤 annoyingSomething in the UI / SDK is annoying to useSomething in the UI / SDK is annoying to use🧑💻 dev experiencedeveloper experience (excluding CI)developer experience (excluding CI)