gtk-rs / gir

Tool to generate rust bindings and user API for glib-based libraries
https://gtk-rs.org/gir/book/
MIT License
225 stars 98 forks source link

Add `edition = "2018"` to the Cargo.toml #1039

Open hfiguiere opened 3 years ago

hfiguiere commented 3 years ago

When updating the crate, either -sys or not, with gir, gir should make sure edition = "2018" is in the Cargo.toml, otherwise the crate won't build.

sdroege commented 3 years ago

Good idea, do you want to make a PR?

gir is only touching the -sys Cargo.toml though, never the non-sys one. So that would require some new code.

hfiguiere commented 3 years ago

I'll see what I can do. Indeed the non-sys Cargo isn't changed.

gabbyprecious commented 2 years ago

@bilelmoussaoui would love to also take on this

bilelmoussaoui commented 2 years ago

It should actually use edition=2022 nowadays.

bilelmoussaoui commented 2 years ago

is this issue is still relevent then?

Yes it is. Currently the generated Cargo.toml doesn't contain any edition specified.

bilelmoussaoui commented 2 years ago

That is for the gir project, not for the projects generated with gir itself which is what this issue is about

bilelmoussaoui commented 2 years ago

Please have a look at how to generate the bindings using gir first. E.g https://gtk-rs.org/gir/book/tutorial/sys_library.html

hfiguiere commented 2 years ago

It should actually use edition=2022 nowadays.

There is a 2022 edition? I know that Debian Bullseye still doesn't recognize 2021 with the distro provided rust toolchain...

bilelmoussaoui commented 2 years ago

Oh sorry, it is 2021.

sdroege commented 2 years ago

I know that Debian Bullseye still doesn't recognize 2021 with the distro provided rust toolchain...

Also distro versions of the toolchain are meant to build distro packages, not for development/etc purposes. Same as for many other languages that move faster than a new version every decade or so.

Semeyian commented 1 year ago

Hello @bilelmoussaoui, I am Mercy Semeyian from the Outreachy program. I've been going through the tutorial you provided above on how to generate Rust bindings using Gir. The gir-files directory doesn't contain a GtkSource-3.0.gir file for the sourceview crate. Could it have been replaced with Git-3.0.gir, or is it just missing entirely? If so, how should I proceed to create the Gir.toml library option and build? Thank you. :)

A6GibKm commented 1 month ago

Is this resolved? See e.g. https://github.com/gtk-rs/gtk4-rs/commit/7602a3b7ffccaaf9cccdce7719cb1e2c67d67feb and https://github.com/gtk-rs/gir/commit/364678bf8674d8bdda02fde783f639abd000d245.

bilelmoussaoui commented 1 month ago

I think using workspaces is better, yes.