Skip to content

Commit

Permalink
Merge branch 'main' into egui-0.26
Browse files Browse the repository at this point in the history
  • Loading branch information
fornwall committed Feb 12, 2024
2 parents 34be7e9 + 5ac4e54 commit f27117c
Show file tree
Hide file tree
Showing 10 changed files with 834 additions and 582 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,21 +74,20 @@ jobs:
name: Vet Dependencies
runs-on: ubuntu-20.04-16core
env:
# there is no published release for v0.7 yet, build from git revision
CARGO_VET_REVISION: 8c8b6d7a5237544c613de616a031586587f49a42
CARGO_VET_VERSION: 0.9.1
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: actions/cache@v3
with:
path: ${{ runner.tool_cache }}/cargo-vet
key: cargo-vet-bin-${{ env.CARGO_VET_REVISION }}
key: cargo-vet-bin-${{ env.CARGO_VET_VERSION }}
- name: Add the tool cache directory to the search path
run: echo "${{ runner.tool_cache }}/cargo-vet/bin" >> $GITHUB_PATH
- name: Ensure that the tool cache is populated with the cargo-vet binary
# build from source, as are not published binaries yet :(
# tracked in https://github.com/mozilla/cargo-vet/issues/484
run: cargo install --root ${{ runner.tool_cache }}/cargo-vet --git https://github.com/mozilla/cargo-vet.git --rev ${{ env.CARGO_VET_REVISION }} cargo-vet
run: cargo install --root ${{ runner.tool_cache }}/cargo-vet --version ${{ env.CARGO_VET_VERSION }} cargo-vet
- name: Invoke cargo-vet
run: |
cargo vet --locked
Expand Down
20 changes: 11 additions & 9 deletions check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@ set -eux
# Checks all tests, lints etc.
# Basically does what the CI does.

cargo check --workspace --all-targets
cargo test --workspace --doc
cargo check --workspace --all-targets --all-features
cargo check -p puffin_viewer --lib --target wasm32-unknown-unknown --all-features
cargo clippy --workspace --all-targets --all-features -- -D warnings -W clippy::all
cargo test --workspace --all-targets --all-features
export RUSTDOCFLAGS="-D warnings" # https://github.com/emilk/egui/pull/1454

cargo check --quiet --workspace --all-targets
cargo test --quiet --workspace --doc
cargo check --quiet --workspace --all-targets --all-features
cargo check --quiet -p puffin_viewer --lib --target wasm32-unknown-unknown --all-features
cargo clippy --quiet --workspace --all-targets --all-features -- -D warnings -W clippy::all
cargo test --quiet --workspace --all-targets --all-features
cargo fmt --all -- --check

cargo doc -p puffin -p puffin_egui -p puffin_http -p puffin_viewer --lib --no-deps --all-features
cargo doc --quiet -p puffin -p puffin_egui -p puffin_http -p puffin_viewer --lib --no-deps --all-features

(cd puffin && cargo check --no-default-features --features "ruzstd")
(cd puffin && cargo check --no-default-features --features "packing")
(cd puffin && cargo check --quiet --no-default-features --features "zstd")
(cd puffin && cargo check --quiet --no-default-features --features "serialization")
5 changes: 3 additions & 2 deletions puffin_egui/src/flamegraph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ impl Default for Options {
frame_list_height: 48.0,
frame_width: 10.0,

merge_scopes: true,
merge_scopes: false, // off, because it really only works well for single-threaded profiling

sorting: Default::default(),
filter: Default::default(),
Expand Down Expand Up @@ -691,8 +691,9 @@ fn paint_record(
suffix
)
} else {
// Note: we don't escape the scope data (`{:?}`), because that often leads to ugly extra backslashes.
format!(
"{}{} {:?} {:6.3} ms {}",
"{}{} '{}' {:6.3} ms {}",
prefix,
scope_name.as_str(),
scope_data.data,
Expand Down
4 changes: 3 additions & 1 deletion puffin_viewer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ include = ["**/*.rs", "Cargo.toml", "README.md", "icon.png"]
crate-type = ["cdylib", "rlib"]

[dependencies]
puffin_egui = { version = "0.26.0", path = "../puffin_egui" }
puffin_egui = { version = "0.26.0", path = "../puffin_egui", features = [
"serde",
] }
puffin = { version = "0.19.0", path = "../puffin", features = [
"packing",
"serialization",
Expand Down
12 changes: 10 additions & 2 deletions puffin_viewer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,13 @@ pub struct PuffinViewer {
}

impl PuffinViewer {
pub fn new(source: Source) -> Self {
pub fn new(source: Source, storage: Option<&dyn eframe::Storage>) -> Self {
let profiler_ui = storage
.and_then(|storage| eframe::get_value(storage, eframe::APP_KEY))
.unwrap_or_default();

Self {
profiler_ui: Default::default(),
profiler_ui,
source,
error: None,
profile_self: false,
Expand Down Expand Up @@ -211,6 +215,10 @@ impl PuffinViewer {
}

impl eframe::App for PuffinViewer {
fn save(&mut self, storage: &mut dyn eframe::Storage) {
eframe::set_value(storage, eframe::APP_KEY, &self.profiler_ui);
}

fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
puffin::GlobalProfiler::lock().new_frame();

Expand Down
2 changes: 1 addition & 1 deletion puffin_viewer/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ fn main() -> Result<(), eframe::Error> {
eframe::run_native(
"puffin viewer",
native_options,
Box::new(|_cc| Box::new(PuffinViewer::new(source))),
Box::new(|cc| Box::new(PuffinViewer::new(source, cc.storage))),
)
}

Expand Down
2 changes: 1 addition & 1 deletion puffin_viewer/src/web.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub async fn start(canvas_id: &str) -> Result<(), eframe::wasm_bindgen::JsValue>
.start(
canvas_id,
web_options,
Box::new(|_cc| Box::new(crate::PuffinViewer::new(crate::Source::None))),
Box::new(|cc| Box::new(crate::PuffinViewer::new(crate::Source::None, cc.storage))),
)
.await?;

Expand Down
4 changes: 2 additions & 2 deletions supply-chain/audits.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ end = "2024-06-08"

[[trusted.bytes]]
criteria = "safe-to-deploy"
user-id = 6741
user-id = 6741 # Alice Ryhl (Darksonn)
start = "2021-01-11"
end = "2024-06-08"

Expand Down Expand Up @@ -131,7 +131,7 @@ end = "2024-06-08"

[[trusted.num_cpus]]
criteria = "safe-to-deploy"
user-id = 359 # Sean McArthur (seanmonstar)
user-id = 359
start = "2019-06-10"
end = "2024-06-08"

Expand Down
Loading

0 comments on commit f27117c

Please sign in to comment.