Skip to content

Remove failure when bindgen cc_lib does not contain static library#2742

Open
jwnrt wants to merge 3 commits intobazelbuild:mainfrom
jwnrt:bindgen-header-only
Open

Remove failure when bindgen cc_lib does not contain static library#2742
jwnrt wants to merge 3 commits intobazelbuild:mainfrom
jwnrt:bindgen-header-only

Conversation

@jwnrt
Copy link

@jwnrt jwnrt commented Jul 15, 2024

I don't think this failure is required: it's fine to bindgen a library with only headers and no static library. Should this error instead be triggering when the cc_library has non-header files but isn't static?

Fixes #2704

@krasimirgg krasimirgg requested a review from hlopko July 16, 2024 08:26
@hlopko
Copy link
Member

hlopko commented Jul 16, 2024

Thanks @jwnrt, the PR makes sense. Would you mind adding a separate example in examples/bindgen (for example a header that is used from both Rust and C++, and both libraries meet in a common binary) showing everything links together well?

@jwnrt
Copy link
Author

jwnrt commented Jul 16, 2024

Sure, I've added an example, let me know if it matches what you expected
EDIT: also rebased.

@jwnrt jwnrt force-pushed the bindgen-header-only branch 2 times, most recently from 061bbff to 57499cf Compare July 16, 2024 10:42
@jwnrt jwnrt force-pushed the bindgen-header-only branch 2 times, most recently from 4759a02 to 5b4111d Compare August 9, 2024 06:51
@jwnrt jwnrt force-pushed the bindgen-header-only branch from 02f063c to 3903aa1 Compare August 14, 2024 09:20
@jwnrt
Copy link
Author

jwnrt commented Aug 14, 2024

Fixed those formatting problems (hopefully you folks don't mind me rebasing to keep the branch up to date)

@jwnrt jwnrt force-pushed the bindgen-header-only branch from 3903aa1 to 9fc138f Compare August 14, 2024 10:03
@jwnrt
Copy link
Author

jwnrt commented Sep 13, 2024

Friendly bump: this is ready for review again. We can apply this as a patch downstream, so no rush from me.

@jwnrt jwnrt force-pushed the bindgen-header-only branch from 9fc138f to 9045a52 Compare March 18, 2025 14:43
@scentini scentini requested review from scentini and removed request for hlopko March 11, 2026 16:45
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

Successfully merging this pull request may close these issues.

rust_bindgen should not require a static library

3 participants