From 1b70686105023a66ce477ba69401413c90a09ffb Mon Sep 17 00:00:00 2001 From: Sophie Herold Date: Fri, 5 Jul 2024 22:29:06 +0200 Subject: [PATCH] Use glycin devel env auto detection We don't need to disable the sandbox for development environments manually anymore. Glycin should take care of that now. --- .gitlab-ci.yml | 4 ++-- Cargo.lock | 4 ++-- Cargo.toml | 1 - build-aux/flatpak/org.gnome.Loupe.Devel.json | 7 +++---- meson_options.txt | 6 ------ src/decoder/formats/glycin_proxy.rs | 3 --- src/decoder/formats/svg.rs | 8 +------- src/editing.rs | 4 +--- src/meson.build | 4 ---- 9 files changed, 9 insertions(+), 32 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cba9ccc..5178491 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,7 +15,7 @@ flatpak: variables: # We are running tests manually RUN_TESTS: "0" - CONFIG_OPTS: "-Dprofile=ci -Ddisable-glycin-sandbox=false" + CONFIG_OPTS: "-Dprofile=ci" flatpak@aarch64: extends: ".flatpak@aarch64" @@ -23,7 +23,7 @@ flatpak@aarch64: interruptible: true variables: RUN_TESTS: "0" - CONFIG_OPTS: "-Dprofile=ci -Ddisable-glycin-sandbox=false" + CONFIG_OPTS: "-Dprofile=ci" cargo-fmt: image: "rust:slim" diff --git a/Cargo.lock b/Cargo.lock index aba9c09..e15f896 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1009,7 +1009,7 @@ dependencies = [ [[package]] name = "glycin" version = "2.0.0-alpha" -source = "git+https://gitlab.gnome.org/sophie-h/glycin#139a6b1ba489b97ab14f0d7e0bd3b2793acbc248" +source = "git+https://gitlab.gnome.org/sophie-h/glycin#983f60f936d5bfb673702101ee8a0131c63c6a23" dependencies = [ "async-fs", "async-io", @@ -1040,7 +1040,7 @@ dependencies = [ [[package]] name = "glycin-utils" version = "2.0.0-alpha" -source = "git+https://gitlab.gnome.org/sophie-h/glycin#139a6b1ba489b97ab14f0d7e0bd3b2793acbc248" +source = "git+https://gitlab.gnome.org/sophie-h/glycin#983f60f936d5bfb673702101ee8a0131c63c6a23" dependencies = [ "env_logger", "gufo-common", diff --git a/Cargo.toml b/Cargo.toml index 4ff93cb..fae3673 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,6 @@ lto = true codegen-units = 1 [features] -disable-glycin-sandbox = [] x11 = ["ashpd/gtk4_x11"] [dependencies] diff --git a/build-aux/flatpak/org.gnome.Loupe.Devel.json b/build-aux/flatpak/org.gnome.Loupe.Devel.json index 1e73eb9..22db555 100644 --- a/build-aux/flatpak/org.gnome.Loupe.Devel.json +++ b/build-aux/flatpak/org.gnome.Loupe.Devel.json @@ -159,7 +159,7 @@ { "type": "git", "url": "https://gitlab.gnome.org/sophie-h/glycin.git", - "commit": "69a52521400be63e6f73a357e9f2ff3b23419c99" + "commit": "983f60f936d5bfb673702101ee8a0131c63c6a23" } ] }, @@ -167,8 +167,7 @@ "name": "loupe", "buildsystem": "meson", "config-opts": [ - "-Dprofile=development", - "-Ddisable-glycin-sandbox=true" + "-Dprofile=development" ], "sources": [ { @@ -178,4 +177,4 @@ ] } ] -} +} \ No newline at end of file diff --git a/meson_options.txt b/meson_options.txt index 6da020b..65fdaf0 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -9,12 +9,6 @@ option( ], value: 'release', ) -option( - 'disable-glycin-sandbox', - type: 'boolean', - description: 'Disable sandboxing of image loaders in glycin. Only intended for development purposes.', - value: false, -) option( 'x11', type: 'feature', diff --git a/src/decoder/formats/glycin_proxy.rs b/src/decoder/formats/glycin_proxy.rs index cf3a19b..7920426 100644 --- a/src/decoder/formats/glycin_proxy.rs +++ b/src/decoder/formats/glycin_proxy.rs @@ -52,9 +52,6 @@ impl Glycin { let mut loader = glycin::Loader::new(file); loader.apply_transformations(false); - #[cfg(feature = "disable-glycin-sandbox")] - loader.sandbox_mechanism(Some(glycin::SandboxMechanism::NotSandboxed)); - loader.cancellable(cancellable_); let image = loader.load().await?; diff --git a/src/decoder/formats/svg.rs b/src/decoder/formats/svg.rs index 36dfe7b..53fde14 100644 --- a/src/decoder/formats/svg.rs +++ b/src/decoder/formats/svg.rs @@ -72,9 +72,6 @@ impl Svg { log::trace!("Setting up SVG loader"); let mut loader = glycin::Loader::new(file); - #[cfg(feature = "disable-glycin-sandbox")] - loader.sandbox_mechanism(Some(glycin::SandboxMechanism::NotSandboxed)); - loader.cancellable(cancellable.clone()); let image = loader.load().await?; @@ -179,10 +176,7 @@ impl Svg { height: i32, ) -> anyhow::Result { #[allow(unused_mut)] - let mut loader = glycin::Loader::new(file.clone()); - - #[cfg(feature = "disable-glycin-sandbox")] - loader.sandbox_mechanism(Some(glycin::SandboxMechanism::NotSandboxed)); + let loader = glycin::Loader::new(file.clone()); let image = loader.load().await?; let frame_request = glycin::FrameRequest::new().scale(width as u32, height as u32); diff --git a/src/editing.rs b/src/editing.rs index 1e0f6a6..032163f 100644 --- a/src/editing.rs +++ b/src/editing.rs @@ -58,9 +58,7 @@ impl Queue { async fn apply(&self, image: LpImage) -> anyhow::Result<()> { let file = image.file().unwrap(); #[allow(unused_mut)] - let mut editor = glycin::Editor::new(file.clone()); - #[cfg(feature = "disable-glycin-sandbox")] - editor.sandbox_mechanism(Some(glycin::SandboxMechanism::NotSandboxed)); + let editor = glycin::Editor::new(file.clone()); let mut list = Vec::new(); self.operations.rcu(|current_operations| { diff --git a/src/meson.build b/src/meson.build index 2e43e22..8266c2a 100644 --- a/src/meson.build +++ b/src/meson.build @@ -31,10 +31,6 @@ if gtk4_x11.found() cargo_options += [ '--features', 'x11' ] endif -if get_option('disable-glycin-sandbox') - cargo_options += [ '--features', 'disable-glycin-sandbox' ] -endif - cargo_env = { 'CARGO_HOME': build_root / 'cargo-home' } cargo_build = custom_target(