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

failed to run custom build command for c2rust-ast-exporter v0.16.0 #713

Closed
DmitrySorda opened this issue Nov 1, 2022 · 6 comments
Closed
Assignees

Comments

@DmitrySorda
Copy link

DmitrySorda commented Nov 1, 2022

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`
@rinon
Copy link
Contributor

rinon commented Nov 1, 2022

Looks like there's a compatibility issue with Apple's Clang 14, @thedataking maybe you can test that locally?

@kkysen
Copy link
Contributor

kkysen commented Nov 1, 2022

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.

@DmitrySorda
Copy link
Author

Here is what I get

LLVM_CONFIG_PATH=/usr/local/opt/llvm/bin/llvm-config cargo build --release
Finished release [optimized] target(s) in 7m 26s

but,

LLVM_CONFIG_PATH=/usr/local/opt/llvm/bin/llvm-config cargo install --git https://github.com/immunant/c2rust.git c2rust

**Compiling c2rust-ast-exporter v0.16.0 (/Users/tatyana/.cargo/git/checkouts/c2rust-2a3ef4c32beab81a/4d19f75/c2rust-ast-exporter)**


error: failed to run custom build command for `c2rust-ast-exporter v0.16.0 (/Users/tatyana/.cargo/git/checkouts/c2rust-2a3ef4c32beab81a/4d19f75/c2rust-ast-exporter)`

Caused by:
  process didn't exit successfully: `/var/folders/_g/ygkxl47d45qcvnmwmhfzh_200000gn/T/cargo-installDej2Vy/release/build/c2rust-ast-exporter-324858b8874ea43d/build-script-build` (exit status: 101)
  --- stdout
  running: "cmake" "/Users/tatyana/.cargo/git/checkouts/c2rust-2a3ef4c32beab81a/4d19f75/c2rust-ast-exporter/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-installDej2Vy/release/build/c2rust-ast-exporter-ba8aac8df5703c22/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-installDej2Vy/release/build/c2rust-ast-exporter-ba8aac8df5703c22/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-installDej2Vy/release/build/c2rust-ast-exporter-ba8aac8df5703c22/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-installDej2Vy/release/build/c2rust-ast-exporter-ba8aac8df5703c22/out/build/tinycbor/src/v0.5.3.tar.gz'
  -- Downloading... done
  -- extracting...
       src='/private/var/folders/_g/ygkxl47d45qcvnmwmhfzh_200000gn/T/cargo-installDej2Vy/release/build/c2rust-ast-exporter-ba8aac8df5703c22/out/build/tinycbor/src/v0.5.3.tar.gz'
       dst='/private/var/folders/_g/ygkxl47d45qcvnmwmhfzh_200000gn/T/cargo-installDej2Vy/release/build/c2rust-ast-exporter-ba8aac8df5703c22/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%] 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'

  --- 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


  install: mkdir /private/var/folders/_g/ygkxl47d45qcvnmwmhfzh_200000gn/T/cargo-installDej2Vy/release/build/c2rust-ast-exporter-ba8aac8df5703c22/out/build/lib: File exists
  make[4]: *** [/private/var/folders/_g/ygkxl47d45qcvnmwmhfzh_200000gn/T/cargo-installDej2Vy/release/build/c2rust-ast-exporter-ba8aac8df5703c22/out/build/lib/pkgconfig/tinycbor.pc] Error 71
  make[4]: *** Waiting for unfinished jobs....
  make[3]: *** [tinycbor/src/tinycbor_build-stamp/tinycbor_build-install] Error 2
  make[2]: *** [CMakeFiles/tinycbor_build.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 (https://github.com/immunant/c2rust.git#4d19f750)`, intermediate artifacts can be found at `/var/folders/_g/ygkxl47d45qcvnmwmhfzh_200000gn/T/cargo-installDej2Vy

MacOS Ventura 13.0

@DmitrySorda
Copy link
Author

I don’t know what happened, but I ran the command again

LLVM_CONFIG_PATH=/usr/local/opt/llvm/bin/llvm-config cargo install --git https://github.com/immunant/c2rust.git c2rust

and everything was installed

@thedataking
Copy link
Contributor

@DmitrySorda thanks for the follow up. Closing issue. Feel free to reopen if there is indeed an issue on the master branch.

@ngortheone
Copy link

ngortheone commented Jan 3, 2023

OS: FreeBSD 14, x86_64

This is still failing for me with this command:
LLVM_CONFIG_PATH=/usr/local/bin/llvm-config15 cargo install --git https://github.com/immunant/c2rust.git c2rust

 [ 41%] Performing configure step for 'tinycbor_build'

  --- stderr
  CMake Warning (dev) at /usr/local/share/cmake/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):
    /usr/local/share/cmake/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


  make[4]: illegal argument to -j -- must be positive integer!
  gmake[3]: *** [CMakeFiles/tinycbor_build.dir/build.make:92: tinycbor/src/tinycbor_build-stamp/tinycbor_build-configure] Error 2
  gmake[2]: *** [CMakeFiles/Makefile2:91: CMakeFiles/tinycbor_build.dir/all] Error 2
  gmake[1]: *** [CMakeFiles/Makefile2:254: CMakeFiles/clangAstExporter.dir/rule] Error 2
  gmake: *** [Makefile:202: clangAstExporter] Error 2
  thread 'main' panicked at '
  command did not execute successfully, got: exit status: 2

  build script failed, must exit now', /home/ngor/.local/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
warning: build failed, waiting for other jobs to finish...
error: failed to compile `c2rust v0.16.0 (https://github.com/immunant/c2rust.git#5ce9db6f)`, intermediate artifacts can be found at `/tmp/cargo-installQRbPp5`

EDIT: happens with LLVM_CONFIG_PATH=/usr/local/bin/llvm-config13 as well

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

5 participants