feature: introduce link_deps attribute for native library linkage#4024
Conversation
0812abf to
6ffe12e
Compare
092f8e4 to
2d62bd3
Compare
Head branch was pushed to by a user without write access
2324978 to
812181b
Compare
This change adds a dedicated link_deps attribute to Rust rules, allowing native symbols to be linked without exposing them as Rust crates. Key changes: - Added link_deps to _common_attrs for CcInfo/CrateInfo targets. - Filtered link_deps out of rust_proc_macro to avoid transition complexity. - Implemented transform_link_deps to extract linkage context while hiding crate metadata. - Added a proactive warning for native libraries incorrectly listed in deps. - Added unit tests in test/unit/link_deps to verify correct linkage.
Head branch was pushed to by a user without write access
|
@krasimirgg @Suyashagarw per #4095
I did notice this change added tons of debug prints to builds in |
bazelbuild#4024 introduced a warning for targets adding CC deps in `deps`. The warning calls out putting this in `link_deps` or `cc_deps`. The latter makes more sense here... but doesn't actually exist. However, I don't think this matters anyways, as I don't think it's needed (this works with an internal codebase).
Hey, missed that. Internally, we have some customizations that add the |
A follow-up from bazelbuild/rules_rust#4024 where we inadvertently mentioned a feature that doesn't exist.
This change adds a dedicated link_deps attribute to Rust rules, allowing native symbols to be linked without exposing them as Rust crates.
Closes #4023
Key changes:
This provides a cleaner separation of concerns between Rust modules and native code linkage while maintaining full backward compatibility for existing targets.