Skip to content
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

Build error #1133

Open
sunilhyd opened this issue Sep 21, 2024 · 5 comments
Open

Build error #1133

sunilhyd opened this issue Sep 21, 2024 · 5 comments

Comments

@sunilhyd
Copy link

6.8.0-44-generic
Linux VirtualBox 6.8.0-44-generic #44-Ubuntu SMP PREEMPT_DYNAMIC Tue Aug 13 13:35:26 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
rustc -V
rustc 1.79.0 (129f3b996 2024-06-10)
Later version of rustc does not work some error due to time format encountred.

I currently got caught at this point. I am unable to figure out what is causing this.
Help!.
Thanks
Sunil

Error: failed to run custom build command for c2rust-ast-exporter v0.18.0

Caused by:
process didn't exit successfully: /tmp/cargo-installxm0a88/release/build/c2rust-ast-exporter-c5c248ddfab53b38/build-script-build (exit status: 101)
--- stdout
CMAKE_TOOLCHAIN_FILE_x86_64-unknown-linux-gnu = None
CMAKE_TOOLCHAIN_FILE_x86_64_unknown_linux_gnu = None
HOST_CMAKE_TOOLCHAIN_FILE = None
CMAKE_TOOLCHAIN_FILE = None
CMAKE_GENERATOR_x86_64-unknown-linux-gnu = None
CMAKE_GENERATOR_x86_64_unknown_linux_gnu = None
HOST_CMAKE_GENERATOR = None
CMAKE_GENERATOR = None
CMAKE_PREFIX_PATH_x86_64-unknown-linux-gnu = None
CMAKE_PREFIX_PATH_x86_64_unknown_linux_gnu = None
HOST_CMAKE_PREFIX_PATH = None
CMAKE_PREFIX_PATH = None
CMAKE_x86_64-unknown-linux-gnu = None
CMAKE_x86_64_unknown_linux_gnu = None
HOST_CMAKE = None
CMAKE = None
running: cd "/tmp/cargo-installxm0a88/release/build/c2rust-ast-exporter-37f270cc577f1358/out/build" && CMAKE_PREFIX_PATH="" "cmake" "/home/kpal/.cargo/registry/src/index.crates.io-6f17d22bba15001f/c2rust-ast-exporter-0.18.0/src" "-DLLVM_DIR=/usr/lib/llvm-18/lib/cmake/llvm" "-DClang_DIR=/usr/lib/llvm-18/lib/cmake/clang" "-DCMAKE_INSTALL_PREFIX=/tmp/cargo-installxm0a88/release/build/c2rust-ast-exporter-37f270cc577f1358/out" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_C_COMPILER=/usr/bin/cc" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_CXX_COMPILER=/usr/bin/c++" "-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_ASM_COMPILER=/usr/bin/cc" "-DCMAKE_BUILD_TYPE=Release"
-- The C compiler identification is GNU 13.2.0
-- The CXX compiler identification is GNU 13.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test HAVE_FFI_CALL
-- Performing Test HAVE_FFI_CALL - Success
-- Found FFI: /usr/lib/x86_64-linux-gnu/libffi.so
-- Could NOT find LibEdit (missing: LibEdit_INCLUDE_DIRS LibEdit_LIBRARIES)
-- Performing Test Terminfo_LINKABLE
-- Performing Test Terminfo_LINKABLE - Success
-- Found Terminfo: /usr/lib/x86_64-linux-gnu/libtinfo.so
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.3")
-- Found zstd: /usr/lib/x86_64-linux-gnu/libzstd.so
-- Found LibXml2: /usr/lib/x86_64-linux-gnu/libxml2.so (found version "2.9.14")
-- Found CURL: /usr/lib/x86_64-linux-gnu/libcurl.so (found version "8.5.0")
-- Could NOT find LibEdit (missing: LibEdit_INCLUDE_DIRS LibEdit_LIBRARIES)
-- Configuring done (7.9s)
-- Generating done (0.0s)
-- Build files have been written to: /tmp/cargo-installxm0a88/release/build/c2rust-ast-exporter-37f270cc577f1358/out/build
running: cd "/tmp/cargo-installxm0a88/release/build/c2rust-ast-exporter-37f270cc577f1358/out/build" && MAKEFLAGS="-j --jobserver-fds=8,10 --jobserver-auth=8,10" "cmake" "--build" "." "--target" "clangAstExporter" "--config" "Release"
[ 8%] Creating directories for 'tinycbor_build'
[ 16%] Performing download step (git clone) for 'tinycbor_build'
[ 25%] Performing update step for 'tinycbor_build'
[ 33%] Performing patch step for 'tinycbor_build'
patching file Makefile
patching file Makefile.configure
[ 41%] Performing configure step for 'tinycbor_build'
.config file not yet created
[ 50%] Performing build step for 'tinycbor_build'
[ 58%] Performing install step for 'tinycbor_build'
[ 66%] Completed 'tinycbor_build'
[ 66%] Built target tinycbor_build
[ 75%] Building CXX object CMakeFiles/clangAstExporter.dir/AstExporter.cpp.o

