From: Kent Overstreet <kent.overstreet@linux.dev>
To: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Cc: TruongSinh Tran-Nguyen <i@truongsinh.pro>,
linux-bcachefs@vger.kernel.org, rust-for-linux@vger.kernel.org
Subject: Re: [PATCH] chore(util): minimal Rust build example
Date: Wed, 10 May 2023 14:44:58 -0400 [thread overview]
Message-ID: <ZFvmKk86vBD051n7@moria.home.lan> (raw)
In-Reply-To: <CANiq72mwHa9coRUQqprGaEhLoac=spX2-2X4CMKYBYrovkQoLA@mail.gmail.com>
On Wed, May 10, 2023 at 07:56:07PM +0200, Miguel Ojeda wrote:
> On Tue, May 9, 2023 at 8:07 PM Kent Overstreet
> <kent.overstreet@linux.dev> wrote:
> >
> > So if I'm following, it looks like everything is basically there. It
> > looks like we can add Rust source files to fs/bcachefs/ and have them
> > built as part of the bcachefs module, and calling back and forth just
> > works as expected - nice.
>
> Indeed, that should work, and it may be useful, though typically you
> will want to avoid crossing the C/Rust boundary all the time, so that
> you can work with Rust types as much as possible.
>
> For modules/drivers, we provide Rust abstractions for the C APIs so
> that one can write drivers in Rust (and thus use Rust facilities and
> avoid `unsafe` as much as possible), rather than mixing C and Rust
> source code in the "leaves". Perhaps there are some parts within
> bcachefs amenable to a similar approach.
I've been doing the same thing.
Right now in bcachefs-tools we've got two different crates, one for
bcachefs rust code proper and another for bindings, with a build.rs for
bindgen.
Any pointers to how we'll be interacting with bindgen kernel side? We
need to pass it some stuff, see
https://evilpiepirate.org/git/bcachefs-tools.git/tree/rust-src/bch_bindgen/build.rs
>
> > The kbuild stuff looks nice and clean - congrats to those responsible :)
>
> Thanks for the kind words, though a rework of how that works is
> planned, so hopefully you will also like the new way too... :)
Can't wait... :)
next prev parent reply other threads:[~2023-05-10 18:45 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20230503065354.19071-1-i@truongsinh.pro>
2023-05-09 17:47 ` [PATCH] chore(util): minimal Rust build example Kent Overstreet
2023-05-09 17:57 ` TruongSinh Tran-Nguyen
2023-05-09 18:12 ` Kent Overstreet
2023-05-09 18:41 ` Wedson Almeida Filho
2023-05-09 20:57 ` TruongSinh Tran-Nguyen
2023-05-10 3:10 ` TruongSinh Tran-Nguyen
2023-05-10 17:59 ` Miguel Ojeda
2023-05-10 18:21 ` TruongSinh Tran-Nguyen
2023-05-11 23:37 ` Miguel Ojeda
2023-05-11 23:54 ` TruongSinh Tran-Nguyen
2023-05-12 0:02 ` Miguel Ojeda
2023-05-12 3:31 ` Kent Overstreet
2023-05-12 4:16 ` TruongSinh Tran-Nguyen
2023-05-12 4:18 ` Kent Overstreet
2023-05-12 4:39 ` TruongSinh Tran-Nguyen
2023-05-12 5:33 ` Kent Overstreet
2023-05-12 14:26 ` TruongSinh Tran-Nguyen
2023-05-10 18:38 ` Kent Overstreet
2023-05-11 23:39 ` Miguel Ojeda
2023-05-11 16:16 ` Björn Roy Baron
2023-05-11 16:46 ` TruongSinh Tran-Nguyen
2023-05-11 17:05 ` Björn Roy Baron
2023-05-11 23:10 ` TruongSinh Tran-Nguyen
2023-05-09 20:52 ` Andreas Hindborg
2023-05-10 17:56 ` Miguel Ojeda
2023-05-10 18:44 ` Kent Overstreet [this message]
2023-05-11 23:37 ` 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=ZFvmKk86vBD051n7@moria.home.lan \
--to=kent.overstreet@linux.dev \
--cc=i@truongsinh.pro \
--cc=linux-bcachefs@vger.kernel.org \
--cc=miguel.ojeda.sandonis@gmail.com \
--cc=rust-for-linux@vger.kernel.org \
/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