Linux-KBuild Archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: "Martin Rodriguez Reboredo" <yakoyoku@gmail.com>,
	"Miguel Ojeda" <ojeda@kernel.org>,
	"Alex Gaynor" <alex.gaynor@gmail.com>,
	"Wedson Almeida Filho" <wedsonaf@gmail.com>,
	"Boqun Feng" <boqun.feng@gmail.com>,
	"Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <benno.lossin@proton.me>,
	"Andreas Hindborg" <a.hindborg@samsung.com>,
	"Alice Ryhl" <aliceryhl@google.com>
Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
	 rust-for-linux@vger.kernel.org
Subject: Re: [RFC PATCH v3 0/2] rust: crates in other kernel directories
Date: Fri, 15 Mar 2024 14:44:16 +0100	[thread overview]
Message-ID: <66994d628df70a5ff535908efc16568d3a5a4c80.camel@sipsolutions.net> (raw)
In-Reply-To: <20231104211213.225891-1-yakoyoku@gmail.com>

Hi,

So I realize this is an old patch, but I didn't find another version,
and discussions seemed ongoing at least a month ago. I also came across
it pretty randomly.

Anyway, question:

> If you want to use a crate with your Rust module just add a `rust-libs`
> variable in your Makefile with a value of the relative directory of
> said crate plus its name, e.g.
> 
>     # Link with the foo crate
>     rust-libs += ../path/to/foo

Should this perhaps be relative to the kernel's root dir instead? 

If I'm reading this correctly, then a hypothetical rust wireless driver
that lives in

  drivers/net/wireless/<vendor>/<name>/

using some wireless rust infrastructure would probably end up with
something like

  rust-libs += ../../../../../net/mac80211/rust/

or whatever, which seems rather odd vs.

  rust-libs += net/mac80211/rust/

Seems to me that chances are that subsystems/drivers that have rust
infrastructure will not necessarily have them close to each other, like
in this example?

You have this in the sample too:

+rust-libs					:= ../../drivers/usb/core/usb

but it's less pronounced since it's just samples/rust/ :)

johannes

      parent reply	other threads:[~2024-03-15 14:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-04 21:11 [RFC PATCH v3 0/2] rust: crates in other kernel directories Martin Rodriguez Reboredo
2023-11-04 21:11 ` [RFC PATCH v3 1/2] kbuild: Build Rust crates as libraries Martin Rodriguez Reboredo
2023-11-04 21:11 ` [RFC PATCH v3 2/2] samples: rust: Add USB sample bindings Martin Rodriguez Reboredo
2023-11-05  7:26   ` Greg Kroah-Hartman
2023-11-13 14:13 ` [RFC PATCH v3 0/2] rust: crates in other kernel directories Masahiro Yamada
2024-02-18 16:11   ` Martin Rodriguez Reboredo
2024-02-19  9:05     ` Masahiro Yamada
2024-03-15 13:44 ` Johannes Berg [this message]

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=66994d628df70a5ff535908efc16568d3a5a4c80.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=a.hindborg@samsung.com \
    --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=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=wedsonaf@gmail.com \
    --cc=yakoyoku@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).