Skip to content
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 library has native_viewer feature on by default #1997

Closed
emilk opened this issue Apr 28, 2023 · 0 comments · Fixed by #2064 or #2183
Closed

rerun library has native_viewer feature on by default #1997

emilk opened this issue Apr 28, 2023 · 0 comments · Fixed by #2064 or #2183
Labels
😤 annoying Something in the UI / SDK is annoying to use 🧑‍💻 dev experience developer experience (excluding CI) 🚀 performance Optimization, memory use, etc 🦀 Rust API Rust logging API

Comments

@emilk
Copy link
Member

emilk commented Apr 28, 2023

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:

@emilk emilk added 🦀 Rust API Rust logging API 🧑‍💻 dev experience developer experience (excluding CI) 😤 annoying Something in the UI / SDK is annoying to use 🚀 performance Optimization, memory use, etc labels Apr 28, 2023
@emilk emilk self-assigned this May 9, 2023
emilk added a commit that referenced this issue May 9, 2023
This improves compile-times for users that use an external rerun binary.

The `rerun` binary, on the other hand, now has `native_viewer` as a
_required_ feature.

In is an unhappy compromise.

Closes #1997
emilk added a commit that referenced this issue May 9, 2023
This improves compile-times for users that use an external rerun binary.

The `rerun` binary, on the other hand, now has `native_viewer` as a
_required_ feature.

In is an unhappy compromise.

Closes #1997
@emilk emilk reopened this May 9, 2023
jprochazk pushed a commit that referenced this issue May 11, 2023
This improves compile-times for users that use an external rerun binary.

The `rerun` binary, on the other hand, now has `native_viewer` as a
_required_ feature.

In is an unhappy compromise.

Closes #1997
@emilk emilk removed their assignment May 12, 2023
emilk added a commit that referenced this issue May 20, 2023
Closes #1997

Most of our users only use the `rerun` library as a logging library
but are still paying the cost of compiling the native viewer.

With this PR, the `rerun` crate will not have the `native_viewer`
(not `web_viewer`) feature on by default. This halves the compilation
time on my computer.

The `native_viewer` feature is only for users using the `show`
or `spawn` features, which will hopefully be removed soon anyay:
* #2109

To install the `rerun` binary with `native_viewer` and `web_viewer`,
you now have to run `cargo install rerun --features binary`.
This will be improved by:
* #2108

To make things nicer for us developers, I've added `cargo rerun` as a
shorthand for compiling and running `rerun` with the `native_viewer`
feature, but NOT the `web_viewer` feature.
emilk added a commit that referenced this issue May 20, 2023
Closes #1997

Most of our users only use the `rerun` library as a logging library
but are still paying the cost of compiling the native viewer.

With this PR, the `rerun` crate will not have the `native_viewer`
(not `web_viewer`) feature on by default. This halves the compilation
time on my computer.

The `native_viewer` feature is only for users using the `show`
or `spawn` features, which will hopefully be removed soon anyay:
* #2109

To install the `rerun` binary with `native_viewer` and `web_viewer`,
you now have to run `cargo install rerun --features binary`.
This will be improved by:
* #2108

To make things nicer for us developers, I've added `cargo rerun` as a
shorthand for compiling and running `rerun` with the `native_viewer`
feature, but NOT the `web_viewer` feature.
emilk added a commit that referenced this issue May 22, 2023
Closes #1997

Most of our users only use the `rerun` library as a logging library
but are still paying the cost of compiling the native viewer.

With this PR, the `rerun` crate will not have the `native_viewer`
(not `web_viewer`) feature on by default. This halves the compilation
time on my computer.

The `native_viewer` feature is only for users using the `show`
or `spawn` features, which will hopefully be removed soon anyay:
* #2109

To install the `rerun` binary with `native_viewer` and `web_viewer`,
you now have to run `cargo install rerun --features binary`.
This will be improved by:
* #2108

To make things nicer for us developers, I've added `cargo rerun` as a
shorthand for compiling and running `rerun` with the `native_viewer`
feature, but NOT the `web_viewer` feature.
@emilk emilk mentioned this issue May 22, 2023
1 task
emilk added a commit that referenced this issue May 23, 2023
* Remove `native_viewer` from the default features of `rerun` crate

Closes #1997

Most of our users only use the `rerun` library as a logging library
but are still paying the cost of compiling the native viewer.

With this PR, the `rerun` crate will not have the `native_viewer`
(not `web_viewer`) feature on by default. This halves the compilation
time on my computer.

The `native_viewer` feature is only for users using the `show`
or `spawn` features, which will hopefully be removed soon anyay:
* #2109

To install the `rerun` binary with `native_viewer` and `web_viewer`,
you now have to run `cargo install rerun --features binary`.
This will be improved by:
* #2108

To make things nicer for us developers, I've added `cargo rerun` as a
shorthand for compiling and running `rerun` with the `native_viewer`
feature, but NOT the `web_viewer` feature.

* Add rerun-cli

Users will now install the `rerun` binary with `cargo install rerun-cli`

* Add a README.md

* better text about how to run examples

Co-authored-by: Andreas Reich <[email protected]>

* Improve docs

* Update RELEASES.md

* Add checking of the docs to the release process

---------

Co-authored-by: Andreas Reich <[email protected]>
emilk added a commit that referenced this issue May 25, 2023
* Remove `native_viewer` from the default features of `rerun` crate

Closes #1997

Most of our users only use the `rerun` library as a logging library
but are still paying the cost of compiling the native viewer.

With this PR, the `rerun` crate will not have the `native_viewer`
(not `web_viewer`) feature on by default. This halves the compilation
time on my computer.

The `native_viewer` feature is only for users using the `show`
or `spawn` features, which will hopefully be removed soon anyay:
* #2109

To install the `rerun` binary with `native_viewer` and `web_viewer`,
you now have to run `cargo install rerun --features binary`.
This will be improved by:
* #2108

To make things nicer for us developers, I've added `cargo rerun` as a
shorthand for compiling and running `rerun` with the `native_viewer`
feature, but NOT the `web_viewer` feature.

* Add rerun-cli

Users will now install the `rerun` binary with `cargo install rerun-cli`

* Add a README.md

* better text about how to run examples

Co-authored-by: Andreas Reich <[email protected]>

* Improve docs

* Update RELEASES.md

* Add checking of the docs to the release process

---------

Co-authored-by: Andreas Reich <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
😤 annoying Something in the UI / SDK is annoying to use 🧑‍💻 dev experience developer experience (excluding CI) 🚀 performance Optimization, memory use, etc 🦀 Rust API Rust logging API
Projects
None yet
1 participant