rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jesung Yang <y.j3ms.n@gmail.com>
To: gary@garyguo.net, ojeda@kernel.org
Cc: a.hindborg@kernel.org, alex.gaynor@gmail.com,
	aliceryhl@google.com, bjorn3_gh@protonmail.com,
	boqun.feng@gmail.com, dakr@kernel.org,
	linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
	lossin@kernel.org, nathan@kernel.org, nicolas@fjasle.eu,
	patches@lists.linux.dev, rust-for-linux@vger.kernel.org,
	tmgross@umich.edu
Subject: Re: [PATCH 00/18] `syn` support
Date: Fri, 21 Nov 2025 04:37:47 +0000	[thread overview]
Message-ID: <20251121043750.298843-1-y.j3ms.n@gmail.com> (raw)
In-Reply-To: <20251110135927.05d83da2@eugeo>

Gary Guo <gary@garyguo.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

  parent reply	other threads:[~2025-11-21  4:37 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-10  9:50 [PATCH 00/18] `syn` support Miguel Ojeda
2025-11-10  9:50 ` [PATCH 01/18] rust: condvar: avoid `pub` in example Miguel Ojeda
2025-11-10 10:24   ` Alice Ryhl
2025-11-10 11:10     ` Miguel Ojeda
2025-11-10  9:50 ` [PATCH 02/18] rust: kbuild: introduce `core-flags` and `core-skip_flags` Miguel Ojeda
2025-11-10 10:19   ` Miguel Ojeda
2025-11-10 11:50     ` Alice Ryhl
2025-11-10 10:27   ` Alice Ryhl
2025-11-10 19:18   ` John Hubbard
2025-11-12 11:13     ` Miguel Ojeda
2025-11-10  9:50 ` [PATCH 03/18] rust: kbuild: simplify `--cfg` handling Miguel Ojeda
2025-11-10 10:33   ` Alice Ryhl
2025-11-10  9:50 ` [PATCH 04/18] rust: kbuild: add host library support Miguel Ojeda
2025-11-10 10:43   ` Alice Ryhl
2025-11-10 11:17     ` Miguel Ojeda
2025-11-10  9:50 ` [PATCH 05/18] rust: proc-macro2: import crate Miguel Ojeda
2025-11-10  9:50 ` [PATCH 06/18] rust: proc-macro2: add SPDX License Identifiers Miguel Ojeda
2025-11-10  9:50 ` [PATCH 07/18] rust: proc-macro2: remove `unicode_ident` dependency Miguel Ojeda
2025-11-10 10:50   ` Alice Ryhl
2025-11-10  9:50 ` [PATCH 08/18] rust: proc-macro2: add `README.md` Miguel Ojeda
2025-11-10 10:52   ` Alice Ryhl
2025-11-10  9:50 ` [PATCH 09/18] rust: proc-macro2: enable support in kbuild Miguel Ojeda
2025-11-10 11:38   ` Alice Ryhl
2025-11-10 13:10     ` Gary Guo
2025-11-10 13:28       ` Miguel Ojeda
2025-11-10 13:34         ` Alice Ryhl
2025-11-10 19:34   ` John Hubbard
2025-11-12 11:14     ` Miguel Ojeda
2025-11-10  9:50 ` [PATCH 10/18] rust: quote: import crate Miguel Ojeda
2025-11-10  9:50 ` [PATCH 11/18] rust: quote: add SPDX License Identifiers Miguel Ojeda
2025-11-10  9:50 ` [PATCH 12/18] rust: quote: add `README.md` Miguel Ojeda
2025-11-10  9:50 ` [PATCH 13/18] rust: quote: enable support in kbuild Miguel Ojeda
2025-11-10 11:44   ` Alice Ryhl
2025-11-10 13:13     ` Gary Guo
2025-11-10 13:22       ` Miguel Ojeda
2025-11-10 13:35         ` Alice Ryhl
2025-11-10  9:50 ` [PATCH 14/18] rust: syn: import crate Miguel Ojeda
2025-11-10 10:26   ` Miguel Ojeda
2025-11-10  9:50 ` [PATCH 15/18] rust: syn: add SPDX License Identifiers Miguel Ojeda
2025-11-10  9:50 ` [PATCH 16/18] rust: syn: remove `unicode-ident` dependency Miguel Ojeda
2025-11-10 11:47   ` Alice Ryhl
2025-11-10  9:50 ` [PATCH 17/18] rust: syn: add `README.md` Miguel Ojeda
2025-11-10 11:47   ` Alice Ryhl
2025-11-10  9:50 ` [PATCH 18/18] rust: syn: enable support in kbuild Miguel Ojeda
2025-11-10 11:49   ` Alice Ryhl
2025-11-10 13:38     ` Miguel Ojeda
2025-11-10 13:42       ` Alice Ryhl
2025-11-10 19:43   ` John Hubbard
2025-11-10 13:59 ` [PATCH 00/18] `syn` support Gary Guo
2025-11-10 14:20   ` Miguel Ojeda
2025-11-21  4:37   ` Jesung Yang [this message]
2025-11-21  5:36     ` Miguel Ojeda
2025-11-21  9:08       ` Jesung Yang
2025-11-23 12:50         ` Miguel Ojeda
2025-11-23 22:46           ` Jesung Yang
2025-11-10 15:59 ` Jonathan Corbet
2025-11-10 16:27   ` Miguel Ojeda
2025-11-10 17:04     ` Benno Lossin

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=20251121043750.298843-1-y.j3ms.n@gmail.com \
    --to=y.j3ms.n@gmail.com \
    --cc=a.hindborg@kernel.org \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --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=lossin@kernel.org \
    --cc=nathan@kernel.org \
    --cc=nicolas@fjasle.eu \
    --cc=ojeda@kernel.org \
    --cc=patches@lists.linux.dev \
    --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;
as well as URLs for NNTP newsgroup(s).