public inbox for patches@lists.linux.dev
 help / color / mirror / Atom feed
From: Andreas Hindborg <nmi@metaspace.dk>
To: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Cc: Greg KH <gregkh@linuxfoundation.org>,
	Alice Ryhl <aliceryhl@google.com>,
	gary@garyguo.net, alex.gaynor@gmail.com, benno.lossin@proton.me,
	bjorn3_gh@protonmail.com, boqun.feng@gmail.com,
	linux-kernel@vger.kernel.org, ojeda@kernel.org,
	patches@lists.linux.dev, rust-for-linux@vger.kernel.org,
	wedsonaf@gmail.com
Subject: Re: [PATCH v2] rust: error: add missing error codes
Date: Mon, 15 May 2023 20:07:12 +0200	[thread overview]
Message-ID: <875y8teab3.fsf@metaspace.dk> (raw)
In-Reply-To: <CANiq72=g=CnEQTkc50qozUdOBZECr7Jr2NCRfGFaKh751i6Sww@mail.gmail.com>


Miguel Ojeda <miguel.ojeda.sandonis@gmail.com> writes:

> On Tue, May 9, 2023 at 10:46 AM Greg KH <gregkh@linuxfoundation.org> wrote:
>>
>> It depends on which arch you are building for.  That's why we have
>> per-platform errno.h files, the values are different for different ones.
>> So you need to handle them all properly somehow.  How is rust going to
>> handle per-arch stuff like this?
>
> We can do conditional compilation in the same file, possibly with a
> Rust macro which takes a nice table that shows all arches at once.
>
> We can also split into files like C and move it to each `arch/`, there
> are a couple of approaches for this. This is best for `MAINTAINERS`,
> although these headers almost never change, so it is not a big
> advantage.
>
> We could also automatically do everything based on the C headers, too.
> Back then it felt to me like too much complexity for little gain,
> given those C headers almost never change, but now it may be worth it.
> Or, instead, having a test that verifies they are the same instead,
> and that way we don't introduce complexity for the build itself.
>
> Alice only needs `ERESTARTSYS` so far, as far as I understand, so
> perhaps it is simplest to only add the rest of the non-generic ones
> for the moment; and gather opinions on the approaches above meanwhile.

Let's add the ones we need for now. When we need target specific error
codes we can have a `mod` for each arch, gate behind the target
feature and conditionally reexport them.

BR Andreas


  reply	other threads:[~2023-05-15 18:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-04  6:48 [PATCH v2] rust: error: add missing error codes Alice Ryhl
2023-05-04 12:40 ` Martin Rodriguez Reboredo
2023-05-08 11:47 ` Gary Guo
2023-05-09  8:07   ` Alice Ryhl
2023-05-09  8:46     ` Greg KH
2023-05-09 11:10       ` Miguel Ojeda
2023-05-15 18:07         ` Andreas Hindborg [this message]
2023-05-31 17:11 ` Miguel Ojeda

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=875y8teab3.fsf@metaspace.dk \
    --to=nmi@metaspace.dk \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=benno.lossin@proton.me \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=gary@garyguo.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miguel.ojeda.sandonis@gmail.com \
    --cc=ojeda@kernel.org \
    --cc=patches@lists.linux.dev \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=wedsonaf@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