[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251121043750.298843-1-y.j3ms.n@gmail.com>
Date: Fri, 21 Nov 2025 04:37:47 +0000
From: Jesung Yang <y.j3ms.n@...il.com>
To: gary@...yguo.net,
ojeda@...nel.org
Cc: a.hindborg@...nel.org,
alex.gaynor@...il.com,
aliceryhl@...gle.com,
bjorn3_gh@...tonmail.com,
boqun.feng@...il.com,
dakr@...nel.org,
linux-kbuild@...r.kernel.org,
linux-kernel@...r.kernel.org,
lossin@...nel.org,
nathan@...nel.org,
nicolas@...sle.eu,
patches@...ts.linux.dev,
rust-for-linux@...r.kernel.org,
tmgross@...ch.edu
Subject: Re: [PATCH 00/18] `syn` support
Gary Guo <gary@...yguo.net> wrote:
> I can build with these patches and I've verified that libmacros can
> indeed reference types within `syn`, so also
Hi,
I've been trying to apply this patch on the current rust-next HEAD
494de8f67b1e ("rust: sync: replace kernel::c_str! with C-Strings") and
test it, since I need this series for my future patch revision.
Unfortunately, when I make the following change:
diff --git a/rust/macros/lib.rs b/rust/macros/lib.rs
index 793f712dbf7c..084633b517be 100644
--- a/rust/macros/lib.rs
+++ b/rust/macros/lib.rs
@@ -444,3 +444,14 @@ pub fn paste(input: TokenStream) -> TokenStream {
pub fn kunit_tests(attr: TokenStream, ts: TokenStream) -> TokenStream {
kunit::kunit_tests(attr, ts)
}
+
+use syn::{
+ parse_macro_input,
+ DeriveInput, //
+};
+
+#[proc_macro_attribute]
+pub fn dummy(input: TokenStream) -> TokenStream {
+ let input = parse_macro_input!(input as DeriveInput);
+ todo!()
+}
It fails to compile:
error[E0432]: unresolved import `syn`
--> rust/macros/lib.rs:448:5
|
448 | use syn::{
| ^^^ use of unresolved module or unlinked crate `syn`
|
= help: you might be missing a crate named `syn`
error: aborting due to 1 previous error
It appears that the vendored crates are indeed compiled; I can see some
build artifacts like `rust/libsyn.rlib`, `libquote.rlib`, etc.
For reference, here's the sequence of commands I ran to compile the
kernel:
make LLVM=1 ARCH=arm64 rustavailable
make LLVM=1 ARCH=arm64 defconfig
scripts/config --enable CONFIG_RUST
scripts/config --enable CONFIG_SAMPLES
scripts/config --enable CONFIG_SAMPLES_RUST
scripts/config --module CONFIG_SAMPLE_RUST_MINIMAL
scripts/config --enable CONFIG_KUNIT
scripts/config --enable CONFIG_RUST_KERNEL_DOCTESTS
make LLVM=1 ARCH=arm64 olddefconfig
make LLVM=1 ARCH=arm64 CLIPPY=1 -j8
I'd appreciate any guidance on steps I might be missing. Thanks in
advance!
Best Regards,
Jesung
Powered by blists - more mailing lists