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

Update bindgen to 0.71 #482

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Update bindgen to 0.71 #482

wants to merge 1 commit into from

Conversation

jbourassa
Copy link
Contributor

Bump bindgen to 0.71 in hope to fix compilation on Windows with recent clang. IIUC, latest bindgen should not have that problem.

I ran into 2 issues when bumping the crate:

  1. ABI checks that referenced either private fields or out-of-scope structs:

    const _: () = {
        ["Size of RString"][::std::mem::size_of::<RString>() - 40usize];
        ["Alignment of RString"][::std::mem::align_of::<RString>() - 8usize];
        ["Offset of field: RString::basic"][::std::mem::offset_of!(RString, basic) - 0usize];
        ["Offset of field: RString::len"][::std::mem::offset_of!(RString, len) - 16usize];
        ["Offset of field: RString::as_"][::std::mem::offset_of!(RString, as_) - 24usize];
    };

    I fixed it by patching those blocks with a use crate::internal::*; and getting rid of the rb_sys__Opaque__ prefix. Not sure what underlying change made this a problem though.

  2. Missing proc_macro2::Literal::c_string when testing against magnus. Hence the proc_macro2 bump.

With those changes, magnus tests pass on my machine. Let's see what CI says.

#new_code
}
};
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not familiar with bindgen nor syn -- hopefully this makes sense. I think it preserves the intent, that is, enusre the types are ABI-compatible.

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.

1 participant