Re: [PATCH 05/18] rust: kbuild: define `procmacro-extension` variable
Nicolas Schier <[email protected]>
| Newsgroups | gmane.linux.kernel.rust,gmane.linux.kbuild.devel |
|---|---|
| Organization | FRITZ! Technology GmbH |
| Message-ID | <20260609-hungry-rigorous-moth-e9f5ab@l-nschier-z2> |
On Mon, Jun 08, 2026 at 05:40:02PM +0200, Miguel Ojeda wrote: > On Mon, Jun 8, 2026 at 5:10 PM Nicolas Schier <[email protected]> wrote: > > > > Where does the 'libname.%' pattern come from? Looking at the current > > users of cmd_rustc_procmacro I'd expect a 'lib%' pattern instead. > > Here, we want to extract the extension the operating system uses -- > this was originally added for macOS build support (Cc Tamir), and is > `.so` in Linux but `.dylib` there (and if I recall correctly, we > couldn't force `rustc` in macOS to use a file with `.so` as the > extension, sadly). > > In the commands, however, what we are trying to extract is the name of > the crate instead. So that is why one is `lib%` and the other > `libname.%` (a dummy library name). > > Or do you mean something else? Ah thanks! If only that filename extension ('so' or 'dylib') is wanted, I'd rather expected the use of the '$(suffix)' function instead, as it may be easier to understand w/o knowing the name conversion rustc does: procmacro-extension := $(suffix $(call procmacro-name,dummy-crate-name)) but that's bike-shedding. > Thanks a lot for the reviews! By the way, I sent a bit ago v2 (it > doesn't change much, so I will pick your tags from here :) Thanks. Kind regards, Nicolas