On 26/02/25 13:40, Miguel Ojeda wrote:
Ah, and by the way, there will likely be way more `.rmeta`s and `.so`s generated (and where they get placed will change) in the future, since the system will change, so please keep that in mind (e.g. perhaps try to avoid hardcoding details and/or overfitting on the current setup).
Yeah I'd imagined this could happen. Currently d/rules just copies rust/{*.rmeta,*.so} into the destination directory. My guess was that in the future they could be placed in subdirectories of rust/, but on a second thought I think as subsystems accept Rust they could be located kind of anywhere in the build directory? If this is the case, then I think hardcoding can hardly be avoided. One will just have to change the hardcoded paths as needed (not ideal, but oh, well; also, absolutely not unheard of :-)). I say this mostly because of the *.so files: assuming that all *.rmeta files must be installed probably is a good enough assumption, but the same is not true for *.so files.
On the other hand, one could maybe use something like `objdump -T whatever.so | grep rustc_proc_macro_decls` to discover if a .so file is a rust proc macro?