-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Initial support for c2rust #7475
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
Initial support for c2rust #7475
Conversation
👋 thanks for the PR! Let us know if you need more guidance 👋 |
Yup, the goal is to add this to the public compiler explorer site! I currently have a few other PRs up that should be adding the necessary build support:
I think that's everything needed to get c2rust building for the public site, but please let me know if I missed something!
Ah, right! Let me add those. |
03a363c
to
52e8129
Compare
This gives us the correct version string, rather than getting the version for just the c2rust-transpile binary.
52e8129
to
9dae0ed
Compare
Okay, I have added what is I think the correct configuration for the amazon config file. I didn't add anything to the default config file because it doesn't seem like c2rust needs to be in the default config, but let me know if that's wrong. Is there a good way to test the config for the amazon file? I'm not 100% sure I got the path to the exe right and I'm not sure how to test that. Also, the one other thing I could use some help with relates to the TODO comment in the PR. By default the Rust ouput is having it's first line removed by the comments filter, resulting in invalid Rust. Turning off the comments filter fixes this, but that's not going to be disabled by default for users. Is there a right way to fix this? It seems suspect that the comment filter is removing a line starting with |
|
group.c2rust.supportsBinary=false | ||
group.c2rust.supportsBinaryObject=false | ||
|
||
compiler.c2rust-master.exe=/opt/compiler-explorer/c2rust-master/c2rust |
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.
Confirmed this path is good:
$ /opt/compiler-explorer/c2rust-master/c2rust --help
C2Rust 0.20.0
The C2Rust Project Developers <c2rust@immunant.com>
USAGE:
c2rust <SUBCOMMAND>
OPTIONS:
-h, --help Print help information
-V, --version Print version information
SUBCOMMANDS:
analyze
help Print this message or the help of the given subcommand(s)
instrument
pdg
transpile
I have a solution that I think is OK for now for the "don't hide comments" -- will push to your branch and merge |
Ah, I don't haev write-access but I'll push to main here instead. |
ok I think we're good :) |
This is now live on the site: thanks! |
Adds new compiler base for c2rust, a transpiler that converts C code to Rust.
There's one outstanding TODO in the code about incorrect default filters for the c2rust output. I wasn't sure how to address it, so help would be appreciated.
Fixes #6888 and #5900 (there are duplicate feature requests).