Repository: immunant/c2rust

Issue #676: `c2rust` fails to build with LLVM 15
Created: 2022-09-22T20:02:44Z
--- stderr
  CMake Warning:
    Manually-specified variables were not used by the project:

      CMAKE_ASM_COMPILER
      CMAKE_ASM_FLAGS


  * Closing connection 0
  * Closing connection 1
  /Users/jrmuizel/.cargo/git/checkouts/c2rust-2a3ef4c32beab81a/1fddfc4/c2rust-ast-exporter/src/AstExporter.cpp:2270:52: error: no member named 'Ascii' in 'clang::StringLiteral::StringKind'
              case clang::StringLiteral::StringKind::Ascii:
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
  1 error generated.
  make[3]: *** [CMakeFiles/clangAstExporter.dir/AstExporter.cpp.o] Error 1
  make[2]: *** [CMakeFiles/clangAstExporter.dir/all] Error 2
  make[1]: *** [CMakeFiles/clangAstExporter.dir/rule] Error 2

Duplicate issue #713: failed to run custom build command for `c2rust-ast-exporter v0.16.0`
Created: 2022-11-01T12:04:35Z
Caused by:
  process didn't exit successfully: `/var/folders/_g/ygkxl47d45qcvnmwmhfzh_200000gn/T/cargo-installlJ4XZk/release/build/c2rust-ast-exporter-4c3863d219fc4a88/build-script-build` (exit status: 101)
  --- stdout
  running: "cmake" "/Users/tatyana/.cargo/registry/src/github.com-1ecc6299db9ec823/c2rust-ast-exporter-0.16.0/src" "-DLLVM_DIR=/usr/local/Cellar/llvm/15.0.3/lib/cmake/llvm" "-DClang_DIR=/usr/local/Cellar/llvm/15.0.3/lib/cmake/clang" "-DCMAKE_INSTALL_PREFIX=/var/folders/_g/ygkxl47d45qcvnmwmhfzh_200000gn/T/cargo-installlJ4XZk/release/build/c2rust-ast-exporter-35012359bc93ef51/out" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64 -arch x86_64" "-DCMAKE_C_COMPILER=/usr/bin/cc" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64 -arch x86_64" "-DCMAKE_CXX_COMPILER=/usr/bin/c++" "-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64 -arch x86_64" "-DCMAKE_ASM_COMPILER=/usr/bin/cc" "-DCMAKE_BUILD_TYPE=Release"
  -- The C compiler identification is AppleClang 14.0.0.14000029
  -- The CXX compiler identification is AppleClang 14.0.0.14000029
  -- 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: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/lib/libffi.tbd  
  -- Performing Test Terminfo_LINKABLE
  -- Performing Test Terminfo_LINKABLE - Success
  -- Found Terminfo: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/lib/libcurses.tbd  
  -- Found ZLIB: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/lib/libz.tbd (found version "1.2.11") 
  -- Found zstd: /usr/local/lib/libzstd.dylib  
  -- Found LibXml2: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/lib/libxml2.tbd (found version "2.9.4") 
  -- Configuring done
  -- Generating done
  -- Build files have been written to: /private/var/folders/_g/ygkxl47d45qcvnmwmhfzh_200000gn/T/cargo-installlJ4XZk/release/build/c2rust-ast-exporter-35012359bc93ef51/out/build
  running: "cmake" "--build" "." "--target" "clangAstExporter" "--config" "Release" "--"
  [  8%] Creating directories for 'tinycbor_build'
  [ 16%] Performing download step (download, verify and extract) for 'tinycbor_build'
  -- Downloading...
     dst='/private/var/folders/_g/ygkxl47d45qcvnmwmhfzh_200000gn/T/cargo-installlJ4XZk/release/build/c2rust-ast-exporter-35012359bc93ef51/out/build/tinycbor/src/v0.5.3.tar.gz'
     timeout='none'
     inactivity timeout='none'
  -- Using src='https://github.com/intel/tinycbor/archive/v0.5.3.tar.gz'
  -- verifying file...
         file='/private/var/folders/_g/ygkxl47d45qcvnmwmhfzh_200000gn/T/cargo-installlJ4XZk/release/build/c2rust-ast-exporter-35012359bc93ef51/out/build/tinycbor/src/v0.5.3.tar.gz'
  -- Downloading... done
  -- extracting...
       src='/private/var/folders/_g/ygkxl47d45qcvnmwmhfzh_200000gn/T/cargo-installlJ4XZk/release/build/c2rust-ast-exporter-35012359bc93ef51/out/build/tinycbor/src/v0.5.3.tar.gz'
       dst='/private/var/folders/_g/ygkxl47d45qcvnmwmhfzh_200000gn/T/cargo-installlJ4XZk/release/build/c2rust-ast-exporter-35012359bc93ef51/out/build/tinycbor/src/tinycbor_build'
  -- extracting... [tar xfz]
  -- extracting... [analysis]
  -- extracting... [rename]
  -- extracting... [clean up]
  -- extracting... done
  [ 25%] No update step for 'tinycbor_build'
  [ 33%] Performing patch step for 'tinycbor_build'
  patching file Makefile
  patching file Makefile.configure
  [ 41%] No configure step for 'tinycbor_build'
  [ 50%] Performing build step for 'tinycbor_build'
  .config file not yet created
  [ 58%] Performing install step for 'tinycbor_build'
  [ 66%] Completed 'tinycbor_build'
  [ 66%] Built target tinycbor_build
  [ 91%] Building CXX object CMakeFiles/clangAstExporter.dir/ExportResult.cpp.o
  [ 91%] Building CXX object CMakeFiles/clangAstExporter.dir/AstExporter.cpp.o
  [ 91%] Building CXX object CMakeFiles/clangAstExporter.dir/FloatingLexer.cpp.o

  --- stderr
  CMake Warning (dev) at /Applications/CMake.app/Contents/share/cmake-3.24/Modules/ExternalProject.cmake:3074 (message):
    The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is
    not set.  The policy's OLD behavior will be used.  When using a URL
    download, the timestamps of extracted files should preferably be that of
    the time of extraction, otherwise code that depends on the extracted
    contents might not be rebuilt if the URL changes.  The OLD behavior
    preserves the timestamps from the archive instead, but this is usually not
    what you want.  Update your project to the NEW behavior or specify the
    DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this
    robustness issue.
  Call Stack (most recent call first):
    /Applications/CMake.app/Contents/share/cmake-3.24/Modules/ExternalProject.cmake:4170 (_ep_add_download_command)
    CMakeLists.txt:13 (ExternalProject_Add)
  This warning is for project developers.  Use -Wno-dev to suppress it.

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

      CMAKE_ASM_COMPILER
      CMAKE_ASM_FLAGS


  /Users/tatyana/.cargo/registry/src/github.com-1ecc6299db9ec823/c2rust-ast-exporter-0.16.0/src/AstExporter.cpp:2248:52: error: no member named 'Ascii' in 'clang::StringLiteral::StringKind'
              case clang::StringLiteral::StringKind::Ascii:
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
  1 error generated.
  make[3]: *** [CMakeFiles/clangAstExporter.dir/AstExporter.cpp.o] Error 1
  make[2]: *** [CMakeFiles/clangAstExporter.dir/all] Error 2
  make[1]: *** [CMakeFiles/clangAstExporter.dir/rule] Error 2
  make: *** [clangAstExporter] Error 2
  thread 'main' panicked at '
  command did not execute successfully, got: exit status: 2

  build script failed, must exit now', /Users/tatyana/.cargo/registry/src/github.com-1ecc6299db9ec823/cmake-0.1.45/src/lib.rs:894:5
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: failed to compile `c2rust v0.16.0`, intermediate artifacts can be found at `/var/folders/_g/ygkxl47d45qcvnmwmhfzh_200000gn/T/cargo-installlJ4XZk`

Closing comment (2022-11-01T16:41:19Z): I think we may have just fixed this already.  @DmitrySorda, can you test this on master?  The latest published version is pretty old.  See the duplicate #676 and fix in #677.