-
Notifications
You must be signed in to change notification settings - Fork 0
Regenerate header bindings for the current target instead of reusing incompatible x64 Windows bindings #32
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
Conversation
| - name: Cargo test | ||
| run: cargo test --workspace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed this test here as it is already covered by another build step for all targets.
|
|
||
| on: | ||
| push: | ||
| pull_request: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the pull_request one as it would trigger our CI jobs twice which isn't needed.
|
The segmentation faults experienced on |
| # - target: armv7-unknown-linux-gnueabihf | ||
| # os: ubuntu-latest | ||
| # name: Linux ARMv7 | ||
| # cross: true | ||
| # test: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly a cross compile issue, not an actual issue with the code so removing the test step for now.
https://github.com/Traverse-Research/cpuinfo-rs/actions/runs/14644308875/job/41094360680
|
The |
Co-authored-by: Marijn Suijten <[email protected]>
…nfo-rs into generate-bindings
| let uarch_info = unsafe { cpuinfo_get_uarch(i) }; | ||
| infos.push(unsafe { | ||
| #[cfg(target_arch = "x86_64")] | ||
| #[cfg(any(target_arch = "x86_64", target_arch = "x86"))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MarijnS95 I've also added the 32 bit targets similarly to how cpuinfo does it.
| infos.push(unsafe { | ||
| #[cfg(any(target_arch = "x86_64", target_arch = "x86"))] | ||
| let cpuid = Some((*uarch_info).cpuid); | ||
| #[cfg(all(not(target_arch = "x86_64"), not(target_arch = "x86")))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: not(any()) makes this more similar (to read/copy-paste) with the above case :)
Co-authored-by: Marijn Suijten <[email protected]>
This change removes the pregenerated bindings and instead always generates the bindings at compile time. This results in less work needed to support all targets from
cpuinfo.With bindings being generated at compile time, the cross compilation CI tests now also validate the bindings. Before it would always test against the windows bindings which would "succeed" even though its ABI compared against the compiled
cpuinfostatic library was incorrect. To simplify this CI flow, I've decided to move the cross compilation checks into the generalci.yamlworkflow.I've also patched up our higher level rust code (
lib.rs) to incorporate platform and target specific fields in cpuinfo.h. As a result, this crate now properly supports all targets fromcpuinfo.