Skip to content

rerun library has native_viewer feature on by default #1997

@emilk

Description

@emilk

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:

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 rerun or rerun = "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 rerun no longer has the native viewer
  • We may not want to suggest using --all-features because that will enable experimental features, but cargo install rerun --features native_viewer is 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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions