Skip to content

ctest: Add translation of Rust types. #4501

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 10 commits into
base: main
Choose a base branch
from

Conversation

mbyx
Copy link
Contributor

@mbyx mbyx commented Jun 17, 2025

Description

The ability to translate various Rust types that are translatable into equivalent C types. Additionally some basic unit tests have been added.

Sources

Checklist

  • Relevant tests in libc-test/semver have been updated
  • No placeholder or unstable values like *LAST or *MAX are
    included (see #3131)
  • Tested locally (cd libc-test && cargo test --target mytarget);
    especially relevant for platforms that may not be checked in CI

@rustbot rustbot added ctest Issues relating to the ctest crate S-waiting-on-review labels Jun 17, 2025
@mbyx
Copy link
Contributor Author

mbyx commented Jun 17, 2025

There's quite a lot of unreachable or unimplemented because the original ctest2 did the same. If that should be changed to minimize it then please tell. This is mostly a direct port of the original code over to syn, there may be some bugs.

@mbyx mbyx force-pushed the ctest-c-translation branch from fc9641c to 1d766de Compare June 17, 2025 17:30
@mbyx
Copy link
Contributor Author

mbyx commented Jun 19, 2025

Tests seem to fail at a parse int error, so rustc --version is giving a different result there for some reason. EDIT: I forgot nightly is a thing. That's embarassing.

@mbyx mbyx force-pushed the ctest-c-translation branch from 43a06e3 to 3c411d1 Compare June 19, 2025 15:17
@mbyx
Copy link
Contributor Author

mbyx commented Jun 19, 2025

The error on msvc goes away if I replace const bool ON = true with #define ON true in the hierarchy.h file, but I don't know why it doesn't allow it.
freebsd-15 is spurious but freebsd-13 seems to also error on hierarchy, and most likely something in generate_files is causing it.

@mbyx
Copy link
Contributor Author

mbyx commented Jun 20, 2025

From what I understand powerpc64-unknown-linux-gnu is being cross compiled on a normal linux distro, causing a mismatch in the library file and the environment it is being built in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ctest Issues relating to the ctest crate S-waiting-on-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants