From f80c3f43f5bda0c3639c162f9ec8d9a94a249d40 Mon Sep 17 00:00:00 2001 From: BiagioFesta <15035284+BiagioFesta@users.noreply.github.com> Date: Sat, 28 Sep 2024 03:07:56 +0200 Subject: [PATCH 01/20] glib-macros: add test macro for async-glib-context tests --- glib-macros/src/async_test.rs | 47 +++++++++++++++++++++++++++++++++++ glib-macros/src/lib.rs | 20 +++++++++++++++ glib/src/lib.rs | 5 ++-- 3 files changed, 70 insertions(+), 2 deletions(-) create mode 100644 glib-macros/src/async_test.rs diff --git a/glib-macros/src/async_test.rs b/glib-macros/src/async_test.rs new file mode 100644 index 000000000000..b55e84f4048b --- /dev/null +++ b/glib-macros/src/async_test.rs @@ -0,0 +1,47 @@ +// Take a look at the license at the top of the repository in the LICENSE file. + +use proc_macro::TokenStream; +use quote::ToTokens; + +pub(crate) fn async_test(_args: TokenStream, mut item: TokenStream) -> TokenStream { + let mut item_fn: syn::ItemFn = match syn::parse(item.clone()) { + Ok(it) => it, + Err(e) => { + item.extend(TokenStream::from(e.into_compile_error())); + return item; + } + }; + + if item_fn.sig.asyncness.is_none() { + item.extend(TokenStream::from( + syn::Error::new_spanned( + item_fn.sig.ident, + "The 'async' keyword is missing from the test function declaration", + ) + .into_compile_error(), + )); + return item; + } + + item_fn.sig.asyncness = None; + + let gen_attr = quote::quote! { + #[::core::prelude::v1::test] + }; + + let body = &item_fn.block; + + item_fn.block = syn::parse2(quote::quote! { + { + let main_ctx = glib::MainContext::new(); + main_ctx.block_on(async #body) + } + }) + .expect("Body parsing failure"); + + let mut tokens = TokenStream::new(); + tokens.extend(TokenStream::from(gen_attr.to_token_stream())); + tokens.extend(TokenStream::from(item_fn.into_token_stream())); + + tokens +} diff --git a/glib-macros/src/lib.rs b/glib-macros/src/lib.rs index 4dac0077f5e1..e3aa4083e521 100644 --- a/glib-macros/src/lib.rs +++ b/glib-macros/src/lib.rs @@ -1,5 +1,6 @@ // Take a look at the license at the top of the repository in the LICENSE file. +mod async_test; mod boxed_derive; mod clone; mod clone_old; @@ -1604,3 +1605,22 @@ pub fn derive_value_delegate(input: TokenStream) -> TokenStream { let input = parse_macro_input!(input as value_delegate_derive::ValueDelegateInput); value_delegate_derive::impl_value_delegate(input).unwrap() } + +/// An attribute macro for writing asynchronous test functions. +/// +/// This macro is designed to wrap an asynchronous test function and ensure that +/// it runs within a `glib::MainContext`. It helps in writing async tests that +/// require the use of an event loop for the asynchronous execution. +/// +/// # Example +/// +/// ``` +/// #[glib::async_test] +/// async fn my_async_test() { +/// // Test code that runs asynchronously +/// } +/// ``` +#[proc_macro_attribute] +pub fn async_test(args: TokenStream, item: TokenStream) -> TokenStream { + async_test::async_test(args, item) +} diff --git a/glib/src/lib.rs b/glib/src/lib.rs index 556e102d9f59..382a3d528894 100644 --- a/glib/src/lib.rs +++ b/glib/src/lib.rs @@ -29,8 +29,9 @@ pub use bitflags; #[doc(hidden)] pub use glib_macros::cstr_bytes; pub use glib_macros::{ - clone, closure, closure_local, derived_properties, flags, object_interface, object_subclass, - Boxed, Downgrade, Enum, ErrorDomain, Properties, SharedBoxed, ValueDelegate, Variant, + async_test, clone, closure, closure_local, derived_properties, flags, object_interface, + object_subclass, Boxed, Downgrade, Enum, ErrorDomain, Properties, SharedBoxed, ValueDelegate, + Variant, }; pub use glib_sys as ffi; pub use gobject_sys as gobject_ffi; From 2b3d085f28267bc66f905cb36118e568b8308dd5 Mon Sep 17 00:00:00 2001 From: Sebastian Wiesner Date: Sun, 13 Oct 2024 07:26:50 +0200 Subject: [PATCH 02/20] Safely and correctly convert InetAddress to IpAddr Removes use of unsafe code for conversion and implicitly fixes endianess issues in conversion. Fixes #1535 --- gio/src/inet_address.rs | 39 ++++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/gio/src/inet_address.rs b/gio/src/inet_address.rs index 86ea89ee1a33..e5d413accf98 100644 --- a/gio/src/inet_address.rs +++ b/gio/src/inet_address.rs @@ -1,6 +1,6 @@ // Take a look at the license at the top of the repository in the LICENSE file. -use std::net::{IpAddr, Ipv4Addr, Ipv6Addr}; +use std::net::IpAddr; use glib::{prelude::*, translate::*}; @@ -80,16 +80,33 @@ impl From for InetAddress { impl From for IpAddr { fn from(addr: InetAddress) -> Self { - let size = addr.native_size(); - unsafe { - let bytes = ffi::g_inet_address_to_bytes(addr.to_glib_none().0); - if size == 4 { - Self::V4(Ipv4Addr::from(*(bytes as *const [u8; 4]))) - } else if size == 16 { - Self::V6(Ipv6Addr::from(*(bytes as *const [u16; 8]))) - } else { - panic!("Unknown IP kind"); - } + match addr.to_bytes() { + Some(InetAddressBytes::V4(bytes)) => IpAddr::from(*bytes), + Some(InetAddressBytes::V6(bytes)) => IpAddr::from(*bytes), + None => panic!("Unknown IP kind"), } } } + +#[cfg(test)] +mod tests { + use std::net::IpAddr; + + use crate::InetAddress; + + #[test] + fn test_ipv6_to_rust() { + let rust_addr = "2606:50c0:8000::153".parse::().unwrap(); + assert!(rust_addr.is_ipv6()); + let gio_addr = InetAddress::from(rust_addr); + assert_eq!(rust_addr, IpAddr::from(gio_addr)); + } + + #[test] + fn test_ipv4_to_rust() { + let rust_addr = "185.199.108.153".parse::().unwrap(); + assert!(rust_addr.is_ipv4()); + let gio_addr = InetAddress::from(rust_addr); + assert_eq!(rust_addr, IpAddr::from(gio_addr)); + } +} From f90f0ebecda2d0f01133a5d3c7a48765aca273c9 Mon Sep 17 00:00:00 2001 From: erer1243 Date: Sun, 20 Oct 2024 15:11:53 -0400 Subject: [PATCH 03/20] use crate::Borrowed when not using glib --- cairo/src/xcb.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cairo/src/xcb.rs b/cairo/src/xcb.rs index d542639f1f7c..5b0f4f6e5704 100644 --- a/cairo/src/xcb.rs +++ b/cairo/src/xcb.rs @@ -7,6 +7,9 @@ use std::{ops::Deref, ptr}; #[cfg(feature = "use_glib")] use glib::translate::*; +#[cfg(not(feature = "use_glib"))] +use crate::Borrowed; + use crate::{ffi, Error, Surface, SurfaceType}; #[derive(Debug)] From ca708668b67a4469c4720143423d2e144623946f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 29 Oct 2024 14:42:06 +0200 Subject: [PATCH 04/20] glib-macros: Derived boxed types are not `TransparentPtrType` but `TransparentType` I.e. they're equal to their FFI representation, not equal to a pointer of their FFI representation. Fixes https://github.com/gtk-rs/gtk-rs-core/issues/1554 --- glib-macros/src/boxed_derive.rs | 4 +++- glib-macros/tests/test.rs | 13 +++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/glib-macros/src/boxed_derive.rs b/glib-macros/src/boxed_derive.rs index ab51b68da0d9..c6e254b43582 100644 --- a/glib-macros/src/boxed_derive.rs +++ b/glib-macros/src/boxed_derive.rs @@ -192,7 +192,9 @@ pub fn impl_boxed(input: &syn::DeriveInput) -> syn::Result { #impl_from_value - unsafe impl #crate_ident::translate::TransparentPtrType for #name {} + unsafe impl #crate_ident::translate::TransparentType for #name { + type GlibType = #name; + } impl #crate_ident::translate::GlibPtrDefault for #name { type GlibType = *mut #name; diff --git a/glib-macros/tests/test.rs b/glib-macros/tests/test.rs index 95471891ded5..c5e40237a02a 100644 --- a/glib-macros/tests/test.rs +++ b/glib-macros/tests/test.rs @@ -1,7 +1,7 @@ // Take a look at the license at the top of the repository in the LICENSE file. use glib::{ - collections::PtrSlice, + collections::Slice, prelude::*, translate::{FromGlib, IntoGlib}, }; @@ -185,19 +185,16 @@ fn derive_boxed_nullable() { } #[test] -fn boxed_transparent_ptr() { +fn boxed_transparent() { #[derive(Clone, Debug, PartialEq, Eq, glib::Boxed)] #[boxed_type(name = "MyBoxed")] struct MyBoxed(String); let vec = vec![MyBoxed(String::from("abc")), MyBoxed(String::from("dfg"))]; - // PtrSlice requires TransparentPtrType trait - let ptr_slice = PtrSlice::from(vec); - assert_eq!( - ptr_slice.last(), - Some(MyBoxed(String::from("dfg"))).as_ref() - ); + // Slice requires TransparentType trait + let slice = Slice::from(vec); + assert_eq!(slice.last(), Some(MyBoxed(String::from("dfg"))).as_ref()); } #[test] From f686aa731f5924c0530f8623b7dd5f67f70c02f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 29 Oct 2024 14:42:59 +0200 Subject: [PATCH 05/20] glib: collections: Add some more debug assertions about type sizes --- glib/src/collections/ptr_slice.rs | 5 +++++ glib/src/collections/slice.rs | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/glib/src/collections/ptr_slice.rs b/glib/src/collections/ptr_slice.rs index 5788e0e4b603..4c19b0655ad5 100644 --- a/glib/src/collections/ptr_slice.rs +++ b/glib/src/collections/ptr_slice.rs @@ -601,6 +601,11 @@ impl PtrSlice { /// Creates a new empty slice. #[inline] pub fn new() -> Self { + debug_assert_eq!( + mem::size_of::(), + mem::size_of::<::GlibType>() + ); + PtrSlice { ptr: ptr::NonNull::dangling(), len: 0, diff --git a/glib/src/collections/slice.rs b/glib/src/collections/slice.rs index 74c30a4f0938..eb674c342480 100644 --- a/glib/src/collections/slice.rs +++ b/glib/src/collections/slice.rs @@ -403,6 +403,7 @@ impl Slice { /// Borrows a C array. #[inline] pub unsafe fn from_glib_borrow_num<'a>(ptr: *const T::GlibType, len: usize) -> &'a [T] { + debug_assert_eq!(mem::size_of::(), mem::size_of::()); debug_assert!(!ptr.is_null() || len == 0); if len == 0 { @@ -416,6 +417,7 @@ impl Slice { /// Borrows a mutable C array. #[inline] pub unsafe fn from_glib_borrow_num_mut<'a>(ptr: *mut T::GlibType, len: usize) -> &'a mut [T] { + debug_assert_eq!(mem::size_of::(), mem::size_of::()); debug_assert!(!ptr.is_null() || len == 0); if len == 0 { @@ -432,6 +434,7 @@ impl Slice { ptr: *const *const T::GlibType, len: usize, ) -> &'a [&'a T] { + debug_assert_eq!(mem::size_of::(), mem::size_of::()); debug_assert!(!ptr.is_null() || len == 0); if len == 0 { @@ -448,6 +451,7 @@ impl Slice { ptr: *mut *mut T::GlibType, len: usize, ) -> &'a mut [&'a mut T] { + debug_assert_eq!(mem::size_of::(), mem::size_of::()); debug_assert!(!ptr.is_null() || len == 0); if len == 0 { @@ -522,6 +526,8 @@ impl Slice { /// Creates a new empty slice. #[inline] pub fn new() -> Self { + debug_assert_eq!(mem::size_of::(), mem::size_of::()); + Slice { ptr: ptr::NonNull::dangling(), len: 0, From 262fe48514dee21dc573f4bdb46abce580a6cd1f Mon Sep 17 00:00:00 2001 From: Fina Wilke Date: Thu, 3 Oct 2024 16:37:50 +0200 Subject: [PATCH 06/20] changelog: Fix typo --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 00ff0f4cf8c6..97ab388a08ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -258,7 +258,7 @@ Paolo Borelli: - gio: use `StrV` for the `file_info` API - gio: use `GStr` for the manual extension point implementation - glib: list: mark as transparent and impl TransparentPtr -- glib: Rename `StrVItem` to `GStrPtr` and make it clonable and transparent +- glib: Rename `StrVItem` to `GStrPtr` and make it cloneable and transparent - glib: `key_file`: return `PtrSlice` - glib-macros: further tweak docs - glib: Rename `GStrPtr` to `GStringPtr` From ca65f7b454604a44c8aba85b642a670ff4eb1ba2 Mon Sep 17 00:00:00 2001 From: Sebastian Wiesner Date: Thu, 17 Oct 2024 10:07:20 +0200 Subject: [PATCH 07/20] Add test for current output of log impl --- glib/tests/bridged_logging.rs | 157 ++++++++++++++++++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100644 glib/tests/bridged_logging.rs diff --git a/glib/tests/bridged_logging.rs b/glib/tests/bridged_logging.rs new file mode 100644 index 000000000000..383ccb19d4fa --- /dev/null +++ b/glib/tests/bridged_logging.rs @@ -0,0 +1,157 @@ +#![cfg(feature = "log")] + +use std::sync::{Arc, Mutex}; + +use glib::LogLevel; +use rs_log::Log; + +#[derive(Debug, PartialEq, Eq)] +struct LoggedEvent { + level: LogLevel, + fields: Vec<(String, Option)>, +} + +fn setup_log_collector() -> Arc>> { + let events = Arc::new(Mutex::new(Vec::new())); + let event_writer = events.clone(); + glib::log_set_writer_func(move |level, fields| { + let fields = fields + .iter() + .map(|field| { + ( + field.key().to_string(), + field.value_str().map(|s| s.to_owned()), + ) + }) + .collect(); + event_writer + .lock() + .unwrap() + .push(LoggedEvent { level, fields }); + glib::LogWriterOutput::Handled + }); + events +} + +/// Test the glib Rust logger with different formats. +/// +/// We put everything into one test because we can only set the log writer func once. +#[test] +fn glib_logger_formats() { + let events = setup_log_collector(); + + let record = rs_log::RecordBuilder::new() + .target("test_target") + .level(rs_log::Level::Info) + .args(format_args!("test message")) + .file(Some("/path/to/a/test/file.rs")) + .line(Some(42)) + .module_path(Some("foo::bar")) + .build(); + + glib::GlibLogger::new( + glib::GlibLoggerFormat::Plain, + glib::GlibLoggerDomain::CrateTarget, + ) + .log(&record); + let event = events.lock().unwrap().pop().unwrap(); + assert_eq!( + event, + LoggedEvent { + level: glib::LogLevel::Info, + fields: vec![ + ("GLIB_OLD_LOG_API".to_string(), Some("1".to_string())), + ("MESSAGE".to_string(), Some("test message".to_string())), + ("PRIORITY".to_string(), Some("6".to_string())), + ("GLIB_DOMAIN".to_string(), Some("test_target".to_string())) + ] + } + ); + events.lock().unwrap().clear(); + + glib::GlibLogger::new( + glib::GlibLoggerFormat::LineAndFile, + glib::GlibLoggerDomain::CrateTarget, + ) + .log(&record); + let event = events.lock().unwrap().pop().unwrap(); + assert_eq!( + event, + LoggedEvent { + level: glib::LogLevel::Info, + fields: vec![ + ("GLIB_OLD_LOG_API".to_string(), Some("1".to_string())), + ( + "MESSAGE".to_string(), + Some("/path/to/a/test/file.rs:42: test message".to_string()) + ), + ("PRIORITY".to_string(), Some("6".to_string())), + ("GLIB_DOMAIN".to_string(), Some("test_target".to_string())) + ] + } + ); + + glib::GlibLogger::new( + glib::GlibLoggerFormat::Structured, + glib::GlibLoggerDomain::CrateTarget, + ) + .log(&record); + let event = events.lock().unwrap().pop().unwrap(); + assert_eq!( + event, + LoggedEvent { + level: glib::LogLevel::Info, + fields: vec![ + ("PRIORITY".to_string(), Some("6".to_string())), + ( + "CODE_FILE".to_string(), + Some("glib/src/bridged_logging.rs".to_string()) + ), + ("CODE_LINE".to_string(), Some("147".to_string())), + ( + "CODE_FUNC".to_string(), + Some("glib::bridged_logging::GlibLogger::write_log_structured".to_string()) + ), + ( + "CODE_FILE".to_string(), + Some("/path/to/a/test/file.rs".to_string()) + ), + ("CODE_LINE".to_string(), Some("42".to_string())), + ("CODE_FUNC".to_string(), Some("foo::bar".to_string())), + ("MESSAGE".to_string(), Some("test message".to_string())), + ("GLIB_DOMAIN".to_string(), Some("test_target".to_string())) + ] + } + ); + + // Structured logging without location fields + glib::GlibLogger::new( + glib::GlibLoggerFormat::Structured, + glib::GlibLoggerDomain::CrateTarget, + ) + .log( + &rs_log::RecordBuilder::new() + .target("test_target") + .level(rs_log::Level::Info) + .args(format_args!("test message")) + .build(), + ); + let event = events.lock().unwrap().pop().unwrap(); + assert_eq!( + event, + LoggedEvent { + level: glib::LogLevel::Info, + fields: vec![ + ("PRIORITY".to_string(), Some("6".to_string())), + ("CODE_FILE".to_string(), Some("".to_string())), + ("CODE_LINE".to_string(), Some("".to_string())), + ( + "CODE_FUNC".to_string(), + Some("".to_string()) + ), + ("MESSAGE".to_string(), Some("test message".to_string())), + ("GLIB_DOMAIN".to_string(), Some("test_target".to_string())) + ] + } + ); +} From a4a5dca6d5a0f173012f9682eac54f8506368a65 Mon Sep 17 00:00:00 2001 From: Sebastian Wiesner Date: Thu, 17 Oct 2024 11:50:00 +0200 Subject: [PATCH 08/20] Enable log feature for glib tests --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 635048872653..28bd34ac2379 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -23,7 +23,7 @@ jobs: - { name: "cairo", features: "png,pdf,svg,ps,use_glib,v1_18,freetype,script,xcb,xlib,win32-surface", nightly: "--features 'png,pdf,svg,ps,use_glib,v1_18,freetype,script,xcb,xlib,win32-surface'", test_sys: true } - { name: "gdk-pixbuf", features: "v2_42", nightly: "--all-features", test_sys: true } - { name: "gio", features: "v2_80", nightly: "--all-features", test_sys: true } - - { name: "glib", features: "v2_80", nightly: "--all-features", test_sys: true } + - { name: "glib", features: "v2_80,log", nightly: "--all-features", test_sys: true } - { name: "graphene", features: "", nightly: "", test_sys: true } - { name: "pango", features: "v1_54", nightly: "--all-features", test_sys: true } - { name: "pangocairo", features: "", nightly: "--all-features", test_sys: true } From a5d75143ac30c4ab42841fa06b088f9e2fe7141e Mon Sep 17 00:00:00 2001 From: Sebastian Wiesner Date: Thu, 17 Oct 2024 10:57:39 +0200 Subject: [PATCH 09/20] Remove duplicated call --- glib/src/bridged_logging.rs | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/glib/src/bridged_logging.rs b/glib/src/bridged_logging.rs index 4573c83a35fa..04a2753af7cf 100644 --- a/glib/src/bridged_logging.rs +++ b/glib/src/bridged_logging.rs @@ -200,25 +200,19 @@ impl rs_log::Log for GlibLogger { } GlibLoggerFormat::Structured => { let args = record.args(); - if let Some(s) = args.as_str() { - GlibLogger::write_log_structured( - domain, - record.level(), - record.file(), - record.line(), - record.module_path(), - s, - ); + let message = if let Some(s) = args.as_str() { + s } else { - GlibLogger::write_log_structured( - domain, - record.level(), - record.file(), - record.line(), - record.module_path(), - &args.to_string(), - ); - } + &args.to_string() + }; + GlibLogger::write_log_structured( + domain, + record.level(), + record.file(), + record.line(), + record.module_path(), + message, + ); } }; } From bdf6ec793aab6f1cb3bad546691c8ec49e047ac5 Mon Sep 17 00:00:00 2001 From: Sebastian Wiesner Date: Thu, 17 Oct 2024 11:06:35 +0200 Subject: [PATCH 10/20] Do not use log_structured! This removes redundant file, line, and function fields. Fixes #1537 --- glib/src/bridged_logging.rs | 32 ++++++++++++++++++++------------ glib/tests/bridged_logging.rs | 9 --------- 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/glib/src/bridged_logging.rs b/glib/src/bridged_logging.rs index 04a2753af7cf..b49571dfe858 100644 --- a/glib/src/bridged_logging.rs +++ b/glib/src/bridged_logging.rs @@ -1,6 +1,6 @@ // Take a look at the license at the top of the repository in the LICENSE file. -use crate::{log as glib_log, translate::*}; +use crate::{gstr, log as glib_log, log_structured_array, translate::*, LogField}; // rustdoc-stripper-ignore-next /// Enumeration of the possible formatting behaviours for a @@ -143,17 +143,25 @@ impl GlibLogger { ) { let line = line.map(|l| l.to_string()); let line = line.as_deref(); - - crate::log_structured!( - domain.unwrap_or("default"), - GlibLogger::level_to_glib(level), - { - "CODE_FILE" => file.unwrap_or(""); - "CODE_LINE" => line.unwrap_or(""); - "CODE_FUNC" => func.unwrap_or(""); - "MESSAGE" => message; - } - ); + let glib_level = GlibLogger::level_to_glib(level); + let fields = [ + LogField::new(gstr!("PRIORITY"), glib_level.priority().as_bytes()), + LogField::new( + gstr!("CODE_FILE"), + file.unwrap_or("").as_bytes(), + ), + LogField::new( + gstr!("CODE_LINE"), + line.unwrap_or("").as_bytes(), + ), + LogField::new( + gstr!("CODE_FUNC"), + func.unwrap_or("").as_bytes(), + ), + LogField::new(gstr!("MESSAGE"), message.as_bytes()), + LogField::new(gstr!("GLIB_DOMAIN"), domain.unwrap_or("default").as_bytes()), + ]; + log_structured_array(glib_level, &fields); } } diff --git a/glib/tests/bridged_logging.rs b/glib/tests/bridged_logging.rs index 383ccb19d4fa..fd5fb98bf2fd 100644 --- a/glib/tests/bridged_logging.rs +++ b/glib/tests/bridged_logging.rs @@ -103,15 +103,6 @@ fn glib_logger_formats() { level: glib::LogLevel::Info, fields: vec![ ("PRIORITY".to_string(), Some("6".to_string())), - ( - "CODE_FILE".to_string(), - Some("glib/src/bridged_logging.rs".to_string()) - ), - ("CODE_LINE".to_string(), Some("147".to_string())), - ( - "CODE_FUNC".to_string(), - Some("glib::bridged_logging::GlibLogger::write_log_structured".to_string()) - ), ( "CODE_FILE".to_string(), Some("/path/to/a/test/file.rs".to_string()) From 159b4b206c914e3e7ffbf0bf9548cb4955fbbbc7 Mon Sep 17 00:00:00 2001 From: Sebastian Wiesner Date: Thu, 17 Oct 2024 11:45:17 +0200 Subject: [PATCH 11/20] Write line number without allocation --- glib/src/bridged_logging.rs | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/glib/src/bridged_logging.rs b/glib/src/bridged_logging.rs index b49571dfe858..17ca1e8f7e31 100644 --- a/glib/src/bridged_logging.rs +++ b/glib/src/bridged_logging.rs @@ -141,8 +141,20 @@ impl GlibLogger { func: Option<&str>, message: &str, ) { - let line = line.map(|l| l.to_string()); - let line = line.as_deref(); + // Write line number into a static array to avoid allocating its string + // representation. 16 bytes allow 10^15 lines, which should be more than + // sufficient. + let mut line_buffer = [0u8; 16]; + let line = { + use std::io::{Cursor, Write}; + let mut c = Cursor::new(line_buffer.as_mut_slice()); + match line { + Some(lineno) => write!(&mut c, "{lineno}").ok(), + None => write!(&mut c, "").ok(), + }; + let pos = c.position() as usize; + &line_buffer[..pos] + }; let glib_level = GlibLogger::level_to_glib(level); let fields = [ LogField::new(gstr!("PRIORITY"), glib_level.priority().as_bytes()), @@ -150,10 +162,7 @@ impl GlibLogger { gstr!("CODE_FILE"), file.unwrap_or("").as_bytes(), ), - LogField::new( - gstr!("CODE_LINE"), - line.unwrap_or("").as_bytes(), - ), + LogField::new(gstr!("CODE_LINE"), line), LogField::new( gstr!("CODE_FUNC"), func.unwrap_or("").as_bytes(), From ecf274c0f6b171e62674ec051a607fb00a89b053 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 29 Oct 2024 18:00:41 +0200 Subject: [PATCH 12/20] Update Cargo.lock --- Cargo.lock | 148 ++++++++++++++++++++++++++--------------------------- 1 file changed, 74 insertions(+), 74 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2e6d7653b1f3..b2ac6cddd3b4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -19,9 +19,9 @@ checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" [[package]] name = "anstyle" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" +checksum = "8365de52b16c035ff4fcafe0092ba9390540e3e352870ac09933bebcaa2c8c56" [[package]] name = "async-tls" @@ -39,9 +39,9 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "base64" @@ -102,9 +102,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.1.21" +version = "1.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07b1695e2c7e8fc85310cde85aeaab7e3097f593c91d209d3f9df76c928100f0" +checksum = "c2e7962b54006dcfcc61cb72735f4d89bb97061dd6a7ed882ec6b8ee53714c6f" dependencies = [ "shlex", ] @@ -302,9 +302,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ "futures-channel", "futures-core", @@ -317,9 +317,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", "futures-sink", @@ -327,15 +327,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-executor" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ "futures-core", "futures-task", @@ -344,15 +344,15 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-macro" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", @@ -361,21 +361,21 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-util" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-channel", "futures-core", @@ -579,9 +579,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.5" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" [[package]] name = "heck" @@ -597,9 +597,9 @@ checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" [[package]] name = "indexmap" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" +checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", "hashbrown", @@ -633,18 +633,18 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "js-sys" -version = "0.3.70" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" +checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" dependencies = [ "wasm-bindgen", ] [[package]] name = "libc" -version = "0.2.159" +version = "0.2.161" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" +checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" [[package]] name = "linux-raw-sys" @@ -685,9 +685,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "oorandom" @@ -768,9 +768,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" [[package]] name = "pin-utils" @@ -823,9 +823,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" dependencies = [ "unicode-ident", ] @@ -861,18 +861,18 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "355ae415ccd3a04315d3f8246e86d67689ea74d88d915576e1589a351062a13b" +checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" dependencies = [ "bitflags", ] [[package]] name = "regex" -version = "1.10.6" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", @@ -882,9 +882,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" dependencies = [ "aho-corasick", "memchr", @@ -893,9 +893,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "ring" @@ -929,9 +929,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.37" +version = "0.38.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" +checksum = "aa260229e6538e52293eeb577aabd09945a09d6d9cc0fc550ed7529056c2e32a" dependencies = [ "bitflags", "errno", @@ -978,9 +978,9 @@ dependencies = [ [[package]] name = "scc" -version = "2.1.17" +version = "2.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c947adb109a8afce5fc9c7bf951f87f146e9147b3a6a58413105628fb1d1e66" +checksum = "d8d25269dd3a12467afe2e510f69fb0b46b698e5afb296b59f2145259deaf8e8" dependencies = [ "sdd", ] @@ -1003,24 +1003,24 @@ dependencies = [ [[package]] name = "sdd" -version = "3.0.3" +version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a7b59a5d9b0099720b417b6325d91a52cbf5b3dcb5041d864be53eefa58abc" +checksum = "49c1eeaf4b6a87c7479688c6d52b9f1153cedd3c489300564f932b065c6eab95" [[package]] name = "serde" -version = "1.0.210" +version = "1.0.214" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +checksum = "f55c3193aca71c12ad7890f1785d2b73e1b9f63a0bbc353c08ef26fe03fc56b5" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.210" +version = "1.0.214" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766" dependencies = [ "proc-macro2", "quote", @@ -1029,9 +1029,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.128" +version = "1.0.132" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" dependencies = [ "itoa", "memchr", @@ -1114,9 +1114,9 @@ checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" [[package]] name = "syn" -version = "2.0.77" +version = "2.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" +checksum = "5023162dfcd14ef8f32034d8bcd4cc5ddc61ef7a247c024a33e24e1f24d21b56" dependencies = [ "proc-macro2", "quote", @@ -1144,9 +1144,9 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tempfile" -version = "3.12.0" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" +checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" dependencies = [ "cfg-if", "fastrand", @@ -1265,9 +1265,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" +checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" dependencies = [ "cfg-if", "once_cell", @@ -1276,9 +1276,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" +checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" dependencies = [ "bumpalo", "log", @@ -1291,9 +1291,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" +checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1301,9 +1301,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" +checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", @@ -1314,15 +1314,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" +checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" [[package]] name = "web-sys" -version = "0.3.70" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" +checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" dependencies = [ "js-sys", "wasm-bindgen", From 71ba97ae134a07f88e060dd2c30caeffde357a41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 29 Oct 2024 18:12:26 +0200 Subject: [PATCH 13/20] glib: Work around Rust <1.80 borrow checker issues --- glib/src/bridged_logging.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/glib/src/bridged_logging.rs b/glib/src/bridged_logging.rs index 17ca1e8f7e31..1a34bdb76f85 100644 --- a/glib/src/bridged_logging.rs +++ b/glib/src/bridged_logging.rs @@ -217,10 +217,12 @@ impl rs_log::Log for GlibLogger { } GlibLoggerFormat::Structured => { let args = record.args(); + let args_str; let message = if let Some(s) = args.as_str() { s } else { - &args.to_string() + args_str = args.to_string(); + &args_str }; GlibLogger::write_log_structured( domain, From 51f56fe08ab6629b1f1ac90841334a00a5e6386f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 30 Oct 2024 11:08:08 +0200 Subject: [PATCH 14/20] Update gir and gir-files --- gir | 2 +- gir-files | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gir b/gir index f7d2061cc781..c954dbdc9ac0 160000 --- a/gir +++ b/gir @@ -1 +1 @@ -Subproject commit f7d2061cc781c7e1de9865eca0718c993132a889 +Subproject commit c954dbdc9ac0b72081b63937431c646283cbcf33 diff --git a/gir-files b/gir-files index 4d1189172a70..1dc2560a9ae8 160000 --- a/gir-files +++ b/gir-files @@ -1 +1 @@ -Subproject commit 4d1189172a70c6cd6cd8db4954d7cfed2af3983b +Subproject commit 1dc2560a9ae89ae78ab63ef34b926a48e0fc3bb9 From 4a2067d4f4acf461b855323697cbea238958c7d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 30 Oct 2024 11:09:47 +0200 Subject: [PATCH 15/20] Regenerate with latest gir / gir-files --- gdk-pixbuf/src/auto/versions.txt | 4 ++-- gdk-pixbuf/sys/versions.txt | 4 ++-- gio/src/auto/app_launch_context.rs | 8 ++++++-- gio/src/auto/functions.rs | 7 +++++++ gio/src/auto/resource.rs | 12 ++++++++++++ gio/src/auto/versions.txt | 4 ++-- gio/sys/Cargo.toml | 4 ++++ gio/sys/src/lib.rs | 22 ++++++++++++++++++++++ gio/sys/versions.txt | 4 ++-- glib/gobject-sys/versions.txt | 4 ++-- glib/src/auto/functions.rs | 2 ++ glib/src/auto/main_context.rs | 14 ++++++++++++++ glib/src/auto/versions.txt | 4 ++-- glib/sys/Cargo.toml | 4 ++++ glib/sys/src/lib.rs | 12 ++++++++++++ glib/sys/versions.txt | 4 ++-- graphene/src/auto/versions.txt | 4 ++-- graphene/sys/versions.txt | 4 ++-- pango/src/auto/versions.txt | 4 ++-- pango/sys/versions.txt | 4 ++-- pangocairo/src/auto/versions.txt | 4 ++-- pangocairo/sys/versions.txt | 4 ++-- 22 files changed, 109 insertions(+), 28 deletions(-) diff --git a/gdk-pixbuf/src/auto/versions.txt b/gdk-pixbuf/src/auto/versions.txt index 79ce045ac9cd..a3aecadef692 100644 --- a/gdk-pixbuf/src/auto/versions.txt +++ b/gdk-pixbuf/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ f7d2061cc781) -from gir-files (https://github.com/gtk-rs/gir-files @ 4d1189172a70) +Generated by gir (https://github.com/gtk-rs/gir @ c954dbdc9ac0) +from gir-files (https://github.com/gtk-rs/gir-files @ 1dc2560a9ae8) diff --git a/gdk-pixbuf/sys/versions.txt b/gdk-pixbuf/sys/versions.txt index 79ce045ac9cd..a3aecadef692 100644 --- a/gdk-pixbuf/sys/versions.txt +++ b/gdk-pixbuf/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ f7d2061cc781) -from gir-files (https://github.com/gtk-rs/gir-files @ 4d1189172a70) +Generated by gir (https://github.com/gtk-rs/gir @ c954dbdc9ac0) +from gir-files (https://github.com/gtk-rs/gir-files @ 1dc2560a9ae8) diff --git a/gio/src/auto/app_launch_context.rs b/gio/src/auto/app_launch_context.rs index 05541e154e08..459ad4cc7339 100644 --- a/gio/src/auto/app_launch_context.rs +++ b/gio/src/auto/app_launch_context.rs @@ -64,11 +64,15 @@ pub trait AppLaunchContextExt: IsA + sealed::Sealed + 'static #[doc(alias = "g_app_launch_context_get_startup_notify_id")] #[doc(alias = "get_startup_notify_id")] - fn startup_notify_id(&self, info: &impl IsA, files: &[File]) -> Option { + fn startup_notify_id( + &self, + info: Option<&impl IsA>, + files: &[File], + ) -> Option { unsafe { from_glib_full(ffi::g_app_launch_context_get_startup_notify_id( self.as_ref().to_glib_none().0, - info.as_ref().to_glib_none().0, + info.map(|p| p.as_ref()).to_glib_none().0, files.to_glib_none().0, )) } diff --git a/gio/src/auto/functions.rs b/gio/src/auto/functions.rs index 8afb479b5395..aeecbd2a3814 100644 --- a/gio/src/auto/functions.rs +++ b/gio/src/auto/functions.rs @@ -547,6 +547,13 @@ pub fn resources_get_info( } } +#[cfg(feature = "v2_84")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2_84")))] +#[doc(alias = "g_resources_has_children")] +pub fn resources_has_children(path: &str) -> bool { + unsafe { from_glib(ffi::g_resources_has_children(path.to_glib_none().0)) } +} + #[doc(alias = "g_resources_lookup_data")] pub fn resources_lookup_data( path: &str, diff --git a/gio/src/auto/resource.rs b/gio/src/auto/resource.rs index d57e10129f34..6e7c75d4fb8e 100644 --- a/gio/src/auto/resource.rs +++ b/gio/src/auto/resource.rs @@ -67,6 +67,18 @@ impl Resource { } } + #[cfg(feature = "v2_84")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_84")))] + #[doc(alias = "g_resource_has_children")] + pub fn has_children(&self, path: &str) -> bool { + unsafe { + from_glib(ffi::g_resource_has_children( + self.to_glib_none().0, + path.to_glib_none().0, + )) + } + } + #[doc(alias = "g_resource_lookup_data")] pub fn lookup_data( &self, diff --git a/gio/src/auto/versions.txt b/gio/src/auto/versions.txt index 79ce045ac9cd..a3aecadef692 100644 --- a/gio/src/auto/versions.txt +++ b/gio/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ f7d2061cc781) -from gir-files (https://github.com/gtk-rs/gir-files @ 4d1189172a70) +Generated by gir (https://github.com/gtk-rs/gir @ c954dbdc9ac0) +from gir-files (https://github.com/gtk-rs/gir-files @ 1dc2560a9ae8) diff --git a/gio/sys/Cargo.toml b/gio/sys/Cargo.toml index 7e91c9464532..a2e4d6621812 100644 --- a/gio/sys/Cargo.toml +++ b/gio/sys/Cargo.toml @@ -32,6 +32,7 @@ v2_76 = ["v2_74"] v2_78 = ["v2_76"] v2_80 = ["v2_78"] v2_82 = ["v2_80"] +v2_84 = ["v2_82"] [lib] name = "gio_sys" @@ -109,6 +110,9 @@ version = "2.80" [package.metadata.system-deps.gio_2_0.v2_82] version = "2.81" +[package.metadata.system-deps.gio_2_0.v2_84] +version = "2.84" + [package.metadata.docs.rs] rustc-args = ["--cfg", "docsrs"] rustdoc-args = ["--cfg", "docsrs", "--generate-link-to-definition"] diff --git a/gio/sys/src/lib.rs b/gio/sys/src/lib.rs index f9fbc1267698..eccdd13c934f 100644 --- a/gio/sys/src/lib.rs +++ b/gio/sys/src/lib.rs @@ -3404,6 +3404,7 @@ pub struct GFileIface { *mut *mut glib::GError, ) -> gboolean, >, + pub query_exists: Option gboolean>, } impl ::std::fmt::Debug for GFileIface { @@ -3555,6 +3556,7 @@ impl ::std::fmt::Debug for GFileIface { .field("measure_disk_usage", &self.measure_disk_usage) .field("measure_disk_usage_async", &self.measure_disk_usage_async) .field("measure_disk_usage_finish", &self.measure_disk_usage_finish) + .field("query_exists", &self.query_exists) .finish() } } @@ -10043,6 +10045,9 @@ extern "C" { flags: *mut u32, error: *mut *mut glib::GError, ) -> gboolean; + #[cfg(feature = "v2_84")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_84")))] + pub fn g_resource_has_children(resource: *mut GResource, path: *const c_char) -> gboolean; pub fn g_resource_lookup_data( resource: *mut GResource, path: *const c_char, @@ -17251,6 +17256,9 @@ extern "C" { flags: *mut u32, error: *mut *mut glib::GError, ) -> gboolean; + #[cfg(feature = "v2_84")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_84")))] + pub fn g_resources_has_children(path: *const c_char) -> gboolean; pub fn g_resources_lookup_data( path: *const c_char, lookup_flags: GResourceLookupFlags, @@ -17313,7 +17321,21 @@ extern "C" { pub fn g_unix_mount_is_system_internal(mount_entry: *mut GUnixMountEntry) -> gboolean; pub fn g_unix_mount_points_changed_since(time: u64) -> gboolean; pub fn g_unix_mount_points_get(time_read: *mut u64) -> *mut glib::GList; + #[cfg(feature = "v2_82")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_82")))] + pub fn g_unix_mount_points_get_from_file( + table_path: *const c_char, + time_read_out: *mut u64, + n_points_out: *mut size_t, + ) -> *mut *mut GUnixMountPoint; pub fn g_unix_mounts_changed_since(time: u64) -> gboolean; pub fn g_unix_mounts_get(time_read: *mut u64) -> *mut glib::GList; + #[cfg(feature = "v2_82")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_82")))] + pub fn g_unix_mounts_get_from_file( + table_path: *const c_char, + time_read_out: *mut u64, + n_entries_out: *mut size_t, + ) -> *mut *mut GUnixMountEntry; } diff --git a/gio/sys/versions.txt b/gio/sys/versions.txt index 79ce045ac9cd..a3aecadef692 100644 --- a/gio/sys/versions.txt +++ b/gio/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ f7d2061cc781) -from gir-files (https://github.com/gtk-rs/gir-files @ 4d1189172a70) +Generated by gir (https://github.com/gtk-rs/gir @ c954dbdc9ac0) +from gir-files (https://github.com/gtk-rs/gir-files @ 1dc2560a9ae8) diff --git a/glib/gobject-sys/versions.txt b/glib/gobject-sys/versions.txt index 79ce045ac9cd..a3aecadef692 100644 --- a/glib/gobject-sys/versions.txt +++ b/glib/gobject-sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ f7d2061cc781) -from gir-files (https://github.com/gtk-rs/gir-files @ 4d1189172a70) +Generated by gir (https://github.com/gtk-rs/gir @ c954dbdc9ac0) +from gir-files (https://github.com/gtk-rs/gir-files @ 1dc2560a9ae8) diff --git a/glib/src/auto/functions.rs b/glib/src/auto/functions.rs index d311b313150d..b517156b49ed 100644 --- a/glib/src/auto/functions.rs +++ b/glib/src/auto/functions.rs @@ -695,6 +695,8 @@ pub fn shell_unquote( } } +//#[cfg(feature = "v2_82")] +//#[cfg_attr(docsrs, doc(cfg(feature = "v2_82")))] //#[doc(alias = "g_sort_array")] //pub fn sort_array(array: /*Unimplemented*/&[&Basic: Pointer], element_size: usize, compare_func: /*Unimplemented*/FnMut(/*Unimplemented*/Option, /*Unimplemented*/Option) -> i32, user_data: /*Unimplemented*/Option) { // unsafe { TODO: call ffi:g_sort_array() } diff --git a/glib/src/auto/main_context.rs b/glib/src/auto/main_context.rs index aa23424e48a8..eaa868c9ca5a 100644 --- a/glib/src/auto/main_context.rs +++ b/glib/src/auto/main_context.rs @@ -85,6 +85,13 @@ impl MainContext { unsafe { from_glib(ffi::g_main_context_pending(self.to_glib_none().0)) } } + //#[cfg(feature = "v2_64")] + //#[cfg_attr(docsrs, doc(cfg(feature = "v2_64")))] + //#[doc(alias = "g_main_context_pusher_new")] + //pub fn pusher_new(&self) -> /*Unknown conversion*//*Unimplemented*/MainContextPusher { + // unsafe { TODO: call ffi:g_main_context_pusher_new() } + //} + //#[doc(alias = "g_main_context_query")] //pub fn query(&self, max_priority: i32, fds: /*Ignored*/Vec) -> (i32, i32) { // unsafe { TODO: call ffi:g_main_context_query() } @@ -126,6 +133,13 @@ impl MainContext { unsafe { from_glib_none(ffi::g_main_context_get_thread_default()) } } + //#[cfg(feature = "v2_64")] + //#[cfg_attr(docsrs, doc(cfg(feature = "v2_64")))] + //#[doc(alias = "g_main_context_pusher_free")] + //pub fn pusher_free(pusher: /*Unknown conversion*//*Unimplemented*/MainContextPusher) { + // unsafe { TODO: call ffi:g_main_context_pusher_free() } + //} + #[doc(alias = "g_main_context_ref_thread_default")] pub fn ref_thread_default() -> MainContext { unsafe { from_glib_full(ffi::g_main_context_ref_thread_default()) } diff --git a/glib/src/auto/versions.txt b/glib/src/auto/versions.txt index 79ce045ac9cd..a3aecadef692 100644 --- a/glib/src/auto/versions.txt +++ b/glib/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ f7d2061cc781) -from gir-files (https://github.com/gtk-rs/gir-files @ 4d1189172a70) +Generated by gir (https://github.com/gtk-rs/gir @ c954dbdc9ac0) +from gir-files (https://github.com/gtk-rs/gir-files @ 1dc2560a9ae8) diff --git a/glib/sys/Cargo.toml b/glib/sys/Cargo.toml index f61c9f2c4781..216f6d7277c0 100644 --- a/glib/sys/Cargo.toml +++ b/glib/sys/Cargo.toml @@ -22,6 +22,7 @@ v2_76 = ["v2_74"] v2_78 = ["v2_76"] v2_80 = ["v2_78"] v2_82 = ["v2_80"] +v2_84 = ["v2_82"] [lib] name = "glib_sys" @@ -99,6 +100,9 @@ version = "2.80" [package.metadata.system-deps.glib_2_0.v2_82] version = "2.81" +[package.metadata.system-deps.glib_2_0.v2_84] +version = "2.84" + [package.metadata.system-deps.gobject_2_0] name = "gobject-2.0" version = "2.56" diff --git a/glib/sys/src/lib.rs b/glib/sys/src/lib.rs index ab5f3f5d83cf..ad36c51382ff 100644 --- a/glib/sys/src/lib.rs +++ b/glib/sys/src/lib.rs @@ -4150,6 +4150,9 @@ extern "C" { pub fn g_main_context_pop_thread_default(context: *mut GMainContext); pub fn g_main_context_prepare(context: *mut GMainContext, priority: *mut c_int) -> gboolean; pub fn g_main_context_push_thread_default(context: *mut GMainContext); + #[cfg(feature = "v2_64")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_64")))] + pub fn g_main_context_pusher_new(main_context: *mut GMainContext) -> *mut GMainContextPusher; pub fn g_main_context_query( context: *mut GMainContext, max_priority: c_int, @@ -4170,6 +4173,9 @@ extern "C" { pub fn g_main_context_wakeup(context: *mut GMainContext); pub fn g_main_context_default() -> *mut GMainContext; pub fn g_main_context_get_thread_default() -> *mut GMainContext; + #[cfg(feature = "v2_64")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_64")))] + pub fn g_main_context_pusher_free(pusher: *mut GMainContextPusher); pub fn g_main_context_ref_thread_default() -> *mut GMainContext; //========================================================================= @@ -6000,6 +6006,9 @@ extern "C" { pub fn g_variant_builder_close(builder: *mut GVariantBuilder); pub fn g_variant_builder_end(builder: *mut GVariantBuilder) -> *mut GVariant; pub fn g_variant_builder_init(builder: *mut GVariantBuilder, type_: *const GVariantType); + #[cfg(feature = "v2_84")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_84")))] + pub fn g_variant_builder_init_static(builder: *mut GVariantBuilder, type_: *const GVariantType); pub fn g_variant_builder_open(builder: *mut GVariantBuilder, type_: *const GVariantType); pub fn g_variant_builder_ref(builder: *mut GVariantBuilder) -> *mut GVariantBuilder; pub fn g_variant_builder_unref(builder: *mut GVariantBuilder); @@ -6946,6 +6955,9 @@ extern "C" { #[cfg(feature = "v2_58")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_58")))] pub fn g_ref_string_acquire(str: *mut c_char) -> *mut c_char; + #[cfg(feature = "v2_84")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_84")))] + pub fn g_ref_string_equal(str1: *const c_char, str2: *const c_char) -> gboolean; #[cfg(feature = "v2_58")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_58")))] pub fn g_ref_string_length(str: *mut c_char) -> size_t; diff --git a/glib/sys/versions.txt b/glib/sys/versions.txt index 79ce045ac9cd..a3aecadef692 100644 --- a/glib/sys/versions.txt +++ b/glib/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ f7d2061cc781) -from gir-files (https://github.com/gtk-rs/gir-files @ 4d1189172a70) +Generated by gir (https://github.com/gtk-rs/gir @ c954dbdc9ac0) +from gir-files (https://github.com/gtk-rs/gir-files @ 1dc2560a9ae8) diff --git a/graphene/src/auto/versions.txt b/graphene/src/auto/versions.txt index 79ce045ac9cd..a3aecadef692 100644 --- a/graphene/src/auto/versions.txt +++ b/graphene/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ f7d2061cc781) -from gir-files (https://github.com/gtk-rs/gir-files @ 4d1189172a70) +Generated by gir (https://github.com/gtk-rs/gir @ c954dbdc9ac0) +from gir-files (https://github.com/gtk-rs/gir-files @ 1dc2560a9ae8) diff --git a/graphene/sys/versions.txt b/graphene/sys/versions.txt index 79ce045ac9cd..a3aecadef692 100644 --- a/graphene/sys/versions.txt +++ b/graphene/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ f7d2061cc781) -from gir-files (https://github.com/gtk-rs/gir-files @ 4d1189172a70) +Generated by gir (https://github.com/gtk-rs/gir @ c954dbdc9ac0) +from gir-files (https://github.com/gtk-rs/gir-files @ 1dc2560a9ae8) diff --git a/pango/src/auto/versions.txt b/pango/src/auto/versions.txt index 79ce045ac9cd..a3aecadef692 100644 --- a/pango/src/auto/versions.txt +++ b/pango/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ f7d2061cc781) -from gir-files (https://github.com/gtk-rs/gir-files @ 4d1189172a70) +Generated by gir (https://github.com/gtk-rs/gir @ c954dbdc9ac0) +from gir-files (https://github.com/gtk-rs/gir-files @ 1dc2560a9ae8) diff --git a/pango/sys/versions.txt b/pango/sys/versions.txt index 79ce045ac9cd..a3aecadef692 100644 --- a/pango/sys/versions.txt +++ b/pango/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ f7d2061cc781) -from gir-files (https://github.com/gtk-rs/gir-files @ 4d1189172a70) +Generated by gir (https://github.com/gtk-rs/gir @ c954dbdc9ac0) +from gir-files (https://github.com/gtk-rs/gir-files @ 1dc2560a9ae8) diff --git a/pangocairo/src/auto/versions.txt b/pangocairo/src/auto/versions.txt index 79ce045ac9cd..a3aecadef692 100644 --- a/pangocairo/src/auto/versions.txt +++ b/pangocairo/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ f7d2061cc781) -from gir-files (https://github.com/gtk-rs/gir-files @ 4d1189172a70) +Generated by gir (https://github.com/gtk-rs/gir @ c954dbdc9ac0) +from gir-files (https://github.com/gtk-rs/gir-files @ 1dc2560a9ae8) diff --git a/pangocairo/sys/versions.txt b/pangocairo/sys/versions.txt index 79ce045ac9cd..a3aecadef692 100644 --- a/pangocairo/sys/versions.txt +++ b/pangocairo/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ f7d2061cc781) -from gir-files (https://github.com/gtk-rs/gir-files @ 4d1189172a70) +Generated by gir (https://github.com/gtk-rs/gir @ c954dbdc9ac0) +from gir-files (https://github.com/gtk-rs/gir-files @ 1dc2560a9ae8) From 741e7024d94900593c0b830e0a53d2384de4a65b Mon Sep 17 00:00:00 2001 From: Bilal Elmoussaoui Date: Fri, 18 Oct 2024 19:30:05 +0200 Subject: [PATCH 16/20] Re-export v2.84 feature --- gio/Cargo.toml | 1 + glib/Cargo.toml | 1 + 2 files changed, 2 insertions(+) diff --git a/gio/Cargo.toml b/gio/Cargo.toml index 779c93329dad..99e8cfdc654a 100644 --- a/gio/Cargo.toml +++ b/gio/Cargo.toml @@ -31,6 +31,7 @@ v2_76 = ["v2_74", "gio-sys/v2_76", "glib/v2_76"] v2_78 = ["v2_76", "gio-sys/v2_78", "glib/v2_78"] v2_80 = ["v2_78", "gio-sys/v2_80", "glib/v2_80"] v2_82 = ["v2_80", "gio-sys/v2_82", "glib/v2_82"] +v2_84 = ["v2_82", "gio-sys/v2_84", "glib/v2_84"] [dependencies] libc.workspace = true diff --git a/glib/Cargo.toml b/glib/Cargo.toml index 9c7a58a25c73..56fe9337e6fe 100644 --- a/glib/Cargo.toml +++ b/glib/Cargo.toml @@ -53,6 +53,7 @@ v2_76 = ["v2_74", "glib-sys/v2_76", "gobject-sys/v2_76"] v2_78 = ["v2_76", "glib-sys/v2_78", "gobject-sys/v2_78"] v2_80 = ["v2_78", "glib-sys/v2_80", "gobject-sys/v2_80"] v2_82 = ["v2_80", "glib-sys/v2_82", "gobject-sys/v2_82"] +v2_84 = ["v2_82", "glib-sys/v2_84"] log = ["rs-log"] log_macros = ["log"] compiletests = [] From d11ae12b4f82e9a7c06c0c5e2d65027b95b5f519 Mon Sep 17 00:00:00 2001 From: Bilal Elmoussaoui Date: Fri, 18 Oct 2024 19:31:20 +0200 Subject: [PATCH 17/20] ci: Bump tested glib/gio version --- .github/workflows/CI.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 28bd34ac2379..ac21aeb00f0e 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -22,8 +22,8 @@ jobs: conf: - { name: "cairo", features: "png,pdf,svg,ps,use_glib,v1_18,freetype,script,xcb,xlib,win32-surface", nightly: "--features 'png,pdf,svg,ps,use_glib,v1_18,freetype,script,xcb,xlib,win32-surface'", test_sys: true } - { name: "gdk-pixbuf", features: "v2_42", nightly: "--all-features", test_sys: true } - - { name: "gio", features: "v2_80", nightly: "--all-features", test_sys: true } - - { name: "glib", features: "v2_80,log", nightly: "--all-features", test_sys: true } + - { name: "gio", features: "v2_84", nightly: "--all-features", test_sys: true } + - { name: "glib", features: "v2_84,log", nightly: "--all-features", test_sys: true } - { name: "graphene", features: "", nightly: "", test_sys: true } - { name: "pango", features: "v1_54", nightly: "--all-features", test_sys: true } - { name: "pangocairo", features: "", nightly: "--all-features", test_sys: true } From 73dbce556cbfd92640c4689c3cb683fa172028cf Mon Sep 17 00:00:00 2001 From: Bilal Elmoussaoui Date: Fri, 18 Oct 2024 19:37:56 +0200 Subject: [PATCH 18/20] Re-sync version requirements --- .github/workflows/CI.yml | 2 +- gio/sys/Cargo.toml | 4 ++-- glib/gobject-sys/Cargo.toml | 2 +- glib/sys/Cargo.toml | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index ac21aeb00f0e..21ba5d6d8ee9 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -91,7 +91,7 @@ jobs: if: matrix.conf.test_sys && matrix.conf.name == 'glib' # GLib compile tests only on stable - name: Compile tests - run: cargo test --manifest-path glib/Cargo.toml --features "compiletests,v2_78" + run: cargo test --manifest-path glib/Cargo.toml --features "compiletests,v2_84" if: matrix.rust == 'stable' build-others: diff --git a/gio/sys/Cargo.toml b/gio/sys/Cargo.toml index a2e4d6621812..9a2f11a5ff2b 100644 --- a/gio/sys/Cargo.toml +++ b/gio/sys/Cargo.toml @@ -108,10 +108,10 @@ version = "2.77" version = "2.80" [package.metadata.system-deps.gio_2_0.v2_82] -version = "2.81" +version = "2.82" [package.metadata.system-deps.gio_2_0.v2_84] -version = "2.84" +version = "2.83" [package.metadata.docs.rs] rustc-args = ["--cfg", "docsrs"] diff --git a/glib/gobject-sys/Cargo.toml b/glib/gobject-sys/Cargo.toml index 575b7c66c374..844240624d24 100644 --- a/glib/gobject-sys/Cargo.toml +++ b/glib/gobject-sys/Cargo.toml @@ -92,7 +92,7 @@ version = "2.77" version = "2.80" [package.metadata.system-deps.gobject_2_0.v2_82] -version = "2.81" +version = "2.82" [package.metadata.docs.rs] rustc-args = ["--cfg", "docsrs"] diff --git a/glib/sys/Cargo.toml b/glib/sys/Cargo.toml index 216f6d7277c0..15806cf5117b 100644 --- a/glib/sys/Cargo.toml +++ b/glib/sys/Cargo.toml @@ -98,10 +98,10 @@ version = "2.77" version = "2.80" [package.metadata.system-deps.glib_2_0.v2_82] -version = "2.81" +version = "2.82" [package.metadata.system-deps.glib_2_0.v2_84] -version = "2.84" +version = "2.83" [package.metadata.system-deps.gobject_2_0] name = "gobject-2.0" From 8d4bc84ca6dbbe4c9640f1a0062fffb407a52599 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 22 Oct 2024 13:13:36 +0300 Subject: [PATCH 19/20] Update branch from master to main --- .github/workflows/CI.yml | 4 ++-- .github/workflows/docs.yml | 20 ++++++++++---------- .github/workflows/image.yml | 2 +- .github/workflows/typos.yml | 2 +- .github/workflows/windows.yml | 2 +- README.md | 8 ++++---- examples/README.md | 2 +- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 21ba5d6d8ee9..dd97c7edb128 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -1,6 +1,6 @@ on: push: - branches: [master] + branches: [main] pull_request: workflow_dispatch: @@ -36,7 +36,7 @@ jobs: - uses: actions/checkout@v4 with: repository: gtk-rs/checker - ref: master + ref: main path: checker if: matrix.rust == 'nightly' # nightly diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 29819b13d65d..80ef9dcfb975 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,6 +1,6 @@ on: push: - branches: [master] + branches: [main] pull_request: workflow_dispatch: release: @@ -40,7 +40,7 @@ jobs: - run: cargo install rustdoc-stripper - run: python3 ./generator.py --embed-docs --yes ./ - run: git clone https://gitlab.gnome.org/World/Rust/gir-rustdoc/ # checkout action doesn't support random urls - - run: echo "RUSTDOCFLAGS=$(eval python3 ./gir-rustdoc/gir-rustdoc.py --pages-url 'https://gtk-rs.org/gtk-rs-core/' --default-branch 'master' pre-docs | xargs)" >> ${GITHUB_ENV} + - run: echo "RUSTDOCFLAGS=$(eval python3 ./gir-rustdoc/gir-rustdoc.py --pages-url 'https://gtk-rs.org/gtk-rs-core/' --default-branch 'main' pre-docs | xargs)" >> ${GITHUB_ENV} - uses: actions-rs/cargo@v1 with: command: doc @@ -67,16 +67,16 @@ jobs: - run: echo "RELEASE=$(echo '${{ github.event.release.tag_name }}' | grep -Po '(\d+)\.(\d+)')" >> ${GITHUB_ENV} - run: echo "DEST=$(if [ "$GITHUB_EVENT_NAME" == "release" ]; then echo 'stable/${{ env.RELEASE }}'; else echo 'git'; fi)" >> ${GITHUB_ENV} - name: Grab gtk-rs LOGO - if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'release' }} + if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event_name == 'release' }} run: | - wget https://raw.githubusercontent.com/gtk-rs/gtk-rs.github.io/master/logo/gtk-rs-16.png -O ./target/doc/favicon-16x16.png - wget https://raw.githubusercontent.com/gtk-rs/gtk-rs.github.io/master/logo/gtk-rs-32.png -O ./target/doc/favicon-32x32.png - wget https://raw.githubusercontent.com/gtk-rs/gtk-rs.github.io/master/logo/gtk-rs-256.png -O ./target/doc/rust-logo.png - wget https://raw.githubusercontent.com/gtk-rs/gtk-rs.github.io/master/logo/gtk-rs.svg -O ./target/doc/rust-logo.svg - wget https://raw.githubusercontent.com/gtk-rs/gtk-rs.github.io/master/logo/gtk-rs.svg -O ./target/doc/favicon.svg + wget https://raw.githubusercontent.com/gtk-rs/gtk-rs.github.io/main/logo/gtk-rs-16.png -O ./target/doc/favicon-16x16.png + wget https://raw.githubusercontent.com/gtk-rs/gtk-rs.github.io/main/logo/gtk-rs-32.png -O ./target/doc/favicon-32x32.png + wget https://raw.githubusercontent.com/gtk-rs/gtk-rs.github.io/main/logo/gtk-rs-256.png -O ./target/doc/rust-logo.png + wget https://raw.githubusercontent.com/gtk-rs/gtk-rs.github.io/main/logo/gtk-rs.svg -O ./target/doc/rust-logo.svg + wget https://raw.githubusercontent.com/gtk-rs/gtk-rs.github.io/main/logo/gtk-rs.svg -O ./target/doc/favicon.svg - name: deploy - if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'release' }} + if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event_name == 'release' }} uses: peaceiris/actions-gh-pages@v4 with: github_token: ${{ secrets.GITHUB_TOKEN }} @@ -87,7 +87,7 @@ jobs: - run: python3 ./gir-rustdoc/gir-rustdoc.py --project-title 'GTK Core Rust bindings' html-index - name: deploy index page uses: peaceiris/actions-gh-pages@v4 - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./public/ diff --git a/.github/workflows/image.yml b/.github/workflows/image.yml index 9c4e2968b7ea..e54645692802 100644 --- a/.github/workflows/image.yml +++ b/.github/workflows/image.yml @@ -6,7 +6,7 @@ on: - cron: '0 0 * * 1' push: branches: - - "master" + - "main" paths: - "Dockerfile" pull_request: diff --git a/.github/workflows/typos.yml b/.github/workflows/typos.yml index 74d258d93f7a..24309da9ec8e 100644 --- a/.github/workflows/typos.yml +++ b/.github/workflows/typos.yml @@ -3,7 +3,7 @@ on: pull_request: push: branches: - - "master" + - "main" jobs: typos: name: Spell Check with Typos diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index d6c179fa627e..7090d8889e43 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -1,6 +1,6 @@ on: push: - branches: [master] + branches: [main] pull_request: workflow_dispatch: diff --git a/README.md b/README.md index 71f6bb85d859..b8b9719300dd 100644 --- a/README.md +++ b/README.md @@ -50,10 +50,10 @@ $ git submodule update --checkout ## Development -This repository is mostly split into two branches: `master` and `crate`. -`master` contains the not yet released code and is where new developments -are happening. `crate` contains the last release source code and isn't supposed to -be updated. +This repository is mostly split into two branches: `main` and versioned +branches, e.g. `0.20`. `main` contains the not yet released code and is where +new developments are happening. `0.20` contains the last release source code +of the 0.20 release branch. This repository is structured as follows: diff --git a/examples/README.md b/examples/README.md index ff30a3c647a2..1ff26cb3a840 100644 --- a/examples/README.md +++ b/examples/README.md @@ -1,6 +1,6 @@ # Examples -Consists of various examples of how to use the `gtk-rs-core` libraries. Note that there are other examples in [gtk3-rs](https://github.com/gtk-rs/gtk3-rs/tree/master/examples) & [gtk4-rs](https://github.com/gtk-rs/gtk4-rs/tree/master/examples) if you want GTK specific ones. +Consists of various examples of how to use the `gtk-rs-core` libraries. Note that there are other examples in [gtk3-rs](https://github.com/gtk-rs/gtk3-rs/tree/master/examples) & [gtk4-rs](https://github.com/gtk-rs/gtk4-rs/tree/main/examples) if you want GTK specific ones. - [GIO Async TLS](./gio_async_tls/) - [GIO Futures](./gio_futures/) From 46ce40764a17483a9bcdfb1dbb9cc27c583e6db2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 30 Oct 2024 11:24:21 +0200 Subject: [PATCH 20/20] Update versions to 0.20.5 --- Cargo.lock | 36 ++++++++++++++++++------------------ Cargo.toml | 6 +++--- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b2ac6cddd3b4..4d52cadce179 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -72,7 +72,7 @@ checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "cairo-rs" -version = "0.20.4" +version = "0.20.5" dependencies = [ "bitflags", "cairo-sys-rs", @@ -85,7 +85,7 @@ dependencies = [ [[package]] name = "cairo-sys-rs" -version = "0.20.4" +version = "0.20.5" dependencies = [ "glib-sys", "libc", @@ -391,7 +391,7 @@ dependencies = [ [[package]] name = "gdk-pixbuf" -version = "0.20.4" +version = "0.20.5" dependencies = [ "gdk-pixbuf-sys", "gio", @@ -402,7 +402,7 @@ dependencies = [ [[package]] name = "gdk-pixbuf-sys" -version = "0.20.4" +version = "0.20.5" dependencies = [ "gio-sys", "glib-sys", @@ -426,7 +426,7 @@ dependencies = [ [[package]] name = "gio" -version = "0.20.4" +version = "0.20.5" dependencies = [ "futures", "futures-channel", @@ -444,7 +444,7 @@ dependencies = [ [[package]] name = "gio-sys" -version = "0.20.4" +version = "0.20.5" dependencies = [ "glib-sys", "gobject-sys", @@ -463,7 +463,7 @@ checksum = "3a5da913a8586ce748f1164c890e1ebe75a7bbc472668f57b7f9fb893d7ac416" [[package]] name = "glib" -version = "0.20.4" +version = "0.20.5" dependencies = [ "bitflags", "criterion", @@ -487,14 +487,14 @@ dependencies = [ [[package]] name = "glib-build-tools" -version = "0.20.4" +version = "0.20.5" dependencies = [ "gio", ] [[package]] name = "glib-macros" -version = "0.20.4" +version = "0.20.5" dependencies = [ "glib", "heck", @@ -507,7 +507,7 @@ dependencies = [ [[package]] name = "glib-sys" -version = "0.20.4" +version = "0.20.5" dependencies = [ "libc", "shell-words", @@ -523,7 +523,7 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "gobject-sys" -version = "0.20.4" +version = "0.20.5" dependencies = [ "glib-sys", "libc", @@ -534,7 +534,7 @@ dependencies = [ [[package]] name = "graphene-rs" -version = "0.20.4" +version = "0.20.5" dependencies = [ "gir-format-check", "glib", @@ -544,7 +544,7 @@ dependencies = [ [[package]] name = "graphene-sys" -version = "0.20.4" +version = "0.20.5" dependencies = [ "glib-sys", "libc", @@ -556,7 +556,7 @@ dependencies = [ [[package]] name = "gtk-rs-examples" -version = "0.20.4" +version = "0.20.5" dependencies = [ "async-tls", "futures", @@ -697,7 +697,7 @@ checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" [[package]] name = "pango" -version = "0.20.4" +version = "0.20.5" dependencies = [ "gio", "gir-format-check", @@ -708,7 +708,7 @@ dependencies = [ [[package]] name = "pango-sys" -version = "0.20.4" +version = "0.20.5" dependencies = [ "glib-sys", "gobject-sys", @@ -720,7 +720,7 @@ dependencies = [ [[package]] name = "pangocairo" -version = "0.20.4" +version = "0.20.5" dependencies = [ "cairo-rs", "gir-format-check", @@ -732,7 +732,7 @@ dependencies = [ [[package]] name = "pangocairo-sys" -version = "0.20.4" +version = "0.20.5" dependencies = [ "cairo-sys-rs", "glib-sys", diff --git a/Cargo.toml b/Cargo.toml index 1f1bdd746180..1e579de8b740 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,7 +27,7 @@ exclude = ["gir", "checker"] [workspace.package] homepage = "https://gtk-rs.org/" authors = ["The gtk-rs Project Developers"] -version = "0.20.4" +version = "0.20.5" repository = "https://github.com/gtk-rs/gtk-rs-core" license = "MIT" exclude = [ @@ -40,10 +40,10 @@ rust-version = "1.70" libc = "0.2" bitflags = "2.6" gir-format-check = "^0.1" -glib-sys = { path = "glib/sys", version = "0.20" } +glib-sys = { path = "glib/sys", version = "0.20.5" } gobject-sys = { path = "glib/gobject-sys", version = "0.20" } glib = { path = "glib", version = "0.20.3" } -gio-sys = { path = "gio/sys", version = "0.20" } +gio-sys = { path = "gio/sys", version = "0.20.5" } gio = { path = "gio", version = "0.20" } pango-sys = { path = "pango/sys", version = "0.20" } pango = { path = "pango", version = "0.20" }