diff options
| author | Martin Kletzander <nert.pinx@gmail.com> | 2025-09-12 11:01:18 +0200 |
|---|---|---|
| committer | Dylan Baker <dylan@pnwbakers.com> | 2025-09-22 08:52:07 -0700 |
| commit | 1ddbf2e8ceb52f14de856dfa7cf7492264c5416c (patch) | |
| tree | 330e96b6cd3c044133f590b04e8e4973baeb50e6 /docs/markdown/Rust.md | |
| parent | bc039faefbb7ea43a7fd70cdaca13e15224db896 (diff) | |
| download | meson-1ddbf2e8ceb52f14de856dfa7cf7492264c5416c.tar.gz | |
rust: Fix dependency on proc macro crates
When building a proc-macro crate the build target is actually a shared
library target. The resulting library (the .so file directly) is used
in the targets that depend on it. But being a shared object there are
symbols extracted from it and the symbols file is the actual file
recorded as the dependency. When another crate uses a macro from the
first crate, being dependent on the symbols file it means that if the
macro _implementation_ changes, but symbols stay the same, the symbol
extractor does not rewrite the symbols file and nothing else gets
rebuilt.
That would be fine when it comes to classic shared library, but due to
the fact that the shared library is used by the compiler (just like a
gcc plugin or another compiler plugin) the result does not change only
based on the symbols, but also based on the implementation. Therefore
if the target in the dependency is a proc-macro crate, instead of
depending on the symbols file, depend on the shared object filename.
With this change, when a macro implementation changes in a proc-macro
crate, all crates using that macro will be rebuilt.
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Diffstat (limited to 'docs/markdown/Rust.md')
0 files changed, 0 insertions, 0 deletions
