+ Miguel/Bjorn. On 05-12-22, 19:55, Bartosz Golaszewski wrote: > On Mon, Dec 5, 2022 at 2:22 PM Andrew Jeffery <andrew@xxxxxxxx> wrote: > > > > Hello, > > > > Based on a recent poke [1] and in-between meetings I've put together a > > WIP series that converts libgpiod's build from autotools to meson. As > > far as I'm aware the meson build supports all the significant options to > > enable or disable features exposed by the autotools build: > > > > * Tests > > * Tools > > * Interactive gpioset > > * Bindings > > * C++ > > * Python > > * Rust > > * Documentation > > * Manpages > > * Doxygen > > > > [1] https://lore.kernel.org/all/CAMRc=Mda8UnyH+_GxeX_4MyKd+DPN0BVH5K+J+VWnMJNC1vwTQ@xxxxxxxxxxxxxx/ > > > > Meson has pretty good support for handling python and so the patch does > > away with setup.py entirely. > > Eek! No, please do keep setup.py. Autotools too is capable of building > python C extensions on its own and it's what we use in v1 but I want > the python code to be built the standard python way. I actually plan > to post libgpiod v2 on pypi and split out building python bindings > into a separate bitbake recipe in meta-openembedded using the > setuptools3 class. > > So let's keep setup.py and just call it from meson. > > > However, the rust case isn't quite so > > simple. In order to handle the dependencies of the rust bindings I've > > called out to cargo through a custom target. It's not great, but from > > what I could see it seems to be the path of least resistance given > > meson's support for rust. > > > > There's no support for installing the rust bindings through meson, but > > this is not worse than the support we appeared to have under autotools. > > > > I think Viresh too wants to keep cargo as the building agent for the rust code. I am not the best guy to ask around Rust tooling in general and probably Kent / Miguel can help here. Sorry for the stupid question, but what does "installing the rust bindings" mean here ? FWIW, for me the only thing that matters is that we are able to build the rust bindings, along with Make, and run tests somehow to make sure nothing broke. Since this is a library crate, the user crate will mark its dependency and do the build itself too. > > It's worth noting that you'll probably want to disable the rust bindings > > if you need to run the install phase for libgpiod under e.g. sudo but > > have used rustup to install cargo for your unpriviledged user. > > > > Current autotools setup doesn't install rust bindings at all, can we > keep it this way? > > > Also, if you've used rustup to install the rust toolchain you may also > > need to install clang in order to pick up C toolchain headers for > > consumption by bindgen. Yeah, from what I remember, we do need clang support for bindgen. > > Anyway, feedback on the rust part is definitely appreciated. Maybe > > there's a better approach? -- viresh