Re: [PATCH] rust: query the compiler for dylib path

From: Miguel Ojeda
Date: Sat Oct 12 2024 - 19:38:04 EST


On Sat, Oct 12, 2024 at 4:25 PM Tamir Duberstein <tamird@xxxxxxxxx> wrote:
>
> In order for this to be reasonably maintainable we'd want the variable
> to be something like DYLIB_SUFFIX so that we don't have to revisit this
> if macros are ever provided by more than one crate (or worse, have to
> provide N variables).

That is reasonable, and in this it is probably the right approach
since the complexity is similar, but I wanted to clarify that, in the
kernel, revisiting is fine and expected (features are generally not
added if they are not used or expected to be used very soon, so
revisiting to add a more complex feature later is the normal
approach).

But before we do that, is there a way to force `rustc` to load current
name (or trick it to do so, say, with a symlink)? i.e. can it be
reasonably done out-of-tree without changes to the filename?

Thanks!

Cheers,
Miguel