From f45c98496e0e473b404fe898ba7ef184c8a46b33 Mon Sep 17 00:00:00 2001 From: Martin Robinson Date: Mon, 19 Aug 2024 05:16:28 -0700 Subject: [PATCH] Upgrade font-kit, raqote, and stop using `dirs-next` (#33120) `dirs-next` is still used by the version of the `term` crate we are using, but this also remoes a version of `cstr` so our dependency count does not change. A new version of `raqote` hasn't been released, so this depends on the upstream repository directly. It's been almost 4 months since the release has been ready -- so it's unclear when it will happen. Fixes #32801. Signed-off-by: Martin Robinson --- Cargo.lock | 55 +++++++++++++++++++++++------------- components/canvas/Cargo.toml | 4 +-- components/config/Cargo.toml | 2 +- components/config/basedir.rs | 6 ++-- components/fonts/Cargo.toml | 2 +- 5 files changed, 42 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6653298b8aa..d249f87f964 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1177,16 +1177,6 @@ dependencies = [ "syn", ] -[[package]] -name = "cstr" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68523903c8ae5aacfa32a0d9ae60cadeb764e1da14ee0d26b1f3089f13a54636" -dependencies = [ - "proc-macro2", - "quote", -] - [[package]] name = "ctor" version = "0.2.8" @@ -1406,6 +1396,15 @@ dependencies = [ "syn", ] +[[package]] +name = "dirs" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" +dependencies = [ + "dirs-sys", +] + [[package]] name = "dirs-next" version = "2.0.0" @@ -1416,6 +1415,18 @@ dependencies = [ "dirs-sys-next", ] +[[package]] +name = "dirs-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.48.0", +] + [[package]] name = "dirs-sys-next" version = "0.1.2" @@ -1825,16 +1836,16 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "font-kit" -version = "0.13.2" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2845a73bbd781e691ab7c2a028c579727cd254942e8ced57ff73e0eafd60de87" +checksum = "b64b34f4efd515f905952d91bc185039863705592c0c53ae6d979805dd154520" dependencies = [ "bitflags 2.6.0", "byteorder", "core-foundation", "core-graphics", "core-text", - "dirs-next", + "dirs", "dwrote", "float-ord", "freetype-sys", @@ -4787,6 +4798,12 @@ dependencies = [ "libc", ] +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + [[package]] name = "option-operations" version = "0.5.0" @@ -5254,9 +5271,8 @@ checksum = "9c8a99fddc9f0ba0a85884b8d14e3592853e787d581ca1816c91349b10e4eeab" [[package]] name = "raqote" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c3061d5dcf59093c811d645c517be6eb7c26a0110d146730418950139496f84" +version = "0.8.5" +source = "git+https://github.com/jrmuizel/raqote?rev=64716c8#64716c8d68436451ca151bb0c70ba300fd964f42" dependencies = [ "euclid", "font-kit", @@ -6087,7 +6103,7 @@ dependencies = [ name = "servo_config" version = "0.0.1" dependencies = [ - "dirs-next", + "dirs", "embedder_traits", "euclid", "getopts", @@ -8440,11 +8456,10 @@ dependencies = [ [[package]] name = "yeslogic-fontconfig-sys" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb6b23999a8b1a997bf47c7bb4d19ad4029c3327bb3386ebe0a5ff584b33c7a" +checksum = "503a066b4c037c440169d995b869046827dbc71263f6e8f3be6d77d4f3229dbd" dependencies = [ - "cstr", "dlib", "once_cell", "pkg-config", diff --git a/components/canvas/Cargo.toml b/components/canvas/Cargo.toml index ea2f496f63f..f2ff5197406 100644 --- a/components/canvas/Cargo.toml +++ b/components/canvas/Cargo.toml @@ -21,7 +21,7 @@ canvas_traits = { workspace = true } crossbeam-channel = { workspace = true } cssparser = { workspace = true } euclid = { workspace = true } -font-kit = { version = "0.13" } +font-kit = { version = "0.14" } fnv = { workspace = true } fonts = { path = "../fonts" } half = "2" @@ -34,7 +34,7 @@ parking_lot = { workspace = true } pathfinder_geometry = "0.5" pixels = { path = "../pixels" } range = { path = "../range" } -raqote = "0.8.4" +raqote = { git = "https://github.com/jrmuizel/raqote", rev = "64716c8" } servo_arc = { workspace = true } sparkle = { workspace = true } style = { workspace = true } diff --git a/components/config/Cargo.toml b/components/config/Cargo.toml index b2658507d40..4555ed10751 100644 --- a/components/config/Cargo.toml +++ b/components/config/Cargo.toml @@ -25,4 +25,4 @@ style_config = { workspace = true } url = { workspace = true } [target.'cfg(not(target_os = "android"))'.dependencies] -dirs-next = "2.0" +dirs = "5.0" diff --git a/components/config/basedir.rs b/components/config/basedir.rs index fd17e482b88..a7e5226dea9 100644 --- a/components/config/basedir.rs +++ b/components/config/basedir.rs @@ -15,7 +15,7 @@ use std::path::PathBuf; not(target_os = "android") ))] pub fn default_config_dir() -> Option { - let mut config_dir = ::dirs_next::config_dir().unwrap(); + let mut config_dir = ::dirs::config_dir().unwrap(); config_dir.push("servo"); config_dir.push("default"); Some(config_dir) @@ -30,14 +30,14 @@ pub fn default_config_dir() -> Option { pub fn default_config_dir() -> Option { // FIXME: use `config_dir()` ($HOME/Library/Preferences) // instead of `data_dir()` ($HOME/Library/Application Support) ? - let mut config_dir = ::dirs_next::data_dir().unwrap(); + let mut config_dir = ::dirs::data_dir().unwrap(); config_dir.push("Servo"); Some(config_dir) } #[cfg(target_os = "windows")] pub fn default_config_dir() -> Option { - let mut config_dir = ::dirs_next::config_dir().unwrap(); + let mut config_dir = ::dirs::config_dir().unwrap(); config_dir.push("Servo"); Some(config_dir) } diff --git a/components/fonts/Cargo.toml b/components/fonts/Cargo.toml index 78e4453ea13..6aef355c1af 100644 --- a/components/fonts/Cargo.toml +++ b/components/fonts/Cargo.toml @@ -64,7 +64,7 @@ freetype-sys = { workspace = true } servo_allocator = { path = "../allocator" } [target.'cfg(all(target_os = "linux", not(target_env = "ohos")))'.dependencies] -fontconfig_sys = { package = "yeslogic-fontconfig-sys", version = "5" } +fontconfig_sys = { package = "yeslogic-fontconfig-sys", version = "6" } [target.'cfg(target_os = "android")'.dependencies] xml-rs = "0.8"