Skip to content

Increase version of bindgen #13

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

VinceCodes
Copy link

When trying to generate bindings, I realized that bindgen.rs was struggling with the version of xen I am using (xen 4.18.1pre-1).

Updating bindgen to "0.69.4" fixes the issue.
In addition, rustfmt_bindings is now deprecated, replaced it with .formatter(bindgen::Formatter::Rustfmt) although the whole thing is not really needed since the the formatting is enabled by default.

Bumped the crate version to reflect the changes.

@Wenzel
Copy link
Owner

Wenzel commented Jul 2, 2024

Ping @ydirson
I have a request here to upgrade bindgen.
Do you still have a requirement for keeping bindgen to 0.51.1 ?

@ydirson
Copy link

ydirson commented Jul 2, 2024

I have no objection against fixing a bug :) but I don't recall what the exact situation was. Maybe @TSnake41 would?

That said, using ">=0.xx" like in xenstore-sys would seem like a good idea if there is no dependency on any moving bindgen APIs. But selecting a useful lower bound would require understanding what the problem with Xen 4.18 is and why newer bindgen helps.

@VinceCodes maybe you can share more details about that error?

@VinceCodes
Copy link
Author

VinceCodes commented Jul 2, 2024

error: failed to run custom build command for `xenctrl-sys v0.1.1 (/home/vince/code/xenctrl-sys)`

Caused by:
  process didn't exit successfully: `/home/vince/code/xenctrl-sys/target/debug/build/xenctrl-sys-42463dea15e0d40b/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-changed=src/wrapper.h

  --- stderr
  thread 'main' panicked at /home/vince/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bindgen-0.51.1/src/ir/context.rs:891:9:
  "enum_(unnamed_at_/usr/include/bits/confname_h_24_1)" is not a valid Ident
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

The issue is with the anonymous enumerations in confname.h

@VinceCodes
Copy link
Author

Full disclaimer @Wenzel, this new version of bindgen has nicer support for enums, so xc_error_code_XC_ERROR_NONE becomes xc_error_code::XC_INTERNAL_ERROR for instance.

This does not play nice with your xenctrl project. But other stuff also breaks when updating xen, for instance, domain_getinfo is replaced by domain_getinfo_single as well as domain_getinfolist.

I can have a PR ready with those changes in that other project if those new versions of repos can be fixed.

Also, no problem for ">=0.xx" to be consistent with xenstore (not sure what is the version of bindgen that has better support for the problematic headers however)

@VinceCodes
Copy link
Author

Tested that 0.61.0 does not work but 0.62.0 does, so the fix is in 0.62.0.

@TSnake41
Copy link

TSnake41 commented Jul 3, 2024

I have no objection against fixing a bug :) but I don't recall what the exact situation was. Maybe @TSnake41 would?

AFAIR, the problem was the fact that there are multiples bindgen versions in the project which caused conflicts.
I think updating the bindgen of all the bindings would help including Wenzel/xenvmevent-sys#4

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.

4 participants