Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is bindgen object merging necessary? #2960

Open
hlopko opened this issue Oct 24, 2024 · 2 comments
Open

Is bindgen object merging necessary? #2960

hlopko opened this issue Oct 24, 2024 · 2 comments

Comments

@hlopko
Copy link
Member

hlopko commented Oct 24, 2024

In #2361 we have added logic (that became the default since then) to merge object files of cc_lib into the rlib 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 #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

@UebelAndre
Copy link
Collaborator

Per #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. 😄

@hlopko
Copy link
Member Author

hlopko commented Oct 25, 2024

If it is about extra link flags, would it help to propagate CcInfo from build scripts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants