-
Notifications
You must be signed in to change notification settings - Fork 248
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
port c2rust-transpile to syn, disable c2rust-refactor, llvm_asm! -> asm! #374
Conversation
if this var is set, binaries are in a different location than we expect setting CARGO_TARGET_DIR can save disk space by sharing target dirs between Cargo projects
fd 9 was getting used by something when doing a nested build; instead simply write to the output file directly this was also fixed upstream by intel/tinycbor@6176e0a
we likely need to redo how this handles spans, because spans are required for comment reinsertion
this fork is unfortunate but maybe can be avoided as it merely exposes more entrypoints to prettyplease's printer
this is deprecated and has no effect for foreign functions, which are no longer mangled by default
this is no longer needed and just produces unnecessary warnings
this follows upstream dropping support; see #369
592307c
to
9bcff61
Compare
Will it be possible to generate Rust code using this port, and then use the c2rust-refactor from older commits of the c2rust? |
Yes, the rust code generated by the new c2rust-transpile should still work with the old c2rust-refactor, though that workflow isn't something with test coverage, so your mileage may vary as c2rust-transpile evolves with language and compiler changes. |
e4faab6
to
2086cb2
Compare
I assume this compleately breaks c2rust-refactor. Maybe we can rewrite c2rust-refactor and c2rust transpiler into two entierly different programms, that can be installed individually with c2rust itself, just checking for them to exist and call them. We can do so by adding a feature to c2rust-ast-printer and c2rust-ast-builder that switches from syn to a libsyntax version for now. This allows for people to still be able to use the unstable old refactor tool, if they want to. |
2086cb2
to
853f9b5
Compare
the empty string is no longer a legal path segment; use mk().abs_path() to specify that the path begins with `::`
this replaces LitIntType::Unsuffixed enum variant from libsyntax
options are not yet translated and it may be buggy
also translate operand modifiers, assuming x86 for now
Maintaining both with a feature flag seems infeasible, given the extent of these changes. Building c2rust-refactor is still easy, however, with the skew in nightly versions between the transpiler and the refactoring tool, it's more complicated than just a feature flag. You're welcome to still build and use the refactoring tool, either by modifying the cargo configuration or just pinning to an old commit, but I don't see a good way to support both concurrently for the moment. Keep in mind that code from the new transpiler will probably not parse with the old nightly (and vice versa, because we use too many nightly features in the transpiled output code). |
940946e
to
a67976a
Compare
this is necessary to make the testsuite pass; otherwise, curl and libxml hit rust-lang/rust#87813 now that we translate their inline asm (which only appears from transitive includes on ubuntu 18.04)
a67976a
to
b5f376c
Compare
rustc forbids this, so don't generate these options in this case
37ba466
to
2c87960
Compare
2c87960
to
bbfcac4
Compare
This makes it possible to build c2rust with a current nightly (and one as old as a few months ago probably works, but I'm not sure of the exact compat range).
The caveats: