Open hlopko opened 1 month ago
Per https://github.com/bazelbuild/rules_rust/pull/2361, the change was designed to closer match Cargo behavior within these rules. I don't have a sharable repro right now but the issue was indeed extra link flags coming from the CcInfo
that caused Bazel builds to fail due to the ordering of the flags where Cargo builds didn't have these flags and produced usable outputs. I don't know much about this dynamic mode but don't have major objections to a hole being poked in the bindgen rules to support it as long as the default behavior is not changed. 😄
If it is about extra link flags, would it help to propagate CcInfo from build scripts?
In https://github.com/bazelbuild/rules_rust/pull/2361 we have added logic (that became the default since then) to merge object files of
cc_lib
into therlib
produced by bindgen rules. The problem this is solving is related to some annoying ordering errors when using both Bazel and Cargo on a project using bindgen in a build script.I can't say I understand exactly what the problem is, but it has bitten us recently (hence https://github.com/bazelbuild/rules_rust/pull/2959). But intuitively, if the problem is related to link ordering when build scripts are involved, maybe a better fix would be to propagate CcInfo from build scripts?
Any information/repro instructions of the original problem will be super useful.
@UebelAndre @krasimirgg