--- stderr
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.

Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.

CMake Warning:
Manually-specified variables were not used by the project:

  CMAKE_ASM_COMPILER
  CMAKE_ASM_FLAGS

Cloning into 'tinycbor_build'...
HEAD is now at d393c16 Parser: fix reading it->extra on big endian when bytesNeeded == 1
make[4]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
make[4]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
make[4]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
make[4]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
/home/kpal/.cargo/registry/src/index.crates.io-6f17d22bba15001f/c2rust-ast-exporter-0.18.0/src/AstExporter.cpp:88:1: error: ‘Optional’ does not name a type
88 | Optional getIntegerConstantExpr(const Expr &E, const ASTContext &Ctx) {
| ^~~~~~~~
/home/kpal/.cargo/registry/src/index.crates.io-6f17d22bba15001f/c2rust-ast-exporter-0.18.0/src/AstExporter.cpp: In member function ‘bool TranslateASTVisitor::evaluateConstantInt(clang::Expr*, llvm::APSInt&)’:
/home/kpal/.cargo/registry/src/index.crates.io-6f17d22bba15001f/c2rust-ast-exporter-0.18.0/src/AstExporter.cpp:576:22: error: ‘getIntegerConstantExpr’ was not declared in this scope
576 | auto value = getIntegerConstantExpr(*E, Context);
| ^~~~~~~~~~~~~~~~~~~~~~
/home/kpal/.cargo/registry/src/index.crates.io-6f17d22bba15001f/c2rust-ast-exporter-0.18.0/src/AstExporter.cpp: In member function ‘bool TranslateASTVisitor::VisitOffsetOfExpr(clang::OffsetOfExpr
)’:
/home/kpal/.cargo/registry/src/index.crates.io-6f17d22bba15001f/c2rust-ast-exporter-0.18.0/src/AstExporter.cpp:1352:22: error: ‘getIntegerConstantExpr’ was not declared in this scope
1352 | auto value = getIntegerConstantExpr(*E, *this->Context);
| ^~~~~~~~~~~~~~~~~~~~~~
/home/kpal/.cargo/registry/src/index.crates.io-6f17d22bba15001f/c2rust-ast-exporter-0.18.0/src/AstExporter.cpp: In lambda function:
/home/kpal/.cargo/registry/src/index.crates.io-6f17d22bba15001f/c2rust-ast-exporter-0.18.0/src/AstExporter.cpp:1356:21: error: ‘value’ is not captured
1356 | if (value) {
| ^~~~~
/home/kpal/.cargo/registry/src/index.crates.io-6f17d22bba15001f/c2rust-ast-exporter-0.18.0/src/AstExporter.cpp:1355:58: note: the lambda has no capture-default
1355 | E, TagOffsetOfExpr, childIds, [this, E, value](CborEncoder *extras) {
| ^
/home/kpal/.cargo/registry/src/index.crates.io-6f17d22bba15001f/c2rust-ast-exporter-0.18.0/src/AstExporter.cpp:1352:14: note: ‘value’ declared here
1352 | auto value = getIntegerConstantExpr(*E, *this->Context);
| ^~~~~
/home/kpal/.cargo/registry/src/index.crates.io-6f17d22bba15001f/c2rust-ast-exporter-0.18.0/src/AstExporter.cpp:1357:46: error: ‘value’ is not captured
1357 | cbor_encode_uint(extras, value->getZExtValue());
| ^~~~~
/home/kpal/.cargo/registry/src/index.crates.io-6f17d22bba15001f/c2rust-ast-exporter-0.18.0/src/AstExporter.cpp:1355:58: note: the lambda has no capture-default
1355 | E, TagOffsetOfExpr, childIds, [this, E, value](CborEncoder *extras) {
| ^
/home/kpal/.cargo/registry/src/index.crates.io-6f17d22bba15001f/c2rust-ast-exporter-0.18.0/src/AstExporter.cpp:1352:14: note: ‘value’ declared here
1352 | auto value = getIntegerConstantExpr(*E, this->Context);
| ^~~~~
/home/kpal/.cargo/registry/src/index.crates.io-6f17d22bba15001f/c2rust-ast-exporter-0.18.0/src/AstExporter.cpp: In lambda function:
/home/kpal/.cargo/registry/src/index.crates.io-6f17d22bba15001f/c2rust-ast-exporter-0.18.0/src/AstExporter.cpp:1490:41: error: ‘getIntegerConstantExpr’ was not declared in this scope
1490 | auto constant = getIntegerConstantExpr(
| ^~~~~~~~~~~~~~~~~~~~~~
/home/kpal/.cargo/registry/src/index.crates.io-6f17d22bba15001f/c2rust-ast-exporter-0.18.0/src/AstExporter.cpp:1502:63: error: ‘class clang::DesignatedInitExpr::Designator’ has no member named ‘getField’; did you mean ‘getFieldLoc’?
1502 | uintptr_t(designator.getField()));
| ^~~~~~~~
| getFieldLoc
/home/kpal/.cargo/registry/src/index.crates.io-6f17d22bba15001f/c2rust-ast-exporter-0.18.0/src/AstExporter.cpp:1507:41: error: ‘getIntegerConstantExpr’ was not declared in this scope
1507 | auto constant = getIntegerConstantExpr(
| ^~~~~~~~~~~~~~~~~~~~~~
/home/kpal/.cargo/registry/src/index.crates.io-6f17d22bba15001f/c2rust-ast-exporter-0.18.0/src/AstExporter.cpp: In lambda function:
/home/kpal/.cargo/registry/src/index.crates.io-6f17d22bba15001f/c2rust-ast-exporter-0.18.0/src/AstExporter.cpp:2285:40: error: ‘clang::StringLiteral::StringKind’ has not been declared
2285 | case clang::StringLiteral::StringKind::Ordinary:
| ^~~~~~~~~~
/home/kpal/.cargo/registry/src/index.crates.io-6f17d22bba15001f/c2rust-ast-exporter-0.18.0/src/AstExporter.cpp:2291:40: error: ‘clang::StringLiteral::StringKind’ has not been declared
2291 | case clang::StringLiteral::StringKind::Wide:
| ^~~~~~~~~~
/home/kpal/.cargo/registry/src/index.crates.io-6f17d22bba15001f/c2rust-ast-exporter-0.18.0/src/AstExporter.cpp:2294:40: error: ‘clang::StringLiteral::StringKind’ has not been declared
2294 | case clang::StringLiteral::StringKind::UTF8:
| ^~~~~~~~~~
/home/kpal/.cargo/registry/src/index.crates.io-6f17d22bba15001f/c2rust-ast-exporter-0.18.0/src/AstExporter.cpp:2297:40: error: ‘clang::StringLiteral::StringKind’ has not been declared
2297 | case clang::StringLiteral::StringKind::UTF16:
| ^~~~~~~~~~
/home/kpal/.cargo/registry/src/index.crates.io-6f17d22bba15001f/c2rust-ast-exporter-0.18.0/src/AstExporter.cpp:2300:40: error: ‘clang::StringLiteral::StringKind’ has not been declared
2300 | case clang::StringLiteral::StringKind::UTF32:
| ^~~~~~~~~~
/home/kpal/.cargo/registry/src/index.crates.io-6f17d22bba15001f/c2rust-ast-exporter-0.18.0/src/AstExporter.cpp: In member function ‘bool TranslateASTVisitor::evaluateConstantInt(clang::Expr
, llvm::APSInt&)’:
/home/kpal/.cargo/registry/src/index.crates.io-6f17d22bba15001f/c2rust-ast-exporter-0.18.0/src/AstExporter.cpp:595:5: warning: control reaches end of non-void function [-Wreturn-type]
595 | }
| ^
gmake[3]: *** [CMakeFiles/clangAstExporter.dir/build.make:76: CMakeFiles/clangAstExporter.dir/AstExporter.cpp.o] Error 1
gmake[2]: *** [CMakeFiles/Makefile2:274: CMakeFiles/clangAstExporter.dir/all] Error 2
gmake[1]: *** [CMakeFiles/Makefile2:281: CMakeFiles/clangAstExporter.dir/rule] Error 2
gmake: *** [Makefile:215: clangAstExporter] Error 2
thread 'main' panicked at /home/kpal/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cmake-0.1.51/src/lib.rs:1100:5:

command did not execute successfully, got: exit status: 2

build script failed, must exit now
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
error: failed to compile c2rust v0.18.0, intermediate artifacts can be found at /tmp/cargo-installxm0a88.
To reuse those artifacts with a future compilation, set the environment variable CARGO_TARGET_DIR to that path.

@thedataking
Copy link
Contributor

What version of LLVM/clang are you building against? If you are using the packages provided by your Linux distro, which distribution are you on? Are you building C2Rust from crates.io or from GitHub?

@sunilhyd
Copy link
Author

Changed Clan to 18 get the same error.
running: cd "/tmp/cargo-installyTl62l/release/build/c2rust-ast-exporter-37f270cc577f1358/out/build" && CMAKE_PREFIX_PATH="" "cmake" "/home/kpal/.cargo/registry/src/index.crates.io-6f17d22bba15001f/c2rust-ast-exporter-0.18.0/src" "-DLLVM_DIR=/usr/lib/llvm-18/lib/cmake/llvm" "-DClang_DIR=/usr/lib/llvm-18/lib/cmake/clang" "-DCMAKE_INSTALL_PREFIX=/tmp/cargo-installyTl62l/release/build/c2rust-ast-exporter-37f270cc577f1358/out" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64 --target=x86_64-unknown-linux-gnu" "-DCMAKE_C_COMPILER=/usr/bin/cc" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64 --target=x86_64-unknown-linux-gnu" "-DCMAKE_CXX_COMPILER=/usr/bin/c++" "-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64 --target=x86_64-unknown-linux-gnu" "-DCMAKE_ASM_COMPILER=/usr/bin/cc" "-DCMAKE_BUILD_TYPE=Release"
-- The C compiler identification is Clang 18.1.8
-- The CXX compiler identification is Clang 18.1.8
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test HAVE_FFI_CALL
-- Performing Test HAVE_FFI_CALL - Success
-- Found FFI: /usr/lib/x86_64-linux-gnu/libffi.so
-- Could NOT find LibEdit (missing: LibEdit_INCLUDE_DIRS LibEdit_LIBRARIES)
-- Performing Test Terminfo_LINKABLE
-- Performing Test Terminfo_LINKABLE - Success
-- Found Terminfo: /usr/lib/x86_64-linux-gnu/libtinfo.so
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.3")
-- Found zstd: /usr/lib/x86_64-linux-gnu/libzstd.so
-- Found LibXml2: /usr/lib/x86_64-linux-gnu/libxml2.so (found version "2.9.14")
-- Found CURL: /usr/lib/x86_64-linux-gnu/libcurl.so (found version "8.5.0")
-- Could NOT find LibEdit (missing: LibEdit_INCLUDE_DIRS LibEdit_LIBRARIES)
-- Configuring done (4.2s)
-- Generating done (0.1s)
-- Build files have been written to: /tmp/cargo-installyTl62l/release/build/c2rust-ast-exporter-37f270cc577f1358/out/build
running: cd "/tmp/cargo-installyTl62l/release/build/c2rust-ast-exporter-37f270cc577f1358/out/build" && MAKEFLAGS="-j --jobserver-fds=8,10 --jobserver-auth=8,10" "cmake" "--build" "." "--target" "clangAstExporter" "--config" "Release"
[ 8%] Creating directories for 'tinycbor_build'
[ 16%] Performing download step (git clone) for 'tinycbor_build'
[ 25%] Performing update step for 'tinycbor_build'
[ 33%] Performing patch step for 'tinycbor_build'
patching file Makefile
patching file Makefile.configure
[ 41%] Performing configure step for 'tinycbor_build'
.config file not yet created
[ 50%] Performing build step for 'tinycbor_build'
[ 58%] Performing install step for 'tinycbor_build'
[ 66%] Completed 'tinycbor_build'
[ 66%] Built target tinycbor_build
[ 75%] Building CXX object CMakeFiles/clangAstExporter.dir/AstExporter.cpp.o

@sunilhyd
Copy link
Author

loning into 'tinycbor_build'...
HEAD is now at d393c16 Parser: fix reading it->extra on big endian when bytesNeeded == 1
make[4]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
make[4]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
make[4]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
make[4]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
/home/kpal/.cargo/registry/src/index.crates.io-6f17d22bba15001f/c2rust-ast-exporter-0.18.0/src/AstExporter.cpp:88:1: error: no template named 'Optional'; did you mean 'std::optional'?
88 | Optional getIntegerConstantExpr(const Expr &E, const ASTContext &Ctx) {
| ^~~~~~~~
| std::optional
/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/optional:707:11: note: 'std::optional' declared here
707 | class optional
| ^
/home/kpal/.cargo/registry/src/index.crates.io-6f17d22bba15001f/c2rust-ast-exporter-0.18.0/src/AstExporter.cpp:1502:63: error: no member named 'getField' in 'clang::DesignatedInitExpr::Designator'
1502 | uintptr_t(designator.getField()));
| ~~~~~~~~~~ ^
/home/kpal/.cargo/registry/src/index.crates.io-6f17d22bba15001f/c2rust-ast-exporter-0.18.0/src/AstExporter.cpp:2285:40: error: no member named 'StringKind' in 'clang::StringLiteral'
2285 | case clang::StringLiteral::StringKind::Ordinary:
| ~~~~~~~~~~~~~~~~~~~~~~^
/home/kpal/.cargo/registry/src/index.crates.io-6f17d22bba15001f/c2rust-ast-exporter-0.18.0/src/AstExporter.cpp:2291:40: error: no member named 'StringKind' in 'clang::StringLiteral'
2291 | case clang::StringLiteral::StringKind::Wide:
| ~~~~~~~~~~~~~~~~~~~~~~^
/home/kpal/.cargo/registry/src/index.crates.io-6f17d22bba15001f/c2rust-ast-exporter-0.18.0/src/AstExporter.cpp:2294:40: error: no member named 'StringKind' in 'clang::StringLiteral'
2294 | case clang::StringLiteral::StringKind::UTF8:
| ~~~~~~~~~~~~~~~~~~~~~~^
/home/kpal/.cargo/registry/src/index.crates.io-6f17d22bba15001f/c2rust-ast-exporter-0.18.0/src/AstExporter.cpp:2297:40: error: no member named 'StringKind' in 'clang::StringLiteral'
2297 | case clang::StringLiteral::StringKind::UTF16:
| ~~~~~~~~~~~~~~~~~~~~~~^
/home/kpal/.cargo/registry/src/index.crates.io-6f17d22bba15001f/c2rust-ast-exporter-0.18.0/src/AstExporter.cpp:2300:40: error: no member named 'StringKind' in 'clang::StringLiteral'
2300 | case clang::StringLiteral::StringKind::UTF32:
| ~~~~~~~~~~~~~~~~~~~~~~^
7 errors generated.
gmake[3]: *** [CMakeFiles/clangAstExporter.dir/build.make:76: CMakeFiles/clangAstExporter.dir/AstExporter.cpp.o] Error 1
gmake[2]: *** [CMakeFiles/Makefile2:274: CMakeFiles/clangAstExporter.dir/all] Error 2
gmake[1]: *** [CMakeFiles/Makefile2:281: CMakeFiles/clangAstExporter.dir/rule] Error 2
gmake: *** [Makefile:215: clangAstExporter] Error 2
thread 'main' panicked at /home/kpal/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cmake-0.1.51/src/lib.rs:1100:5:

command did not execute successfully, got: exit status: 2

build script failed, must exit now
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
error: failed to compile c2rust v0.18.0, intermediate artifacts can be found at /tmp/cargo-installyTl62l.
To reuse those artifacts with a future compilation, set the environment variable CARGO_TARGET_DIR to that path.

@sunilhyd
Copy link
Author

sunilhyd commented Sep 23, 2024 via email

@sunilhyd
Copy link
Author

I got past the initial issues, rust 1.79, clang-14 is needed also sudo apt install libclang-14-dev a dependency for clangbasiclib.a
I will keep you posted
Does anyone know how to run the tests folder with c source files ?
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants