From: "Erik Schilling" <erik.schilling@linaro.org>
To: "Kent Gibson" <warthog618@gmail.com>
Cc: "Linux-GPIO" <linux-gpio@vger.kernel.org>,
"Viresh Kumar" <viresh.kumar@linaro.org>
Subject: Re: [PATCH libgpiod 4/4] bindings: rust: clippy: silence false-positive on iterator
Date: Fri, 30 Jun 2023 12:05:28 +0200 [thread overview]
Message-ID: <CTPWFHFJNFFA.2SGA858S5QIJ5@fedora> (raw)
In-Reply-To: <ZJ6bd8+oDbyX06rp@sol>
On Fri Jun 30, 2023 at 11:08 AM CEST, Kent Gibson wrote:
>
> For future reference, the subject line should be "[libgpiod][PATCH...",
> as per the README.
> Makes it easier to filter visually, if nothing else.
I am using b4 to send the patches (otherwise I would screw up this stuff
even more) which always merges the prefixes together. Raised the point
there:
https://lore.kernel.org/r/CTPW75Q2ISUN.251ELTNP6RB22@fedora
> On Thu, Jun 29, 2023 at 01:09:02PM +0200, Erik Schilling wrote:
> > This was fixed, but it is not in stable yet.
>
> This is not a good checkin comment.
> State what the problem is and how the patch addresses it.
Will rephrase it in next version.
> Same applies to other patches in the series - but I have other comments
> on this one, so raising it here.
>
> > Tested build on x86_64, armv7hf, aarch64.
>
> When you say "Tested build", do you mean just compile/clippy, or have you
> actually run tests?
This is a bit complex... Originally I intended to send this along some
shunit2 script that checks build tests and clippy lints. But that became
a bit more involving than I hoped... By defauly we link gpiosim into the
tests statically and the static lib is not built with PIC by default.
Rust, however, by default wants to build the tests with PIE. For some
reason that works on Debian, but not on Fedora. It also broke down on
Debian on armv7hf. So I was not able to come up with a configuration
set that worked perfectly in all situations (apart from building the
C lib with PIC) and decided not to send scripts to automate the check
(for now).
After wasting way too much time on this, I then realized that I was
missing the GPIO_SIM module and skipped the tests for armv7hf since I
dropped the check script from this series anyway.
TLDR: I tested build AND cargo test on x86_64 and aarch64, but only the
build with armv7hf (I built test and examples though).
> Either way, not sure if this should go in the checkin comment - it is
> generally implied by the Signed-off that you've tested it to your
> satisfaction.
> No problem with a more detailed description of how you've tested in
> the cover letter.
Right... Since I dropped my script idea how now I can move this to the
cover, will expand what I tested in v2.
> > diff --git a/bindings/rust/libgpiod/src/event_buffer.rs b/bindings/rust/libgpiod/src/event_buffer.rs
> > index b79e9ea..2e4bfd3 100644
> > --- a/bindings/rust/libgpiod/src/event_buffer.rs
> > +++ b/bindings/rust/libgpiod/src/event_buffer.rs
> > @@ -54,6 +54,9 @@ impl<'a> Iterator for Events<'a> {
> > }
> >
> > fn next(&mut self) -> Option<Self::Item> {
> > + // clippy false-positive, fixed in next clippy release:
> > + // https://github.com/rust-lang/rust-clippy/issues/9820
> > + #[allow(clippy::iter_nth_zero)]
> > self.nth(0)
> > }
> > }
> >
>
> Specify the release in absolute terms, not "next clippy release".
I cannot tell the version of the next release that will include it since
it is not released yet, but I can state the clippy version that caused
the error.
> Other than those nits, I'm good with the actual changes in the series
> (checked with clippy and running tests on a variety of 32 and 64bit
> platforms and compiler versions back to 1.60)
Thanks for testing!
> (I am seeing this one test failure on arm32, but that doesn't seem to be related
> to this patch:
> ---- request_config::verify::default stdout ----
> thread 'main' panicked at 'assertion failed: `(left == right)`
> left: `OperationFailed(RequestConfigGetConsumer, Errno { code: 2, description: Some("No such file or directory") })`,
> right: `OperationFailed(RequestConfigGetConsumer, Errno { code: 0, description: Some("Success") })`', libgpiod/tests/request_config.rs:18:13
> note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
>
> Not sure if that is a genuine bug or something funky in my build.)
Is the GPIO_SIM module loaded? Did you test with a custom kernel or
some distro that ships with it?
- Erik
next prev parent reply other threads:[~2023-06-30 10:05 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-29 11:08 [PATCH libgpiod 0/4] bindings: rust: clippy: fixed warnings Erik Schilling
2023-06-29 11:08 ` [PATCH libgpiod 1/4] bindings: rust: clippy: drop unnecessary casts Erik Schilling
2023-06-29 11:09 ` [PATCH libgpiod 2/4] bindings: rust: clippy: silence false-positives on casts Erik Schilling
2023-06-29 11:09 ` [PATCH libgpiod 3/4] bindings: rust: clippy: drop unneeded conversions Erik Schilling
2023-06-29 11:09 ` [PATCH libgpiod 4/4] bindings: rust: clippy: silence false-positive on iterator Erik Schilling
2023-06-30 9:08 ` Kent Gibson
2023-06-30 10:05 ` Erik Schilling [this message]
2023-06-30 10:19 ` Kent Gibson
2023-06-30 10:46 ` Erik Schilling
2023-06-30 10:50 ` Kent Gibson
2023-06-30 10:53 ` Erik Schilling
2023-07-01 13:10 ` Kent Gibson
2023-06-30 6:08 ` [PATCH libgpiod 0/4] bindings: rust: clippy: fixed warnings Viresh Kumar
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=CTPWFHFJNFFA.2SGA858S5QIJ5@fedora \
--to=erik.schilling@linaro.org \
--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