Skip to content

Cannot build on Arch #329

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

Closed
appetrosyan opened this issue Mar 5, 2021 · 5 comments
Closed

Cannot build on Arch #329

appetrosyan opened this issue Mar 5, 2021 · 5 comments
Labels
pending release Issues that will be fixed by the next release

Comments

@appetrosyan
Copy link

Hi. I've tried installing on Arch Linux with the following toolchaing:

Default host: x86_64-unknown-linux-gnu
rustup home:  /home/app/.rustup

nightly-2019-12-05-x86_64-unknown-linux-gnu (default)
rustc 1.41.0-nightly (6d77e45f0 2019-12-04)

I've tried to build c2rust using cargo +nightly-2019-12-05 install c2rust --locked as suggested in response to #323 and the compilation failed with the following error:

/home/app/.cargo/registry/src/github.com-1ecc6299db9ec823/c2rust-ast-exporter-0.15.0/src/AstExporter.cpp: In lambda function:
/home/app/.cargo/registry/src/github.com-1ecc6299db9ec823/c2rust-ast-exporter-0.15.0/src/AstExporter.cpp:2466:37: error: ‘class clang::ASTContext’ has no member named ‘getRawCommentList’; did you mean ‘DeclRawComments’?
 2466 |             auto comments = Context.getRawCommentList().getCommentsInFile(file);
      |                                     ^~~~~~~~~~~~~~~~~
      |                                     DeclRawComments
/home/app/.cargo/registry/src/github.com-1ecc6299db9ec823/c2rust-ast-exporter-0.15.0/src/AstExporter.cpp: In function ‘std::vector<const char*, std::allocator<const char*> > augment_argv(int, const char**)’:
/home/app/.cargo/registry/src/github.com-1ecc6299db9ec823/c2rust-ast-exporter-0.15.0/src/AstExporter.cpp:2565:37: error: conversion from ‘llvm::StringRef’ to non-scalar type ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} requested
 2565 |     std::string resource_dir = P.str();
      |                                ~~~~~^~
make[3]: *** [CMakeFiles/clangAstExporter.dir/build.make:82: CMakeFiles/clangAstExporter.dir/AstExporter.cpp.o] Error 1
make[2]: *** [CMakeFiles/Makefile2:103: CMakeFiles/clangAstExporter.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:110: CMakeFiles/clangAstExporter.dir/rule] Error 2
make: *** [Makefile:137: clangAstExporter] Error 2
thread 'main' panicked at '
command did not execute successfully, got: exit code: 2

build script failed, must exit now', /home/app/.cargo/registry/src/github.com-1ecc6299db9ec823/cmake-0.1.44/src/lib.rs:885:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.


@thedataking
Copy link
Contributor

Are you on Clang/LLVM 11.1.0 by chance? If not, what version are you using. C2Rust is expected to work with LLVM 11.0.0 but. we haven't tested with newer releases IIRC.

@appetrosyan
Copy link
Author

Hi, Not quite I'm on the point release 11.1.0-1.

@thedataking
Copy link
Contributor

I tested with clang/LLVM 11.1.0 and it works on Ubuntu 20.10. Can you pull c2rust master and see if the following works?

path/to/c2rust/scripts/build_translator.py --with-llvm-version=11.1.0 --skip-signature-checks

@stevefan1999-personal
Copy link

The problem is, far as I know, the changes that made c2rust compatible to Clang 12 is only what you have in the master branch, but cargo install fetches the source only for the latest version known, which is the maintenance update. Either you downgrade to Clang 10 and use that build, or git clone --depth 1 it

@rinon rinon added the pending release Issues that will be fixed by the next release label May 10, 2022
@rinon
Copy link
Contributor

rinon commented May 12, 2022

Fixed with the v0.16.0 release

@rinon rinon closed this as completed May 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending release Issues that will be fixed by the next release
Projects
None yet
Development

No branches or pull requests

4 participants