What’s new with the latest batch of crates and the reason for some incompatible changes? More automation.
No more features
You don’t have to set the target library versions in your
The build script will query the installed library versions from
cfg arguments to compile the appropriate set of APIs.
All the APIs available in the installed library will just work but if you attempt to use newer ones, the build will fail. Presently, Rust doesn’t allow to generate custom error messages so there doesn’t appear to be a way to make such errors more friendly.
Note that a cargo issue will prevent
cargo doc from generating the
documentation or at least cause it to be incomplete.
default-features directives relating to Gtk-rs
crates from your
Introducing autogenerated sys crates
From now on, the FFI definitions crates (except
cairo-sys) don’t have to
be maintained manually. They’re being generated from GObject introspection
metadata. Take a look at the sys repo if you’re interested in details.
This fixes incorrectly transcribed definitions and should avoid such human
mistakes in the future.
The impact is converting many
bitflags they should have been
from the beginning and some spelling changes.
- Notable enum variants and consts that have effectively been renamed:
WindowType::Toplevel(changed the capitalization of ‘level’),
DIALOG_MODAL(a constant instead of an enum variant),
IconSizehas to be cast to
i32until it’s replaced with a proper enum.
These regular expressions should take care of renaming:
s/WindowType::TopLevel/WindowType::Toplevel/ s/DialogFlags::Modal/DIALOG_MODAL/ s/(IconSize::\w+)/$1 as i32/