Skip to content

Commit

Permalink
Merge branch 'main' into jan/prepare-code-examples
Browse files Browse the repository at this point in the history
  • Loading branch information
jprochazk committed Mar 14, 2024
2 parents b6d8f63 + 1030934 commit ab5a584
Show file tree
Hide file tree
Showing 81 changed files with 1,523 additions and 734 deletions.
53 changes: 32 additions & 21 deletions .github/workflows/on_push_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,40 +114,49 @@ jobs:
# -----------------------------------------------------------------------------------
# Build rerun_c library binaries:

build-rerun_c-and-upload-linux:
build-rerun_c-and-upload-linux-arm64:
needs: [checks]
name: "Linux-Arm64: Build & Upload rerun_c"
uses: ./.github/workflows/reusable_build_and_upload_rerun_c.yml
with:
CONCURRENCY: push-linux-arm64-${{ github.ref_name }}
PLATFORM: linux-arm64
secrets: inherit

build-rerun_c-and-upload-linux-x64:
needs: [checks]
name: "Linux-x64: Build & Upload rerun_c"
uses: ./.github/workflows/reusable_build_and_upload_rerun_c.yml
with:
CONCURRENCY: push-linux-${{ github.ref_name }}
PLATFORM: linux
CONCURRENCY: push-linux-x64-${{ github.ref_name }}
PLATFORM: linux-x64
secrets: inherit

build-rerun_c-and-upload-macos-intel:
build-rerun_c-and-upload-macos-x64:
needs: [checks]
name: "Mac-Intel: Build & Upload rerun_c"
uses: ./.github/workflows/reusable_build_and_upload_rerun_c.yml
with:
CONCURRENCY: push-macos-intel-${{ github.ref_name }}
PLATFORM: macos-intel
CONCURRENCY: push-macos-x64-${{ github.ref_name }}
PLATFORM: macos-x64
secrets: inherit

build-rerun_c-and-upload-macos-arm:
build-rerun_c-and-upload-macos-arm64:
needs: [checks]
name: "Mac-Arm: Build & Upload rerun_c"
name: "Mac-Arm64: Build & Upload rerun_c"
uses: ./.github/workflows/reusable_build_and_upload_rerun_c.yml
with:
CONCURRENCY: push-macos-arm-${{ github.ref_name }}
PLATFORM: macos-arm
CONCURRENCY: push-macos-arm64-${{ github.ref_name }}
PLATFORM: macos-arm64
secrets: inherit

build-rerun_c-and-upload-windows:
build-rerun_c-and-upload-windows-x64:
needs: [checks]
name: "Windows-x64: Build & Upload rerun_c"
uses: ./.github/workflows/reusable_build_and_upload_rerun_c.yml
with:
CONCURRENCY: push-windows-${{ github.ref_name }}
PLATFORM: windows
CONCURRENCY: push-windows-x64-${{ github.ref_name }}
PLATFORM: windows-x64
secrets: inherit

# -----------------------------------------------------------------------------------
Expand Down Expand Up @@ -273,10 +282,11 @@ jobs:
name: "Bundle and upload rerun_cpp_sdk.zip"
needs:
[
build-rerun_c-and-upload-linux,
build-rerun_c-and-upload-macos-intel,
build-rerun_c-and-upload-macos-arm,
build-rerun_c-and-upload-windows,
build-rerun_c-and-upload-linux-x64,
build-rerun_c-and-upload-linux-arm64,
build-rerun_c-and-upload-macos-x64,
build-rerun_c-and-upload-macos-arm64,
build-rerun_c-and-upload-windows-x64,
]
uses: ./.github/workflows/reusable_bundle_and_upload_rerun_cpp.yml
secrets: inherit
Expand All @@ -290,10 +300,11 @@ jobs:
[
upload-web,
generate-pip-index,
build-rerun_c-and-upload-linux,
build-rerun_c-and-upload-macos-intel,
build-rerun_c-and-upload-macos-arm,
build-rerun_c-and-upload-windows,
build-rerun_c-and-upload-linux-x64,
build-rerun_c-and-upload-linux-arm64,
build-rerun_c-and-upload-macos-x64,
build-rerun_c-and-upload-macos-arm64,
build-rerun_c-and-upload-windows-x64,
build-rerun-cli-and-upload-linux,
build-rerun-cli-and-upload-macos-intel,
build-rerun-cli-and-upload-macos-arm,
Expand Down
26 changes: 17 additions & 9 deletions .github/workflows/reusable_build_and_upload_rerun_c.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,18 @@ on:
workflow_dispatch:
inputs:
ADHOC_NAME:
required: true
required: false
type: string
description: "Name of the adhoc build, used for upload directory"
default: ""
PLATFORM:
type: choice
options:
- linux
- windows
- macos-arm
- macos-intel
- linux-arm64
- linux-x64
- windows-x64
- macos-arm64
- macos-x64
description: "Platform to build for"
required: true
CONCURRENCY:
Expand Down Expand Up @@ -70,25 +72,31 @@ jobs:
shell: bash
run: |
case "${{ inputs.PLATFORM }}" in
linux)
linux-arm64)
runner="buildjet-8vcpu-ubuntu-2204-arm"
target="aarch64-unknown-linux-gnu"
container="null"
lib_name="librerun_c.a"
;;
linux-x64)
runner="ubuntu-latest-16-cores"
target="x86_64-unknown-linux-gnu"
container="{'image': 'rerunio/ci_docker:0.11.0'}"
lib_name="librerun_c.a"
;;
windows)
windows-x64)
runner="windows-latest-8-cores"
target="x86_64-pc-windows-msvc"
container="null"
lib_name="rerun_c.lib"
;;
macos-arm)
macos-arm64)
runner="macos-latest" # Small runners, because building rerun_c is fast
target="aarch64-apple-darwin"
container="null"
lib_name="librerun_c.a"
;;
macos-intel)
macos-x64)
runner="macos-latest" # Small runners, because building rerun_c is fast
target="x86_64-apple-darwin"
container="null"
Expand Down
22 changes: 10 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -283,13 +283,13 @@ debug = true
# As a last resport, patch with a commit to our own repository.
# ALWAYS document what PR the commit hash is part of, or when it was merged into the upstream trunk.

ecolor = { git = "https://github.com/emilk/egui.git", rev = "8d9caa4bb0beabfe9fedb9b6ada72ebb7337ed49" } # egui master 2024-03-13
eframe = { git = "https://github.com/emilk/egui.git", rev = "8d9caa4bb0beabfe9fedb9b6ada72ebb7337ed49" } # egui master 2024-03-13
egui = { git = "https://github.com/emilk/egui.git", rev = "8d9caa4bb0beabfe9fedb9b6ada72ebb7337ed49" } # egui master 2024-03-13
egui_extras = { git = "https://github.com/emilk/egui.git", rev = "8d9caa4bb0beabfe9fedb9b6ada72ebb7337ed49" } # egui master 2024-03-13
egui_plot = { git = "https://github.com/emilk/egui.git", rev = "8d9caa4bb0beabfe9fedb9b6ada72ebb7337ed49" } # egui master 2024-03-13
egui-wgpu = { git = "https://github.com/emilk/egui.git", rev = "8d9caa4bb0beabfe9fedb9b6ada72ebb7337ed49" } # egui master 2024-03-13
emath = { git = "https://github.com/emilk/egui.git", rev = "8d9caa4bb0beabfe9fedb9b6ada72ebb7337ed49" } # egui master 2024-03-13
ecolor = { git = "https://github.com/emilk/egui.git", rev = "c5eaba43cd6713eb12ddf92d83a75af471bb6b55" } # egui master 2024-03-14
eframe = { git = "https://github.com/emilk/egui.git", rev = "c5eaba43cd6713eb12ddf92d83a75af471bb6b55" } # egui master 2024-03-14
egui = { git = "https://github.com/emilk/egui.git", rev = "c5eaba43cd6713eb12ddf92d83a75af471bb6b55" } # egui master 2024-03-14
egui_extras = { git = "https://github.com/emilk/egui.git", rev = "c5eaba43cd6713eb12ddf92d83a75af471bb6b55" } # egui master 2024-03-14
egui_plot = { git = "https://github.com/emilk/egui.git", rev = "c5eaba43cd6713eb12ddf92d83a75af471bb6b55" } # egui master 2024-03-14
egui-wgpu = { git = "https://github.com/emilk/egui.git", rev = "c5eaba43cd6713eb12ddf92d83a75af471bb6b55" } # egui master 2024-03-14
emath = { git = "https://github.com/emilk/egui.git", rev = "c5eaba43cd6713eb12ddf92d83a75af471bb6b55" } # egui master 2024-03-14

# Useful while developing:
# ecolor = { path = "../../egui/crates/ecolor" }
Expand Down
32 changes: 32 additions & 0 deletions DESIGN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Design guidelines
Guidelines for UI design, covering GUI, CLI, documentation, log messages, etc

## Text
#### Sentences
Short, single-sentence text do NOT end in a period.

Multi-sentence text ALWAYS ends in a period.

#### Casing
We prefer normal casing, and avoid Title Casing.

We only use Title Casing for company and product names (Rerun, Rerun Viewer, Discord, …), but NOT for concepts like “container”, “space view”, etc.

#### Examples
Good: `log("File saved")`

Bad: `log("file saved.")`

### Buttons

When a button action requires more input after pressing, suffix it with ``.

Good: `Save recording…` (leads to a save-dialog)

## GUI labels

We do not use a colon suffix for labels in front of a value.

Good: `Color 🔴`

Bad: `Color: 🔴`
17 changes: 14 additions & 3 deletions crates/re_build_web_viewer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,15 @@ pub enum Target {
}

/// Build `re_viewer` as Wasm, generate .js bindings for it, and place it all into the `build_dir` folder.
pub fn build(profile: Profile, target: Target, build_dir: &Utf8Path) -> anyhow::Result<()> {
///
/// If `debug_symbols` is set, debug symbols are kept even in release builds,
/// allowing for better callstacks on panics, as well as in-browser profiling of the wasm.
pub fn build(
profile: Profile,
debug_symbols: bool,
target: Target,
build_dir: &Utf8Path,
) -> anyhow::Result<()> {
std::env::set_current_dir(workspace_root())?;

eprintln!("Building web viewer wasm…");
Expand Down Expand Up @@ -167,8 +175,11 @@ pub fn build(profile: Profile, target: Target, build_dir: &Utf8Path) -> anyhow::
// to get wasm-opt: apt/brew/dnf install binaryen
let mut cmd = std::process::Command::new("wasm-opt");

// TODO(emilk): add `-g` to keep debug symbols; useful for profiling release builds in the in-browser profiler.
cmd.args([wasm_path.as_str(), "-O2", "--output", wasm_path.as_str()]);
let mut args = vec![wasm_path.as_str(), "-O2", "--output", wasm_path.as_str()];
if debug_symbols {
args.push("-g");
}
cmd.args(args);
eprintln!("{root_dir}> {cmd:?}");

let output = cmd
Expand Down
11 changes: 10 additions & 1 deletion crates/re_build_web_viewer/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use std::process::ExitCode;

struct Opts {
profile: Option<Profile>,
debug_symbols: bool,
target: Target,
build_dir: Utf8PathBuf,
}
Expand All @@ -12,6 +13,7 @@ impl Default for Opts {
fn default() -> Self {
Self {
profile: None,
debug_symbols: false,
target: Target::Browser,
build_dir: default_build_dir(),
}
Expand Down Expand Up @@ -42,6 +44,9 @@ fn main() -> ExitCode {
);
opts.profile = Some(Profile::Release);
}
"-g" => {
opts.debug_symbols = true;
}
"-o" | "--out" => match args.next() {
Some(value) if !value.starts_with('-') => {
opts.build_dir = Utf8PathBuf::from(value);
Expand All @@ -63,7 +68,9 @@ fn main() -> ExitCode {
return ExitCode::FAILURE;
};

if let Err(err) = re_build_web_viewer::build(release, opts.target, &opts.build_dir) {
if let Err(err) =
re_build_web_viewer::build(release, opts.debug_symbols, opts.target, &opts.build_dir)
{
eprintln!("Failed to build web viewer: {}", re_error::format(err));
ExitCode::FAILURE
} else {
Expand All @@ -79,6 +86,8 @@ fn print_help() {
--debug: Build a debug binary
--release: Compile for release, and run wasm-opt.
NOTE: --release also removes debug symbols which are otherwise useful for in-browser profiling.
-g: Keep debug symbols, even in release builds.
This gives better callstacks on panics, and also allows for in-browser profiling of the Wasm.
-o, --out: Set the output directory. This is a path relative to the cargo workspace root.
"
);
Expand Down
2 changes: 1 addition & 1 deletion crates/re_data_ui/src/component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ impl DataUi for EntityComponentWithInstances {
.header(re_ui::ReUi::table_header_height(), |mut header| {
re_ui::ReUi::setup_table_header(&mut header);
header.col(|ui| {
ui.label("Instance Key");
ui.label("Instance key");
});
header.col(|ui| {
ui.label(self.component_name().short_name());
Expand Down

0 comments on commit ab5a584

Please sign in to comment.