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.
This commit is contained in:
Sophie Herold 2024-07-05 22:29:06 +02:00
parent ae74411983
commit 1b70686105
9 changed files with 9 additions and 32 deletions

View file

@ -15,7 +15,7 @@ flatpak:
variables: variables:
# We are running tests manually # We are running tests manually
RUN_TESTS: "0" RUN_TESTS: "0"
CONFIG_OPTS: "-Dprofile=ci -Ddisable-glycin-sandbox=false" CONFIG_OPTS: "-Dprofile=ci"
flatpak@aarch64: flatpak@aarch64:
extends: ".flatpak@aarch64" extends: ".flatpak@aarch64"
@ -23,7 +23,7 @@ flatpak@aarch64:
interruptible: true interruptible: true
variables: variables:
RUN_TESTS: "0" RUN_TESTS: "0"
CONFIG_OPTS: "-Dprofile=ci -Ddisable-glycin-sandbox=false" CONFIG_OPTS: "-Dprofile=ci"
cargo-fmt: cargo-fmt:
image: "rust:slim" image: "rust:slim"

4
Cargo.lock generated
View file

@ -1009,7 +1009,7 @@ dependencies = [
[[package]] [[package]]
name = "glycin" name = "glycin"
version = "2.0.0-alpha" 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 = [ dependencies = [
"async-fs", "async-fs",
"async-io", "async-io",
@ -1040,7 +1040,7 @@ dependencies = [
[[package]] [[package]]
name = "glycin-utils" name = "glycin-utils"
version = "2.0.0-alpha" 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 = [ dependencies = [
"env_logger", "env_logger",
"gufo-common", "gufo-common",

View file

@ -10,7 +10,6 @@ lto = true
codegen-units = 1 codegen-units = 1
[features] [features]
disable-glycin-sandbox = []
x11 = ["ashpd/gtk4_x11"] x11 = ["ashpd/gtk4_x11"]
[dependencies] [dependencies]

View file

@ -159,7 +159,7 @@
{ {
"type": "git", "type": "git",
"url": "https://gitlab.gnome.org/sophie-h/glycin.git", "url": "https://gitlab.gnome.org/sophie-h/glycin.git",
"commit": "69a52521400be63e6f73a357e9f2ff3b23419c99" "commit": "983f60f936d5bfb673702101ee8a0131c63c6a23"
} }
] ]
}, },
@ -167,8 +167,7 @@
"name": "loupe", "name": "loupe",
"buildsystem": "meson", "buildsystem": "meson",
"config-opts": [ "config-opts": [
"-Dprofile=development", "-Dprofile=development"
"-Ddisable-glycin-sandbox=true"
], ],
"sources": [ "sources": [
{ {
@ -178,4 +177,4 @@
] ]
} }
] ]
} }

View file

@ -9,12 +9,6 @@ option(
], ],
value: 'release', value: 'release',
) )
option(
'disable-glycin-sandbox',
type: 'boolean',
description: 'Disable sandboxing of image loaders in glycin. Only intended for development purposes.',
value: false,
)
option( option(
'x11', 'x11',
type: 'feature', type: 'feature',

View file

@ -52,9 +52,6 @@ impl Glycin {
let mut loader = glycin::Loader::new(file); let mut loader = glycin::Loader::new(file);
loader.apply_transformations(false); loader.apply_transformations(false);
#[cfg(feature = "disable-glycin-sandbox")]
loader.sandbox_mechanism(Some(glycin::SandboxMechanism::NotSandboxed));
loader.cancellable(cancellable_); loader.cancellable(cancellable_);
let image = loader.load().await?; let image = loader.load().await?;

View file

@ -72,9 +72,6 @@ impl Svg {
log::trace!("Setting up SVG loader"); log::trace!("Setting up SVG loader");
let mut loader = glycin::Loader::new(file); let mut loader = glycin::Loader::new(file);
#[cfg(feature = "disable-glycin-sandbox")]
loader.sandbox_mechanism(Some(glycin::SandboxMechanism::NotSandboxed));
loader.cancellable(cancellable.clone()); loader.cancellable(cancellable.clone());
let image = loader.load().await?; let image = loader.load().await?;
@ -179,10 +176,7 @@ impl Svg {
height: i32, height: i32,
) -> anyhow::Result<gdk::Texture> { ) -> anyhow::Result<gdk::Texture> {
#[allow(unused_mut)] #[allow(unused_mut)]
let mut loader = glycin::Loader::new(file.clone()); let loader = glycin::Loader::new(file.clone());
#[cfg(feature = "disable-glycin-sandbox")]
loader.sandbox_mechanism(Some(glycin::SandboxMechanism::NotSandboxed));
let image = loader.load().await?; let image = loader.load().await?;
let frame_request = glycin::FrameRequest::new().scale(width as u32, height as u32); let frame_request = glycin::FrameRequest::new().scale(width as u32, height as u32);

View file

@ -58,9 +58,7 @@ impl Queue {
async fn apply(&self, image: LpImage) -> anyhow::Result<()> { async fn apply(&self, image: LpImage) -> anyhow::Result<()> {
let file = image.file().unwrap(); let file = image.file().unwrap();
#[allow(unused_mut)] #[allow(unused_mut)]
let mut editor = glycin::Editor::new(file.clone()); let editor = glycin::Editor::new(file.clone());
#[cfg(feature = "disable-glycin-sandbox")]
editor.sandbox_mechanism(Some(glycin::SandboxMechanism::NotSandboxed));
let mut list = Vec::new(); let mut list = Vec::new();
self.operations.rcu(|current_operations| { self.operations.rcu(|current_operations| {

View file

@ -31,10 +31,6 @@ if gtk4_x11.found()
cargo_options += [ '--features', 'x11' ] cargo_options += [ '--features', 'x11' ]
endif endif
if get_option('disable-glycin-sandbox')
cargo_options += [ '--features', 'disable-glycin-sandbox' ]
endif
cargo_env = { 'CARGO_HOME': build_root / 'cargo-home' } cargo_env = { 'CARGO_HOME': build_root / 'cargo-home' }
cargo_build = custom_target( cargo_build = custom_target(