From cccc0f1a5b79e2c9d447ee04f123336abe9f1519 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Thu, 31 Aug 2023 14:40:01 -0400 Subject: [PATCH] rust: Port to glib 0.18 - Also rolls up a few other changes in the C API - Drop `&mut` from `OstreeKernelArgs`; it now confuses type inference. More generally while using `&mut` here was well intentioned, it goes against the glib standard of mapping everything to `&` and accepting interior mutability. --- Cargo.toml | 4 +- rust-bindings/src/auto/mutable_tree.rs | 2 +- rust-bindings/src/auto/repo.rs | 15 ++++--- rust-bindings/src/auto/versions.txt | 2 +- rust-bindings/src/collection_ref.rs | 8 ++-- rust-bindings/src/commit_sizes_entry.rs | 16 +++---- rust-bindings/src/kernel_args.rs | 58 +++++++++++-------------- rust-bindings/src/repo.rs | 2 + rust-bindings/src/tests/kernel_args.rs | 12 ++--- rust-bindings/sys/Cargo.toml | 8 ++-- rust-bindings/sys/src/auto/versions.txt | 2 +- rust-bindings/sys/src/lib.rs | 20 +++++---- rust-bindings/sys/tests/abi.rs | 2 +- 13 files changed, 76 insertions(+), 75 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index bdfa604e..d354aeff 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -41,8 +41,8 @@ members = [".", "rust-bindings/sys"] base64 = "0.20.0" bitflags = "1.2.1" ffi = { package = "ostree-sys", path = "rust-bindings/sys", version = "0.13.0" } -gio = "0.16" -glib = "0.16" +gio = "0.18" +glib = "0.18" hex = "0.4.2" libc = "0.2" once_cell = "1.4.0" diff --git a/rust-bindings/src/auto/mutable_tree.rs b/rust-bindings/src/auto/mutable_tree.rs index 88602ed4..628adf2e 100644 --- a/rust-bindings/src/auto/mutable_tree.rs +++ b/rust-bindings/src/auto/mutable_tree.rs @@ -115,7 +115,7 @@ impl MutableTree { //#[doc(alias = "ostree_mutable_tree_get_subdirs")] //#[doc(alias = "get_subdirs")] - //pub fn subdirs(&self) -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 1, id: 24 } { + //pub fn subdirs(&self) -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 1, id: 23 } { // unsafe { TODO: call ffi:ostree_mutable_tree_get_subdirs() } //} diff --git a/rust-bindings/src/auto/repo.rs b/rust-bindings/src/auto/repo.rs index 39bead09..e4649dc4 100644 --- a/rust-bindings/src/auto/repo.rs +++ b/rust-bindings/src/auto/repo.rs @@ -149,6 +149,11 @@ impl Repo { } } + //#[doc(alias = "ostree_repo_commit_add_composefs_metadata")] + //pub fn commit_add_composefs_metadata(&self, format_version: u32, dict: /*Ignored*/&glib::VariantDict, repo_root: &RepoFile, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { + // unsafe { TODO: call ffi:ostree_repo_commit_add_composefs_metadata() } + //} + #[doc(alias = "ostree_repo_commit_transaction")] pub fn commit_transaction(&self, cancellable: Option<&impl IsA>) -> Result { unsafe { @@ -446,7 +451,7 @@ impl Repo { //} //#[doc(alias = "ostree_repo_list_objects")] - //pub fn list_objects(&self, flags: RepoListObjectsFlags, out_objects: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 203 }/TypeId { ns_id: 2, id: 203 }, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { + //pub fn list_objects(&self, flags: RepoListObjectsFlags, out_objects: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 204 }/TypeId { ns_id: 2, id: 204 }, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { // unsafe { TODO: call ffi:ostree_repo_list_objects() } //} @@ -1087,7 +1092,7 @@ impl Repo { } //#[doc(alias = "ostree_repo_traverse_commit")] - //pub fn traverse_commit(&self, commit_checksum: &str, maxdepth: i32, out_reachable: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 203 }/TypeId { ns_id: 2, id: 203 }, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { + //pub fn traverse_commit(&self, commit_checksum: &str, maxdepth: i32, out_reachable: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 204 }/TypeId { ns_id: 2, id: 204 }, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { // unsafe { TODO: call ffi:ostree_repo_traverse_commit() } //} @@ -1113,7 +1118,7 @@ impl Repo { //#[cfg(any(feature = "v2018_6", feature = "dox"))] //#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] //#[doc(alias = "ostree_repo_traverse_reachable_refs")] - //pub fn traverse_reachable_refs(&self, depth: u32, reachable: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 203 }/TypeId { ns_id: 2, id: 203 }, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { + //pub fn traverse_reachable_refs(&self, depth: u32, reachable: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 204 }/TypeId { ns_id: 2, id: 204 }, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { // unsafe { TODO: call ffi:ostree_repo_traverse_reachable_refs() } //} @@ -1364,12 +1369,12 @@ impl Repo { //#[cfg(any(feature = "v2018_5", feature = "dox"))] //#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_5")))] //#[doc(alias = "ostree_repo_traverse_new_parents")] - //pub fn traverse_new_parents() -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 203 }/TypeId { ns_id: 2, id: 203 } { + //pub fn traverse_new_parents() -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 204 }/TypeId { ns_id: 2, id: 204 } { // unsafe { TODO: call ffi:ostree_repo_traverse_new_parents() } //} //#[doc(alias = "ostree_repo_traverse_new_reachable")] - //pub fn traverse_new_reachable() -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 203 }/TypeId { ns_id: 2, id: 203 } { + //pub fn traverse_new_reachable() -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 204 }/TypeId { ns_id: 2, id: 204 } { // unsafe { TODO: call ffi:ostree_repo_traverse_new_reachable() } //} diff --git a/rust-bindings/src/auto/versions.txt b/rust-bindings/src/auto/versions.txt index 8135982b..abc0dca6 100644 --- a/rust-bindings/src/auto/versions.txt +++ b/rust-bindings/src/auto/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ 0eeebbdf9d4d) -from gir-files (@ 00c41eacd26a) +from gir-files (@ e93ebd738598) diff --git a/rust-bindings/src/collection_ref.rs b/rust-bindings/src/collection_ref.rs index 47daaaca..1e44240b 100644 --- a/rust-bindings/src/collection_ref.rs +++ b/rust-bindings/src/collection_ref.rs @@ -28,9 +28,9 @@ impl CollectionRef { /// /// If no collection ID was set in the `CollectionRef`, `None` is returned. pub fn collection_id(&self) -> Option<&CStr> { - let inner = self.to_glib_none(); + let inner = ToGlibPtr::<*const ffi::OstreeCollectionRef>::to_glib_none(self).0; unsafe { - (*inner.0) + (*inner) .collection_id .as_nonnull_ptr() .map(|ptr| CStr::from_ptr(ptr)) @@ -43,8 +43,8 @@ impl CollectionRef { /// Since the value may not be valid UTF-8, `&CStr` is returned. You can safely turn it into a /// `&str` using the `as_str` method. pub fn ref_name(&self) -> &CStr { - let inner = self.to_glib_none(); - unsafe { CStr::from_ptr((*inner.0).ref_name) } + let inner = ToGlibPtr::<*const ffi::OstreeCollectionRef>::to_glib_none(self).0; + unsafe { CStr::from_ptr((*inner).ref_name) } } } diff --git a/rust-bindings/src/commit_sizes_entry.rs b/rust-bindings/src/commit_sizes_entry.rs index d96b4f0f..2196503e 100644 --- a/rust-bindings/src/commit_sizes_entry.rs +++ b/rust-bindings/src/commit_sizes_entry.rs @@ -7,26 +7,26 @@ use glib::{ impl CommitSizesEntry { /// Object checksum as hex string. pub fn checksum(&self) -> GString { - let underlying = self.to_glib_none(); - unsafe { GString::from_glib_none((*underlying.0).checksum) } + let inner = ToGlibPtr::<*const ffi::OstreeCommitSizesEntry>::to_glib_none(self).0; + unsafe { GString::from_glib_none((*inner).checksum) } } /// The object type. pub fn objtype(&self) -> ObjectType { - let underlying = self.to_glib_none(); - unsafe { ObjectType::from_glib((*underlying.0).objtype) } + let inner = ToGlibPtr::<*const ffi::OstreeCommitSizesEntry>::to_glib_none(self).0; + unsafe { ObjectType::from_glib((*inner).objtype) } } /// Unpacked object size. pub fn unpacked(&self) -> u64 { - let underlying = self.to_glib_none(); - unsafe { (*underlying.0).unpacked } + let inner = ToGlibPtr::<*const ffi::OstreeCommitSizesEntry>::to_glib_none(self).0; + unsafe { (*inner).unpacked } } /// Compressed object size. pub fn archived(&self) -> u64 { - let underlying = self.to_glib_none(); - unsafe { (*underlying.0).archived } + let inner = ToGlibPtr::<*const ffi::OstreeCommitSizesEntry>::to_glib_none(self).0; + unsafe { (*inner).archived } } } diff --git a/rust-bindings/src/kernel_args.rs b/rust-bindings/src/kernel_args.rs index ea7fc532..ddce4f8d 100644 --- a/rust-bindings/src/kernel_args.rs +++ b/rust-bindings/src/kernel_args.rs @@ -1,4 +1,3 @@ -use ffi::OstreeKernelArgs; #[cfg(any(feature = "v2019_3", feature = "dox"))] use glib::object::IsA; use glib::translate::*; @@ -21,26 +20,26 @@ glib::wrapper! { impl KernelArgs { /// Add a kernel argument. #[cfg(any(feature = "v2019_3", feature = "dox"))] - pub fn append(&mut self, arg: &str) { + pub fn append(&self, arg: &str) { unsafe { - ffi::ostree_kernel_args_append(self.to_glib_none_mut().0, arg.to_glib_none().0); + ffi::ostree_kernel_args_append(self.to_glib_none().0, arg.to_glib_none().0); } } /// Add multiple kernel arguments. #[cfg(any(feature = "v2019_3", feature = "dox"))] - pub fn append_argv(&mut self, argv: &[&str]) { + pub fn append_argv(&self, argv: &[&str]) { unsafe { - ffi::ostree_kernel_args_append_argv(self.to_glib_none_mut().0, argv.to_glib_none().0); + ffi::ostree_kernel_args_append_argv(self.to_glib_none().0, argv.to_glib_none().0); } } /// Appends each argument that does not have one of `prefixes`. #[cfg(any(feature = "v2019_3", feature = "dox"))] - pub fn append_argv_filtered(&mut self, argv: &[&str], prefixes: &[&str]) { + pub fn append_argv_filtered(&self, argv: &[&str], prefixes: &[&str]) { unsafe { ffi::ostree_kernel_args_append_argv_filtered( - self.to_glib_none_mut().0, + self.to_glib_none().0, argv.to_glib_none().0, prefixes.to_glib_none().0, ); @@ -50,13 +49,13 @@ impl KernelArgs { /// Append the entire contents of the currently booted kernel commandline. #[cfg(any(feature = "v2019_3", feature = "dox"))] pub fn append_proc_cmdline>( - &mut self, + &self, cancellable: Option<&P>, ) -> Result<(), glib::Error> { unsafe { let mut error = ptr::null_mut(); let _ = ffi::ostree_kernel_args_append_proc_cmdline( - self.to_glib_none_mut().0, + self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error, ); @@ -69,11 +68,11 @@ impl KernelArgs { } /// Remove a kernel argument. - pub fn delete(&mut self, arg: &str) -> Result<(), glib::Error> { + pub fn delete(&self, arg: &str) -> Result<(), glib::Error> { unsafe { let mut error = ptr::null_mut(); let _ = ffi::ostree_kernel_args_delete( - self.to_glib_none_mut().0, + self.to_glib_none().0, arg.to_glib_none().0, &mut error, ); @@ -87,11 +86,11 @@ impl KernelArgs { /// Remove a kernel argument. #[cfg(any(feature = "v2019_3", feature = "dox"))] - pub fn delete_key_entry(&mut self, key: &str) -> Result<(), glib::Error> { + pub fn delete_key_entry(&self, key: &str) -> Result<(), glib::Error> { unsafe { let mut error = ptr::null_mut(); let _ = ffi::ostree_kernel_args_delete_key_entry( - self.to_glib_none_mut().0, + self.to_glib_none().0, key.to_glib_none().0, &mut error, ); @@ -108,7 +107,7 @@ impl KernelArgs { pub fn get_last_value(&self, key: &str) -> Option { unsafe { from_glib_none(ffi::ostree_kernel_args_get_last_value( - self.to_glib_none().0 as *mut OstreeKernelArgs, + self.to_glib_none().0, key.to_glib_none().0, )) } @@ -116,11 +115,11 @@ impl KernelArgs { /// Replace any existing `foo=bar` with `foo=other` e.g. #[cfg(any(feature = "v2019_3", feature = "dox"))] - pub fn new_replace(&mut self, arg: &str) -> Result<(), glib::Error> { + pub fn new_replace(&self, arg: &str) -> Result<(), glib::Error> { unsafe { let mut error = ptr::null_mut(); let _ = ffi::ostree_kernel_args_new_replace( - self.to_glib_none_mut().0, + self.to_glib_none().0, arg.to_glib_none().0, &mut error, ); @@ -134,47 +133,40 @@ impl KernelArgs { /// Append from a whitespace-separated string. #[cfg(any(feature = "v2019_3", feature = "dox"))] - pub fn parse_append(&mut self, options: &str) { + pub fn parse_append(&self, options: &str) { unsafe { - ffi::ostree_kernel_args_parse_append( - self.to_glib_none_mut().0, - options.to_glib_none().0, - ); + ffi::ostree_kernel_args_parse_append(self.to_glib_none().0, options.to_glib_none().0); } } /// Replace a kernel argument. #[cfg(any(feature = "v2019_3", feature = "dox"))] - pub fn replace(&mut self, arg: &str) { + pub fn replace(&self, arg: &str) { unsafe { - ffi::ostree_kernel_args_replace(self.to_glib_none_mut().0, arg.to_glib_none().0); + ffi::ostree_kernel_args_replace(self.to_glib_none().0, arg.to_glib_none().0); } } /// Replace multiple kernel arguments. #[cfg(any(feature = "v2019_3", feature = "dox"))] - pub fn replace_argv(&mut self, argv: &[&str]) { + pub fn replace_argv(&self, argv: &[&str]) { unsafe { - ffi::ostree_kernel_args_replace_argv(self.to_glib_none_mut().0, argv.to_glib_none().0); + ffi::ostree_kernel_args_replace_argv(self.to_glib_none().0, argv.to_glib_none().0); } } /// A duplicate of `replace`. #[cfg(any(feature = "v2019_3", feature = "dox"))] - pub fn replace_take(&mut self, arg: &str) { + pub fn replace_take(&self, arg: &str) { unsafe { - ffi::ostree_kernel_args_replace_take(self.to_glib_none_mut().0, arg.to_glib_full()); + ffi::ostree_kernel_args_replace_take(self.to_glib_none().0, arg.to_glib_full()); } } /// Convert the kernel arguments to a string. #[cfg(any(feature = "v2019_3", feature = "dox"))] fn to_gstring(&self) -> GString { - unsafe { - from_glib_full(ffi::ostree_kernel_args_to_string( - self.to_glib_none().0 as *mut OstreeKernelArgs, - )) - } + unsafe { from_glib_full(ffi::ostree_kernel_args_to_string(self.to_glib_none().0)) } } /// Convert the kernel arguments to a string array. @@ -182,7 +174,7 @@ impl KernelArgs { pub fn to_strv(&self) -> Vec { unsafe { FromGlibPtrContainer::from_glib_full(ffi::ostree_kernel_args_to_strv( - self.to_glib_none().0 as *mut OstreeKernelArgs, + self.to_glib_none().0, )) } } diff --git a/rust-bindings/src/repo.rs b/rust-bindings/src/repo.rs index 5739953e..548cbc8e 100644 --- a/rust-bindings/src/repo.rs +++ b/rust-bindings/src/repo.rs @@ -1,10 +1,12 @@ #[cfg(any(feature = "v2016_4", feature = "dox"))] use crate::RepoListRefsExtFlags; +#[cfg(any(feature = "v2017_10", feature = "dox"))] use crate::RepoMode; use crate::{Checksum, ObjectDetails, ObjectName, ObjectType, Repo, RepoTransactionStats}; use ffi::OstreeRepoListObjectsFlags; use glib::ffi as glib_sys; use glib::{self, translate::*, Error, IsA}; +#[cfg(any(feature = "v2017_10", feature = "dox"))] use std::os::fd::BorrowedFd; use std::{ collections::{HashMap, HashSet}, diff --git a/rust-bindings/src/tests/kernel_args.rs b/rust-bindings/src/tests/kernel_args.rs index c8f9e625..288b1b6f 100644 --- a/rust-bindings/src/tests/kernel_args.rs +++ b/rust-bindings/src/tests/kernel_args.rs @@ -4,7 +4,7 @@ use crate::KernelArgs; #[test] fn should_create_and_fill_kernel_args() { - let mut args = KernelArgs::new(); + let args = KernelArgs::new(); args.append("key=value"); args.append("arg1"); args.append("key2=value2"); @@ -13,7 +13,7 @@ fn should_create_and_fill_kernel_args() { #[test] fn should_convert_to_string_vec() { - let mut args = KernelArgs::new(); + let args = KernelArgs::new(); args.parse_append("key=value arg1 key2=value2"); assert_eq!( args.to_strv() @@ -26,7 +26,7 @@ fn should_convert_to_string_vec() { #[test] fn should_get_last_value() { - let mut args = KernelArgs::new(); + let args = KernelArgs::new(); args.append("key=value1"); args.append("key=value2"); args.append("key=value3"); @@ -41,14 +41,14 @@ fn should_convert_from_string() { #[test] fn should_append_argv() { - let mut args = KernelArgs::new(); + let args = KernelArgs::new(); args.append_argv(&["arg1", "arg2=value", "arg3", "arg4=value"]); assert_eq!(args.to_string(), "arg1 arg2=value arg3 arg4=value"); } #[test] fn should_append_argv_filtered() { - let mut args = KernelArgs::new(); + let args = KernelArgs::new(); args.append_argv_filtered( &["prefix.arg1", "arg2", "prefix.arg3", "arg4=value"], &["prefix"], @@ -58,7 +58,7 @@ fn should_append_argv_filtered() { #[test] fn should_replace_argv() { - let mut args = KernelArgs::from_string("arg1=value1 arg2=value2 arg3"); + let args = KernelArgs::from_string("arg1=value1 arg2=value2 arg3"); args.replace_argv(&["arg1=value3", "arg3=value4", "arg4"]); assert_eq!(args.to_string(), "arg1=value3 arg2=value2 arg3=value4 arg4"); } diff --git a/rust-bindings/sys/Cargo.toml b/rust-bindings/sys/Cargo.toml index 30384712..ca0ef28d 100644 --- a/rust-bindings/sys/Cargo.toml +++ b/rust-bindings/sys/Cargo.toml @@ -6,15 +6,15 @@ libc = "0.2" [dependencies.gio] package = "gio-sys" -version = "0.16" +version = "0.18" [dependencies.glib] package = "glib-sys" -version = "0.16" +version = "0.18" [dependencies.gobject] package = "gobject-sys" -version = "0.16" +version = "0.18" [dev-dependencies] shell-words = "1.0.0" @@ -56,7 +56,7 @@ v2019_6 = ["v2019_4"] v2020_1 = ["v2019_6"] v2020_2 = ["v2020_1"] v2020_4 = ["v2020_2"] -dox = ["glib/dox", "gobject/dox", "gio/dox"] +dox = [] v2020_7 = ["v2020_4"] v2020_8 = ["v2020_7"] v2021_1 = ["v2020_8"] diff --git a/rust-bindings/sys/src/auto/versions.txt b/rust-bindings/sys/src/auto/versions.txt index 8135982b..abc0dca6 100644 --- a/rust-bindings/sys/src/auto/versions.txt +++ b/rust-bindings/sys/src/auto/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ 0eeebbdf9d4d) -from gir-files (@ 00c41eacd26a) +from gir-files (@ e93ebd738598) diff --git a/rust-bindings/sys/src/lib.rs b/rust-bindings/sys/src/lib.rs index fb0d660d..395b3b60 100644 --- a/rust-bindings/sys/src/lib.rs +++ b/rust-bindings/sys/src/lib.rs @@ -144,7 +144,7 @@ pub const OSTREE_FILEMETA_GVARIANT_STRING: *const c_char = b"(uuua(ayay))\0" as *const u8 as *const c_char; pub const OSTREE_GPG_KEY_GVARIANT_STRING: *const c_char = b"(aa{sv}aa{sv}a{sv})\0" as *const u8 as *const c_char; -pub const OSTREE_MAX_METADATA_SIZE: c_int = 10485760; +pub const OSTREE_MAX_METADATA_SIZE: c_int = 134217728; pub const OSTREE_MAX_METADATA_WARN_SIZE: c_int = 7340032; pub const OSTREE_METADATA_KEY_BOOTABLE: *const c_char = b"ostree.bootable\0" as *const u8 as *const c_char; @@ -417,14 +417,6 @@ pub struct _OstreeKernelArgs { pub type OstreeKernelArgs = *mut _OstreeKernelArgs; -#[repr(C)] -pub struct _OstreeKernelArgsEntry { - _data: [u8; 0], - _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, -} - -pub type OstreeKernelArgsEntry = *mut _OstreeKernelArgsEntry; - #[derive(Copy, Clone)] #[repr(C)] pub struct OstreeMutableTreeClass { @@ -898,6 +890,7 @@ impl ::std::fmt::Debug for OstreeSysrootDeployTreeOpts { #[repr(C)] pub struct OstreeSysrootWriteDeploymentsOpts { pub do_postclean: gboolean, + pub disable_auto_early_prune: gboolean, pub unused_bools: [gboolean; 7], pub unused_ints: [c_int; 7], pub unused_ptrs: [gpointer; 7], @@ -907,6 +900,7 @@ impl ::std::fmt::Debug for OstreeSysrootWriteDeploymentsOpts { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("OstreeSysrootWriteDeploymentsOpts @ {self:p}")) .field("do_postclean", &self.do_postclean) + .field("disable_auto_early_prune", &self.disable_auto_early_prune) .field("unused_bools", &self.unused_bools) .field("unused_ints", &self.unused_ints) .field("unused_ptrs", &self.unused_ptrs) @@ -1865,6 +1859,14 @@ extern "C" { cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> gboolean; + pub fn ostree_repo_commit_add_composefs_metadata( + self_: *mut OstreeRepo, + format_version: c_uint, + dict: *mut glib::GVariantDict, + repo_root: *mut OstreeRepoFile, + cancellable: *mut gio::GCancellable, + error: *mut *mut glib::GError, + ) -> gboolean; pub fn ostree_repo_commit_transaction( self_: *mut OstreeRepo, out_stats: *mut OstreeRepoTransactionStats, diff --git a/rust-bindings/sys/tests/abi.rs b/rust-bindings/sys/tests/abi.rs index bc4c69f0..af510395 100644 --- a/rust-bindings/sys/tests/abi.rs +++ b/rust-bindings/sys/tests/abi.rs @@ -629,7 +629,7 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[ ("(gint) OSTREE_GPG_SIGNATURE_ATTR_USER_NAME", "10"), ("(gint) OSTREE_GPG_SIGNATURE_ATTR_VALID", "0"), ("(guint) OSTREE_GPG_SIGNATURE_FORMAT_DEFAULT", "0"), - ("OSTREE_MAX_METADATA_SIZE", "10485760"), + ("OSTREE_MAX_METADATA_SIZE", "134217728"), ("OSTREE_MAX_METADATA_WARN_SIZE", "7340032"), ("OSTREE_METADATA_KEY_BOOTABLE", "ostree.bootable"), ("OSTREE_METADATA_KEY_LINUX", "ostree.linux"), -- 2.30.2