From 55015a76313c9ec30dfd5a853b5a8d40f5ad38fe Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Wed, 11 Nov 2026 18:38:56 -0500 Subject: [PATCH] Fix Flatpak updates and bump to 0.6.1 (#426) * fix(flatpak): allow release checks and self-update helpers * test: keep Flatpak permission parsing within strict Clippy rules * chore: bump version to 0.6.1 for the Flatpak update fix * fix(flatpak): honor the launcher version choices --- Cargo.lock | 30 +++++++++---------- Cargo.toml | 2 +- crates/ui-egui/tests/flatpak_updates.rs | 27 +++++++++++++++++ .../ai.storyteller.TextureCraft.bundle.yml | 9 ++++-- .../flatpak/ai.storyteller.TextureCraft.yml | 9 ++++-- 5 files changed, 55 insertions(+), 22 deletions(-) create mode 100644 crates/ui-egui/tests/flatpak_updates.rs diff --git a/Cargo.lock b/Cargo.lock index 89ec9f96..4831abd2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4260,7 +4260,7 @@ dependencies = [ [[package]] name = "texturecraft" -version = "0.6.0" +version = "0.6.1" dependencies = [ "craft-menu", "craft-update", @@ -4281,7 +4281,7 @@ dependencies = [ [[package]] name = "texturecraft-automation" -version = "0.6.0" +version = "0.6.1" dependencies = [ "base64 0.22.1", "cap-std", @@ -4302,7 +4302,7 @@ dependencies = [ [[package]] name = "texturecraft-bake" -version = "0.6.0" +version = "0.6.1" dependencies = [ "bytemuck", "rayon", @@ -4314,7 +4314,7 @@ dependencies = [ [[package]] name = "texturecraft-cli" -version = "0.6.0" +version = "0.6.1" dependencies = [ "image", "serde_json", @@ -4326,7 +4326,7 @@ dependencies = [ [[package]] name = "texturecraft-compose" -version = "0.6.0" +version = "0.6.1" dependencies = [ "half", "rayon", @@ -4337,7 +4337,7 @@ dependencies = [ [[package]] name = "texturecraft-core" -version = "0.6.0" +version = "0.6.1" dependencies = [ "serde", "serde_json", @@ -4346,7 +4346,7 @@ dependencies = [ [[package]] name = "texturecraft-engine" -version = "0.6.0" +version = "0.6.1" dependencies = [ "epaint_default_fonts", "image", @@ -4366,7 +4366,7 @@ dependencies = [ [[package]] name = "texturecraft-formats" -version = "0.6.0" +version = "0.6.1" dependencies = [ "base64 0.22.1", "exr", @@ -4391,7 +4391,7 @@ dependencies = [ [[package]] name = "texturecraft-geom" -version = "0.6.0" +version = "0.6.1" dependencies = [ "glam 0.30.10", "mikktspace", @@ -4402,7 +4402,7 @@ dependencies = [ [[package]] name = "texturecraft-paint" -version = "0.6.0" +version = "0.6.1" dependencies = [ "epaint_default_fonts", "harfrust", @@ -4417,7 +4417,7 @@ dependencies = [ [[package]] name = "texturecraft-render" -version = "0.6.0" +version = "0.6.1" dependencies = [ "bytemuck", "half", @@ -4436,11 +4436,11 @@ dependencies = [ [[package]] name = "texturecraft-texel" -version = "0.6.0" +version = "0.6.1" [[package]] name = "texturecraft-ui-egui" -version = "0.6.0" +version = "0.6.1" dependencies = [ "base64 0.22.1", "craft-dialogs", @@ -4474,7 +4474,7 @@ dependencies = [ [[package]] name = "texturecraft-web" -version = "0.6.0" +version = "0.6.1" dependencies = [ "eframe", "js-sys", @@ -5866,7 +5866,7 @@ checksum = "e450f9b2ed1dff33c94c12589a87338689467b9c4f5d8a5710bd09a847d2c8a7" [[package]] name = "xtask" -version = "0.6.0" +version = "0.6.1" dependencies = [ "serde_json", ] diff --git a/Cargo.toml b/Cargo.toml index a466d14b..76f84caa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ exclude = ["vendor"] default-members = ["crates/core", "crates/texel", "crates/geom", "crates/compose", "crates/bake", "crates/formats", "crates/paint", "crates/engine", "crates/render", "crates/automation", "crates/ui-egui", "apps/texturecraft", "apps/texturecraft-cli", "xtask"] [workspace.package] -version = "0.6.0" +version = "0.6.1" edition = "2024" license = "MIT OR Apache-2.0" rust-version = "1.95" diff --git a/crates/ui-egui/tests/flatpak_updates.rs b/crates/ui-egui/tests/flatpak_updates.rs new file mode 100644 index 00000000..d7c447db --- /dev/null +++ b/crates/ui-egui/tests/flatpak_updates.rs @@ -0,0 +1,27 @@ +//! Release and source Flatpaks must allow release checks and host update helpers. +fn finish_args(manifest: &str) -> Vec<&str> { + manifest + .split("finish-args:") + .nth(1) + .unwrap_or_default() + .lines() + .take_while(|line| line.is_empty() || line.starts_with(' ') || line.starts_with('#')) + .filter_map(|line| line.trim().strip_prefix("- ")) + .map(|arg| arg.trim_matches(['\'', '"'])) + .collect() +} + +#[test] +fn flatpak_update_permissions() { + let manifests = [ + include_str!("../../../packaging/linux/flatpak/ai.storyteller.TextureCraft.bundle.yml"), + include_str!("../../../packaging/linux/flatpak/ai.storyteller.TextureCraft.yml"), + ]; + let args = manifests.map(finish_args); + assert_eq!(args[0], args[1], "source and release permissions must agree"); + for permissions in args { + for required in ["--share=network", "--talk-name=org.freedesktop.Flatpak", "--filesystem=xdg-data/ArtCraft/versions:ro"] { + assert!(permissions.contains(&required), "missing update permission: {required}"); + } + } +} diff --git a/packaging/linux/flatpak/ai.storyteller.TextureCraft.bundle.yml b/packaging/linux/flatpak/ai.storyteller.TextureCraft.bundle.yml index 259e2396..56d29581 100644 --- a/packaging/linux/flatpak/ai.storyteller.TextureCraft.bundle.yml +++ b/packaging/linux/flatpak/ai.storyteller.TextureCraft.bundle.yml @@ -17,6 +17,12 @@ runtime-version: '26.08' sdk: org.freedesktop.Sdk command: texturecraft finish-args: + # Honor the launcher's pinned and nightly version choices before offering updates. + - --filesystem=xdg-data/ArtCraft/versions:ro + # Release checks and downloads use HTTPS. + - --share=network + # The shared updater inspects and updates this installation via flatpak-spawn --host. + - --talk-name=org.freedesktop.Flatpak # Display: Wayland first; X11 only when no Wayland compositor is running. - --socket=wayland - --socket=fallback-x11 @@ -30,9 +36,6 @@ finish-args: # line, Open Recent, "Save" next to the original) work in the usual places. - --filesystem=xdg-pictures - --filesystem=xdg-documents - # Deliberately not granted: network (the optional --control server listens on 127.0.0.1 in - # the sandbox; `flatpak override --user --share=network ai.storyteller.texturecraft` exposes it to - # host agents) and home/host filesystem access. modules: - name: texturecraft buildsystem: simple diff --git a/packaging/linux/flatpak/ai.storyteller.TextureCraft.yml b/packaging/linux/flatpak/ai.storyteller.TextureCraft.yml index 3b680178..8529d8bc 100644 --- a/packaging/linux/flatpak/ai.storyteller.TextureCraft.yml +++ b/packaging/linux/flatpak/ai.storyteller.TextureCraft.yml @@ -18,6 +18,12 @@ sdk-extensions: - org.freedesktop.Sdk.Extension.rust-stable command: texturecraft finish-args: + # Honor the launcher's pinned and nightly version choices before offering updates. + - --filesystem=xdg-data/ArtCraft/versions:ro + # Release checks and downloads use HTTPS. + - --share=network + # The shared updater inspects and updates this installation via flatpak-spawn --host. + - --talk-name=org.freedesktop.Flatpak # Display: Wayland first; X11 only when no Wayland compositor is running. - --socket=wayland - --socket=fallback-x11 @@ -31,9 +37,6 @@ finish-args: # line, Open Recent, "Save" next to the original) work in the usual places. - --filesystem=xdg-pictures - --filesystem=xdg-documents - # Deliberately not granted: network (the optional --control server listens on 127.0.0.1 in - # the sandbox; `flatpak override --user --share=network ai.storyteller.texturecraft` exposes it to - # host agents) and home/host filesystem access. build-options: append-path: /usr/lib/sdk/rust-stable/bin modules: