Closed BrainBlasted closed 5 years ago
This is the function that's failing to generate:
guint
dzl_preferences_add_table_row (DzlPreferences *self,
const gchar *page_name,
const gchar *group_name,
GtkWidget *first_widget,
...)
{
va_list args;
gint ret;
g_return_val_if_fail (DZL_IS_PREFERENCES (self), 0);
g_return_val_if_fail (page_name != NULL, 0);
g_return_val_if_fail (group_name != NULL, 0);
g_return_val_if_fail (GTK_IS_WIDGET (first_widget), 0);
va_start (args, first_widget);
ret = DZL_PREFERENCES_GET_IFACE (self)->add_table_row_va (self, page_name, group_name, first_widget, args);
va_end (args);
return ret;
}
Here's the header file and .c file
This looks like a bug in gir, or the .gir file is broken. Can you attach the .gir file or paste the relevant part (the struct definition of DzlPreferencesInterface
) here?
There's no reason for creating a truncated version of the struct here. It's all pointers, and varargs C functions can be properly expressed in Rust too (you can even call them, just not yet define new ones).
CC @EPashkin Or maybe you already have an idea about this one?
@sdroege, @BrainBlasted Sorry, it sure bug in gir: generating derive(Copy,Clone)
for incomplete type, but I don't have time to look at this.
Code seems generated in https://github.com/gtk-rs/gir/blob/32d1716ebbb2fcf41000207e246961684aa7d0b8/src/codegen/sys/fields.rs#L38
seems something wrong in implementation of analysis::types::IsIncomplete::is_incomplete
,
not sure what
Here's a paste of PreferencesInterface: https://paste.gnome.org/py9qn4ytt
Can you add Gir.toml for sys too? Or just link your repo.
[options]
work_mode = "sys"
library = "Dazzle"
version = "1.0"
min_cfg_version = "1.0"
external_libraries = [
"Cairo",
"Pango",
"GLib",
"GObject",
"Gio",
"Gtk",
"Gdk",
]
@BrainBlasted You pasted only part of .gir file, it interface, but error IMHO in struct PreferencesInterface
.
Can you just create repo with your generating attempt?
I propose use same layout as https://gitlab.freedesktop.org/slomo/gstreamer-rs/tree/master folder "gir-files" in copied to repo, dazzle.gir added to it,
to Gir.toml also added
target_path = "."
girs_dir = "gir-files"
to remove need in gir.exe parameters
Sure. I was trying to avoid pushing until I had a working build.
Note, that it different error from https://github.com/gtk-rs/gir/issues/534,
by _truncated_record_marker
you have incomplete type due va_list function,
in #534 just "wrong" type in .gir file.
Note, that it different error from https://github.com/gtk-rs/gir/issues/534,
by _truncated_record_marker
you have incomplete type due va_list function,
in #534 just "wrong" type in .gir file.
@BrainBlasted Gir PR merged. gir-files better be not submodule, but just directory, so you can add Dazzle-1.0.gir to it, this fix removes need for parameters in command line
+++ b/libdazzle-sys/gir-libdazzle.toml
min_cfg_version = "1.0"
+target_path = "."
+girs_dir = "../gir-files"
external_libraries = [
How can I use the fix with current code? Will I need to wait until the next release of the gtk-rs series?
Gir not packaged so you can just get last master.
Using current master causes even more build failures: https://gist.github.com/BrainBlasted/fb21d76d3278a3bbc886f1988a27b5e5
Oh, seems you need use git version for gtk too or really wait for next release.
Or override only gtk-sys with https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#overriding-dependencies
Similar to #534, I'm running into structs that
#[derive(Copy)]
but are un-copyable, this time because of a generated_trucated_record_marker
, causing the build to fail.Log:
Struct: