From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-10628.protonmail.ch (mail-10628.protonmail.ch [79.135.106.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 58D84219306 for ; Wed, 5 Mar 2025 12:10:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=79.135.106.28 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741176631; cv=none; b=FGgAuFR27arRZRxawEQSrlL/jENSlpOaKQLYbTDxXMf1oGQtV3vIqJkuTTmQPOrJ2HQJxH7HoVre2knWO0L688T3oI1zBd8EvrWA1isGLJFbCg8vAXUqrM2vhE/1QqqeSJYAO8AsHWBcta1SeT+GK6/b+LsfL+vJFwZZ1MVLBBA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741176631; c=relaxed/simple; bh=kUSurVMVnAPvE/KshwwEUxfjvmNUPNSd5SRUldxaJ1E=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=sDQDG6upVu4PN0B7WFnroIuVoPAevaIBzOu7UulpTr1hgTlMXDyIiQIaZj6s/iw3o2UqfA9LAPc/m8jx4Se7McQCK62Sr0+9fKssR47LrDVkv7bVQtKTLwaTzG9SD1gbERNtLlKiRb+xCnSLvi2q6nuX6IR1hCt5tMMbhfqJTLk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=proton.me; spf=pass smtp.mailfrom=proton.me; dkim=pass (2048-bit key) header.d=proton.me header.i=@proton.me header.b=nIwtr9Kx; arc=none smtp.client-ip=79.135.106.28 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=proton.me Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=proton.me Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=proton.me header.i=@proton.me header.b="nIwtr9Kx" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail; t=1741176627; x=1741435827; bh=Ck4lBjZxB9KVixGHfs5/+fTFHKFn0s5CSjOrvlAaxYM=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector:List-Unsubscribe:List-Unsubscribe-Post; b=nIwtr9KxzKoDX7usrC2IvY3MacB1zPjYKePDwvR0paTj4XIfsKFb1PFRiZU/IcxvP eRAxTVr8x+NZqlZHnREMdPMqEK3vbCpRhPX8aLtE3odGk8cDZqZVej/SVCQnzPiPC+ 4WDWoCDpNEy8LmrOIq0rXZHZZNFUbVh98PDO09jicSceyPSVecoj3iKpxKrRz2mZcQ SX/eEu/wO8nI3vyLXOERfxXSQmhmcqW4ylzp5WvgFhm/LVHClhFVzEwjtb6wQzMLlj j9ILa/Kj5cIWIiflSBT9JzDfD8ZCQTaKdKKVRBypnIpVypFxXxW3tLExt75zc+oAvd 78faI9cWvijhQ== Date: Wed, 05 Mar 2025 12:10:20 +0000 To: Andreas Hindborg From: Benno Lossin Cc: Miguel Ojeda , Alex Gaynor , Boqun Feng , Gary Guo , =?utf-8?Q?Bj=C3=B6rn_Roy_Baron?= , Alice Ryhl , Trevor Gross , Danilo Krummrich , Masahiro Yamada , Nathan Chancellor , Nicolas Schier , 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 Message-ID: In-Reply-To: <87h647d6xg.fsf@kernel.org> References: <20250304225245.2033120-1-benno.lossin@proton.me> <20250304225245.2033120-15-benno.lossin@proton.me> <87h647d6xg.fsf@kernel.org> Feedback-ID: 71780778:user:proton X-Pm-Message-ID: 4ce2da989afae251f50e67a0e93c3995720d515d Precedence: bulk X-Mailing-List: rust-for-linux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Wed Mar 5, 2025 at 12:59 PM CET, Andreas Hindborg wrote: > "Benno Lossin" writes: > >> From: Miguel Ojeda >> >> 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. >> Link: https://github.com/Rust-for-Linux/pin-init [1] >> Signed-off-by: Miguel Ojeda >> Co-developed-by: Benno Lossin >> Signed-off-by: Benno Lossin >> --- >> 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_builtin= s.rs rustdoc-core FORCE >> rustdoc-ffi: $(src)/ffi.rs rustdoc-core FORCE >> =09+$(call if_changed,rustdoc) >> >> -rustdoc-kernel: private rustc_target_flags =3D --extern ffi \ >> +rustdoc-pin_init_internal: private rustdoc_host =3D yes >> +rustdoc-pin_init_internal: private rustc_target_flags =3D --cfg kernel = \ >> + --extern proc_macro --crate-type proc-macro >> +rustdoc-pin_init_internal: $(src)/pin-init/internal/src/_lib.rs FORCE >> +=09+$(call if_changed,rustdoc) >> + >> +rustdoc-pin_init: private rustdoc_host =3D yes >> +rustdoc-pin_init: private rustc_target_flags =3D --extern pin_init_inte= rnal \ >> + --extern macros --extern alloc --cfg kernel --cfg feature=3D\"alloc= \" >> +rustdoc-pin_init: $(src)/pin-init/src/_lib.rs rustdoc-pin_init_internal= \ >> + rustdoc-macros FORCE >> +=09+$(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. --- Cheers, Benno