public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andreas Hindborg <a.hindborg@kernel.org>
To: "Benno Lossin" <benno.lossin@proton.me>
Cc: "Miguel Ojeda" <ojeda@kernel.org>,
	"Alex Gaynor" <alex.gaynor@gmail.com>,
	"Boqun Feng" <boqun.feng@gmail.com>,
	"Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Danilo Krummrich" <dakr@kernel.org>,
	"Masahiro Yamada" <masahiroy@kernel.org>,
	"Nathan Chancellor" <nathan@kernel.org>,
	"Nicolas Schier" <nicolas@fjasle.eu>,
	linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org,
	linux-kbuild@vger.kernel.org
Subject: Re: [PATCH 14/22] rust: add pin-init crate build infrastructure
Date: Wed, 05 Mar 2025 13:31:25 +0100	[thread overview]
Message-ID: <87ldtjbqw2.fsf@kernel.org> (raw)
In-Reply-To: <D88BLHENDH8Y.HQUKEXN1XB7C@proton.me> (Benno Lossin's message of "Wed, 05 Mar 2025 12:10:20 +0000")

"Benno Lossin" <benno.lossin@proton.me> writes:

> On Wed Mar 5, 2025 at 12:59 PM CET, Andreas Hindborg wrote:
>> "Benno Lossin" <benno.lossin@proton.me> writes:
>>
>>> From: Miguel Ojeda <ojeda@kernel.org>
>>>
>>> Add infrastructure for moving the initialization API to its own crate.
>>> Covers all make targets such as `rust-analyzer` and `rustdoc`. The tests
>>> of pin-init are not added to `rusttest`, as they are already tested in
>>> the user-space repository [1].
>>
>> If it's not too much hassle, why not add them in the kernel as well? I
>> would rather not have to go fetch the user space repo from github, in
>> the event that I ever need to patch pin-init.
>
> I tried to add them, but encountered a lot of problems. Maybe the new
> build system can help with that. But if you insist, I can try to get
> them to work again in a different series now.
>
> The tests run every day in the GitHub CI and any changes that go through
> the pin-init-next tree will also be tested there before I submit any
> PRs.

I _really_ think that the ability to run the tests should be present in
the kernel repository. But I also do not want to block this series on it,
if it is something that will be easier to achieve with the build system
overhaul that is in the pipeline.

>
>>> Link: https://github.com/Rust-for-Linux/pin-init [1]
>>> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
>>> Co-developed-by: Benno Lossin <benno.lossin@proton.me>
>>> Signed-off-by: Benno Lossin <benno.lossin@proton.me>
>>> ---
>>>  rust/Makefile                      | 75 +++++++++++++++++++++++-------
>>>  rust/pin-init/internal/src/_lib.rs |  3 ++
>>>  rust/pin-init/internal/src/lib.rs  |  4 ++
>>>  rust/pin-init/src/_lib.rs          |  5 ++
>>>  scripts/Makefile.build             |  2 +-
>>>  scripts/generate_rust_analyzer.py  | 17 ++++++-
>>>  6 files changed, 86 insertions(+), 20 deletions(-)
>>>  create mode 100644 rust/pin-init/internal/src/_lib.rs
>>>  create mode 100644 rust/pin-init/src/_lib.rs
>>>
>>> diff --git a/rust/Makefile b/rust/Makefile
>>> index ea3849eb78f6..90310f0620eb 100644
>>> --- a/rust/Makefile
>>> +++ b/rust/Makefile
>>
>> [...]
>>
>>> @@ -110,11 +113,24 @@ rustdoc-compiler_builtins: $(src)/compiler_builtins.rs rustdoc-core FORCE
>>>  rustdoc-ffi: $(src)/ffi.rs rustdoc-core FORCE
>>>  	+$(call if_changed,rustdoc)
>>>
>>> -rustdoc-kernel: private rustc_target_flags = --extern ffi \
>>> +rustdoc-pin_init_internal: private rustdoc_host = yes
>>> +rustdoc-pin_init_internal: private rustc_target_flags = --cfg kernel \
>>> +    --extern proc_macro --crate-type proc-macro
>>> +rustdoc-pin_init_internal: $(src)/pin-init/internal/src/_lib.rs FORCE
>>> +	+$(call if_changed,rustdoc)
>>> +
>>> +rustdoc-pin_init: private rustdoc_host = yes
>>> +rustdoc-pin_init: private rustc_target_flags = --extern pin_init_internal \
>>> +    --extern macros --extern alloc --cfg kernel --cfg feature=\"alloc\"
>>> +rustdoc-pin_init: $(src)/pin-init/src/_lib.rs rustdoc-pin_init_internal \
>>> +    rustdoc-macros FORCE
>>> +	+$(call if_changed,rustdoc)
>>
>> Is it possible to do some code sharing here, such that when we add a
>> crate, it's just a matter of putting the path/name on a list somewhere?
>
> Miguel informed me that this Makefile won't exist in the new build
> system, so I'd rather not do that.

OK, cool.


Best regards,
Andreas Hindborg




  reply	other threads:[~2025-03-05 12:34 UTC|newest]

Thread overview: 97+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20250304225245.2033120-1-benno.lossin@proton.me>
2025-03-04 22:53 ` [PATCH 01/22] rust: init: disable doctests Benno Lossin
2025-03-05  8:51   ` Andreas Hindborg
2025-03-05 12:53     ` Benno Lossin
2025-03-05 13:00       ` Miguel Ojeda
2025-03-05 14:09       ` Andreas Hindborg
2025-03-05 14:31         ` Benno Lossin
2025-03-05  9:17   ` Fiona Behrens
2025-03-04 22:53 ` [PATCH 02/22] rust: move pin-init API into its own directory Benno Lossin
2025-03-05  9:03   ` Andreas Hindborg
2025-03-05  9:17   ` Fiona Behrens
2025-03-04 22:53 ` [PATCH 03/22] rust: add extensions to the pin-init crate and move relevant documentation there Benno Lossin
2025-03-05  9:11   ` Andreas Hindborg
2025-03-05 11:03     ` Benno Lossin
2025-03-05  9:17   ` Fiona Behrens
2025-03-04 22:53 ` [PATCH 04/22] rust: pin-init: move proc-macro documentation into pin-init crate Benno Lossin
2025-03-05  9:18   ` Fiona Behrens
2025-03-05  9:34   ` Andreas Hindborg
2025-03-05 11:05     ` Benno Lossin
2025-03-04 22:53 ` [PATCH 05/22] rust: pin-init: change examples to the user-space version Benno Lossin
2025-03-05  9:19   ` Fiona Behrens
2025-03-05 10:06   ` Andreas Hindborg
2025-03-04 22:53 ` [PATCH 06/22] rust: pin-init: call `try_[pin_]init!` from `[pin_]init!` instead of `__init_internal!` Benno Lossin
2025-03-05  9:19   ` Fiona Behrens
2025-03-05 10:12   ` Andreas Hindborg
2025-03-04 22:54 ` [PATCH 07/22] rust: pin-init: move the default error behavior of `try_[pin_]init` Benno Lossin
2025-03-05  9:21   ` Fiona Behrens
2025-03-05 10:29   ` Andreas Hindborg
2025-03-05 10:47     ` Benno Lossin
2025-03-04 22:54 ` [PATCH 08/22] rust: pin-init: move `InPlaceInit` and impls of `InPlaceWrite` into the kernel crate Benno Lossin
2025-03-05  9:23   ` Fiona Behrens
2025-03-05 11:18   ` Andreas Hindborg
2025-03-05 12:06     ` Benno Lossin
2025-03-05 12:28       ` Andreas Hindborg
2025-03-05 12:37         ` Benno Lossin
2025-03-04 22:54 ` [PATCH 09/22] rust: pin-init: move impl `Zeroable` for `Opaque` and `Option<KBox<T>>` " Benno Lossin
2025-03-05  9:24   ` Fiona Behrens
2025-03-05 11:26   ` Andreas Hindborg
2025-03-05 12:05     ` Benno Lossin
2025-03-05 12:11       ` Alice Ryhl
2025-03-05 12:17         ` Benno Lossin
2025-03-05 12:49           ` Alice Ryhl
2025-03-05 12:51             ` Benno Lossin
2025-03-04 22:54 ` [PATCH 10/22] rust: add `ZeroableOption` and implement it instead of `Zeroable` for `Option<Box<T, A>>` Benno Lossin
2025-03-05  9:25   ` Fiona Behrens
2025-03-05 11:30   ` Andreas Hindborg
2025-03-04 22:54 ` [PATCH 11/22] rust: pin-init: fix documentation links Benno Lossin
2025-03-05  9:26   ` Fiona Behrens
2025-03-05 11:37   ` Andreas Hindborg
2025-03-05 11:49     ` Benno Lossin
2025-03-04 22:54 ` [PATCH 12/22] rust: pin-init: remove kernel-crate dependency Benno Lossin
2025-03-05  9:27   ` Fiona Behrens
2025-03-05 11:49   ` Andreas Hindborg
2025-03-05 12:00     ` Benno Lossin
2025-03-05 12:27       ` Andreas Hindborg
2025-03-04 22:55 ` [PATCH 13/22] rust: pin-init: change the way the `paste!` macro is called Benno Lossin
2025-03-05  9:28   ` Fiona Behrens
2025-03-05 11:52   ` Andreas Hindborg
2025-03-04 22:55 ` [PATCH 14/22] rust: add pin-init crate build infrastructure Benno Lossin
2025-03-05 11:59   ` Andreas Hindborg
2025-03-05 12:10     ` Benno Lossin
2025-03-05 12:31       ` Andreas Hindborg [this message]
2025-03-05 12:50         ` Miguel Ojeda
2025-03-05 13:00           ` Benno Lossin
2025-03-05 14:19           ` Andreas Hindborg
2025-03-05 14:34             ` Benno Lossin
2025-03-05 12:47     ` Miguel Ojeda
2025-03-04 22:55 ` [PATCH 15/22] rust: make pin-init its own crate Benno Lossin
2025-03-05  9:29   ` Fiona Behrens
2025-03-05 12:12   ` Andreas Hindborg
2025-03-05 13:40     ` Benno Lossin
2025-03-05 14:20       ` Andreas Hindborg
2025-03-04 22:55 ` [PATCH 16/22] rust: pin-init: add `std` and `alloc` support from the user-space version Benno Lossin
2025-03-05  9:32   ` Fiona Behrens
2025-03-05 12:22   ` Andreas Hindborg
2025-03-05 13:55     ` Benno Lossin
2025-03-05 14:29       ` Andreas Hindborg
2025-03-05 15:05         ` Benno Lossin
2025-03-05 17:27           ` Andreas Hindborg
2025-03-04 22:55 ` [PATCH 17/22] rust: pin-init: synchronize documentation with " Benno Lossin
2025-03-05  9:33   ` Fiona Behrens
2025-03-05 12:52   ` Andreas Hindborg
2025-03-04 22:55 ` [PATCH 18/22] rust: pin-init: internal: synchronize with " Benno Lossin
2025-03-05 12:56   ` Andreas Hindborg
2025-03-04 22:56 ` [PATCH 19/22] rust: pin-init: miscellaneous synchronization with the " Benno Lossin
2025-03-05 12:57   ` Andreas Hindborg
2025-03-04 22:56 ` [PATCH 20/22] rust: pin-init: add miscellaneous files from " Benno Lossin
2025-03-05  9:35   ` Fiona Behrens
2025-03-05 13:04   ` Andreas Hindborg
2025-03-05 13:37     ` Miguel Ojeda
2025-03-05 13:58       ` Benno Lossin
2025-03-04 22:56 ` [PATCH 21/22] rust: pin-init: re-enable doctests Benno Lossin
2025-03-05  9:35   ` Fiona Behrens
2025-03-05 13:05   ` Andreas Hindborg
2025-03-04 22:56 ` [PATCH 22/22] MAINTAINERS: add entry for the `pin-init` crate Benno Lossin
2025-03-05  0:17   ` Jarkko Sakkinen
2025-03-05  0:43     ` Benno Lossin
2025-03-05  5:14       ` Jarkko Sakkinen

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=87ldtjbqw2.fsf@kernel.org \
    --to=a.hindborg@kernel.org \
    --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=dakr@kernel.org \
    --cc=gary@garyguo.net \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=nathan@kernel.org \
    --cc=nicolas@fjasle.eu \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tmgross@umich.edu \
    /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