Skip to content

Commit 7c88680

Browse files
committed
Add rerun-cli
Users will now install the `rerun` binary with `cargo install rerun-cli`
1 parent e49e78e commit 7c88680

File tree

11 files changed

+87
-16
lines changed

11 files changed

+87
-16
lines changed

.cargo/config.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[alias]
2-
# `cargo rerun` is short a convenient shorthand
3-
rerun = "run --package rerun --features native_viewer --features server --"
2+
# `cargo rerun` is short a convenient shorthand, skipping the web viewer.
3+
rerun = "run --package rerun-cli --no-default-features --features native_viewer --"
44

55
# To easily run examples on the web, see https://github.com/rukai/cargo-run-wasm.
66
# Temporary solution while we wait for our own xtasks!

Cargo.lock

Lines changed: 14 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ rr.log_rect("car", bbox)
3939
### Rerun Viewer binary
4040
Both the Python and Rust library can start the Rerun Viewer, but to stream log data over the network or load our `.rrd` data files you also need the `rerun` binary.
4141

42-
It can be installed with `pip install rerun-sdk` or with `cargo install rerun --features binary`.
42+
It can be installed with `pip install rerun-sdk` or with `cargo install rerun-cli`.
4343

4444
You should now be able to run `rerun --help` in any terminal.
4545

crates/rerun-cli/Cargo.toml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
[package]
2+
name = "rerun-cli"
3+
authors.workspace = true
4+
categories = ["visualization", "computer-vision"]
5+
default-run = "rerun"
6+
description = "Log images, point clouds, etc, and visualize them effortlessly"
7+
edition.workspace = true
8+
homepage.workspace = true
9+
include.workspace = true
10+
keywords = ["mesh", "plotting", "point-cloud", "robotics", "visualization"]
11+
license.workspace = true
12+
publish = true
13+
readme = "README.md"
14+
repository.workspace = true
15+
rust-version.workspace = true
16+
version.workspace = true
17+
18+
[package.metadata.docs.rs]
19+
all-features = true
20+
targets = ["x86_64-unknown-linux-gnu", "wasm32-unknown-unknown"]
21+
22+
23+
[features]
24+
# The default is what the user gets when they call `cargo install rerun-cli`,
25+
# so wer have all the bells and wistles here
26+
default = ["native_viewer", "web_viewer"]
27+
28+
## Support spawning a native viewer.
29+
## This adds a lot of extra dependencies, so only enable this feature if you need it!
30+
native_viewer = ["rerun/native_viewer"]
31+
32+
## Support serving a web viewer over HTTP.
33+
##
34+
## Enabling this inflates the binary size quite a bit, since it embeds the viewer wasm.
35+
# When building from source (in the repository), this feature adds quite a bit
36+
# to the compile time since it requires compiling and bundling the viewer as wasm.
37+
#
38+
# You also need to install some additional tools, which you can do by running
39+
# [`scripts/setup_web.sh`](https://github.com/rerun-io/rerun/blob/main/scripts/setup_web.sh).
40+
web_viewer = ["rerun/web_viewer"]
41+
42+
[dependencies]
43+
re_build_info.workspace = true
44+
re_log.workspace = true
45+
re_memory.workspace = true
46+
rerun = { workspace = true, features = [
47+
"analytics",
48+
"demo",
49+
"glam",
50+
"image",
51+
"sdk",
52+
"server",
53+
] }
54+
55+
anyhow.workspace = true
56+
mimalloc.workspace = true
57+
tokio = { workspace = true, features = ["macros", "rt-multi-thread"] }
58+
59+
60+
[build-dependencies]
61+
re_build_build_info.workspace = true

crates/rerun-cli/build.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
fn main() {
2+
re_build_build_info::rebuild_if_crate_changed("rerun-cli");
3+
re_build_build_info::export_env_vars();
4+
}
File renamed without changes.

crates/rerun/Cargo.toml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
name = "rerun"
33
authors.workspace = true
44
categories = ["visualization", "computer-vision"]
5-
default-run = "rerun"
65
description = "Log images, point clouds, etc, and visualize them effortlessly"
76
edition.workspace = true
87
homepage.workspace = true
@@ -21,13 +20,7 @@ targets = ["x86_64-unknown-linux-gnu", "wasm32-unknown-unknown"]
2120

2221

2322
[features]
24-
default = ["library"]
25-
26-
## Default features when using `rerun` as a binary. Everything included.
27-
binary = ["library", "native_viewer", "server", "web_viewer"]
28-
29-
## Default features when using `rerun` as a logging library. Optimized for compilation speed.
30-
library = ["analytics", "demo", "glam", "image", "sdk", "server"]
23+
default = ["analytics", "demo", "glam", "image", "sdk", "server"]
3124

3225
## Enable telemetry using our analytics SDK.
3326
analytics = [
@@ -100,7 +93,6 @@ webbrowser = { version = "0.8", optional = true }
10093
backtrace = "0.3"
10194
clap = { workspace = true, features = ["derive"] }
10295
ctrlc.workspace = true
103-
mimalloc.workspace = true
10496
puffin.workspace = true
10597
rayon.workspace = true
10698
tokio = { workspace = true, features = ["macros", "rt-multi-thread"] }

crates/rerun/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ You can add the `rerun` crate to your project with `cargo add rerun`.
4646
To get started, see [the examples](https://github.com/rerun-io/rerun/tree/latest/examples/rust).
4747
4848
## Binary
49-
You can install the binary with `cargo install rerun --features binary`
49+
You can install the binary with `cargo install rerun-cli`
5050
5151
This can act either as a server, a viewer, or both, depending on which options you use when you start it.
5252

crates/rerun/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//! There is also a `rerun` binary.
66
//! The binary is required in order to stream log data
77
//! over the networks, and to open our `.rrd` data files.
8-
//! If you need it, install the `rerun` binary with `cargo install rerun --features binary`.
8+
//! If you need it, install the `rerun` binary with `cargo install rerun-cli`.
99
//!
1010
//! ## Feature flags
1111
#![doc = document_features::document_features!()]

crates/rerun/src/web_viewer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ impl crate::sink::LogSink for WebViewerSink {
9494
/// If the `open_browser` argument is `true`, your default browser
9595
/// will be opened with a connected web-viewer.
9696
///
97-
/// If not, you can connect to this server using the `rerun` binary (`cargo install rerun --features binary`).
97+
/// If not, you can connect to this server using the `rerun` binary (`cargo install rerun-cli`).
9898
///
9999
/// NOTE: you can not connect one `Session` to another.
100100
///

0 commit comments

Comments
 (0)