-
Notifications
You must be signed in to change notification settings - Fork 253
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
Lack of support for simple projects or the cc crate #1033
Comments
Have ever tried |
@kornelski can you let us know whether If not, I suppose we could make |
I'd be happy if it transpiled file(s) directly specified on the command line, without the JSON build indirection. Like bindgen, for example. |
) * Fixes #1033. This adds support for transpiling C sources without needing to generate a `compile_commands.json` with something such as `bear` or `cmake`. The way it works is that a temporary `temp_compile_commands` file is created. One alternative to this approach would have been to alter the AST exporter to use a `FixedCompilationDatabase` but it seemed simpler to support this feature from the front end.
I find the the requirement to use
compile_commands.json
incredibly annoying, because it never fits the types of projects I want to convert to Rust, and also requires use of clunky 3rd party non-Rust dependencies and non-Rust build systems.It so happens that all C code that I dare to port to Rust is small — only a handful of
.c
files, sometimes literally just a single.c
file or a header-only dependency. And for such trivial code I use thecc
crate, not something complicated likemeson
.If a project is too hard to build with the
cc
crate, I consider it also too big and complex to convert to Rust. So I'm frustrated that c2rust only supports the types of projects I don't want to convert. When I want to convert literally a single.c
file that has zero dependencies and compiles withgcc *.c
without issues, I have to jump through so many hoops. I need to re-learn how to usecmake
, and I need to deal with series of issues in installing the right version of python, and installing its dependencies, and venvs and whatever else it requires. All of that to pass a single file path toc2rust
.Please, support
c2rust *.c
.The text was updated successfully, but these errors were encountered: