From: "Erik Schilling" <erik.schilling@linaro.org>
To: "Kent Gibson" <warthog618@gmail.com>,
"Viresh Kumar" <viresh.kumar@linaro.org>
Cc: <linux-gpio@vger.kernel.org>, "Bartosz Golaszewski" <brgl@bgdev.pl>
Subject: Re: [libgpiod][bug] building rust bindings requires clang headers
Date: Mon, 12 Jun 2023 07:26:35 +0200 [thread overview]
Message-ID: <CTAF85GP5JIH.308KO3L1T9153@fedora> (raw)
In-Reply-To: <ZIQJquwzNacp1Nuh@sol>
> On a relate note, how do you run clippy now?
>
> When I tried `cargo clippy` I got an error about pkg-config not finding
> libgpiod. Fixed that by pointing PKG_CONFIG_PATH at my local libgpiod
> build.
>
> But now I get:
>
> --- stderr
> wrapper.h:1:10: fatal error: 'gpiod.h' file not found
> thread 'main' panicked at 'Unable to generate bindings: ClangDiagnostic("wrapper.h:1:10: fatal error: 'gpiod.h' file not found\n")', libgpiod-sys/build.rs:44:10
>
>
> so I guess bindgen/clang needs to be pointed at the include directory,
> but not sure how to do that without emulating whatever `make` is doing.
>
> Same goes for `cargo build`, come think of it - now you have to build
> using `make`.
>
> How are you supposed to tell if your code is sub-par without clippy to
> tell you? Or, more generally, how does the development process for the
> rust bindings work now?
Setting PKG_CONFIG_PATH will only work if you point it at the install
folder of libgpiod. If you do not want to install, you will need to set
something like this (taken from the Makefile):
SYSTEM_DEPS_LIBGPIOD_NO_PKG_CONFIG=1 \
SYSTEM_DEPS_LIBGPIOD_SEARCH_NATIVE="${PWD}/../../../lib/.libs/" \
SYSTEM_DEPS_LIBGPIOD_LIB=gpiod \
SYSTEM_DEPS_LIBGPIOD_INCLUDE="${PWD}/../../../include/" \
cargo clippy
See https://lore.kernel.org/r/20230522-crates-io-v2-2-d8de75e7f584@linaro.org/
on why it had to become a little bit ugly for rust bindings hackers.
Maybe we should put that example back to the README.md (or into the top-
level README?)
- Erik
next prev parent reply other threads:[~2023-06-12 5:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-09 2:37 [libgpiod][bug] building rust bindings requires clang headers Kent Gibson
2023-06-09 6:18 ` Viresh Kumar
2023-06-09 6:21 ` Kent Gibson
2023-06-09 6:24 ` Viresh Kumar
2023-06-10 5:27 ` Kent Gibson
2023-06-12 5:26 ` Erik Schilling [this message]
2023-06-12 7:32 ` Kent Gibson
2023-06-12 11:16 ` Erik Schilling
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CTAF85GP5JIH.308KO3L1T9153@fedora \
--to=erik.schilling@linaro.org \
--cc=brgl@bgdev.pl \
--cc=linux-gpio@vger.kernel.org \
--cc=viresh.kumar@linaro.org \
--cc=warthog618@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox