lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CANiq72=ZKGXpsmvKHGsX9=tr9Tbdkd-7baJ-RN4crBdXkcB6Yw@mail.gmail.com>
Date: Fri, 19 Dec 2025 11:04:23 +0100
From: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
To: David Gow <davidgow@...gle.com>
Cc: Brendan Higgins <brendan.higgins@...ux.dev>, Rae Moar <raemoar63@...il.com>, 
	Gary Guo <gary@...yguo.net>, Miguel Ojeda <ojeda@...nel.org>, 
	Shuah Khan <skhan@...uxfoundation.org>, Guillaume Gomez <guillaume1.gomez@...il.com>, 
	linux-kselftest@...r.kernel.org, kunit-dev@...glegroups.com, 
	rust-for-linux@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH] rust: doctests: Number tests by line numerically, not lexicographically.

On Fri, Dec 19, 2025 at 10:25 AM David Gow <davidgow@...gle.com> wrote:
>
> 1. Is it worth renumbering all of the tests (hopefully just once), or
> would that break too many people's test histories?

Personally I don't have such histories just yet (and anyway the tests
generally work), and even if someone does, it may be best to pay the
price sooner rather than later.

> 2. Is there a better way of doing this in Rust? I can think of ways
> which might be nicer if the whole thing is refactored somewhat
> seriously, but if there's an easy numeric sort on strings, that'd be
> much easier.

We do essentially the same in the main loop (which is where I suppose
you picked it up), so it isn't too bad:

        // The `name` follows the `{file}_{line}_{number}` pattern
(see description in
        // `scripts/rustdoc_test_builder.rs`). Discard the `number`.
        let name = path.file_name().unwrap().to_str().unwrap().to_string();

        // Extract the `file` and the `line`, discarding the `number`.
        let (file, line) =
name.rsplit_once('_').unwrap().0.rsplit_once('_').unwrap();

However, we could perhaps save the information so that the main loop
is cleaner instead of redoing it.

Having said that, given we are migrating anyway, this patch may be
simpler to avoid reworking this code. So I am happy either way.

> 3. Should we wait until after all or some of the changes to the test
> generation? Does the new --output-format=doctest option make this
> easier/harder/different?

We could do it there -- it would be easier in the sense that we have
the proper data already with the proper types etc.

On the other hand, it may be best to define the order we want to
follow (independently of the approaches), and then the migration would
be a smaller change conceptually, i.e. one less thing to decide then.

(I have to send the version to finally integrate the migration soon,
by the way -- I would like to put it in this cycle if possible).

Thanks!

Cheers,
Miguel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