From 4d72adca424d4f4225e68dbd8cb430b7988f1c29 Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Sat, 16 Dec 2023 17:48:17 +0200 Subject: [PATCH] WIP: Add a flatpak for rsvg-bench Make it easy to run and profile in a working build environment You need 4 things: * Sysprofd on the host system * GNOME Builder (Flathub or Nightly will do) * Sysprof app (same as Builder) * Additionally, you will want to have org.gnome.Sdk.Debug//master instaleld (We can also switch the runtime version to 45 instead of master to avoid the daily giant updates of the debuginfo) Now open the project with Builder. From the dropdown, select: Run with Profiler Enjoy! --- Cargo.toml | 3 +++ org.gnome.RsvgBench.Devel.json | 49 ++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 org.gnome.RsvgBench.Devel.json diff --git a/Cargo.toml b/Cargo.toml index 67284d050..6bffccd53 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,6 +14,9 @@ keywords = [ "svg", "cairo" ] edition = "2021" rust-version = "1.70.0" +[profile.release] +debug = true + [profile.overflow] inherits = "release" overflow-checks = true diff --git a/org.gnome.RsvgBench.Devel.json b/org.gnome.RsvgBench.Devel.json new file mode 100644 index 000000000..1c5434f61 --- /dev/null +++ b/org.gnome.RsvgBench.Devel.json @@ -0,0 +1,49 @@ +{ + "id": "org.gnome.RsvgBench.Devel", + "runtime": "org.gnome.Platform", + "runtime-version": "46", + "sdk": "org.gnome.Sdk", + "sdk-extensions": [ + "org.freedesktop.Sdk.Extension.rust-nightly", + "org.freedesktop.Sdk.Extension.llvm16" + ], + "command": "rsvg-bench", + "x-run-args" : [ + "/usr/share/icons" + ], + "tags": [ + "nightly" + ], + "finish-args": [ + "--share=network", + "--env=RUST_BACKTRACE=1", + "--env=RUST_LOG=rsvg=debug,glib=debug", + "--env=G_ENABLE_DIAGNOSTIC=1" + ], + "build-options": { + "append-path": "/usr/lib/sdk/rust-nightly/bin:/usr/lib/sdk/llvm16/bin", + "build-args": [ + "--share=network" + ], + "env": { + "CARGO_HOME": "/run/build/rsvg-bench/cargo", + "RUSTFLAGS": "-C force-frame-pointers=yes" + } + }, + "modules": [ + { + "name": "rsvg-bench", + "buildsystem": "simple", + "build-commands": [ + "cargo build --workspace --release", + "install -Dm755 ./target/x86_64-unknown-linux-gnu/release/rsvg-bench -t $FLATPAK_DEST/bin" + ], + "sources" : [ + { + "type" : "dir", + "path" : "." + } + ] + } + ] +} -- GitLab