Etto48 / HexPatch

HexPatch: a binary patcher and editor written in Rust with terminal user interface (TUI).
https://etto48.github.io/HexPatch/
MIT License
149 stars 7 forks source link

Unable to compile, cmake failed #114

Open OvermindDL1 opened 1 week ago

OvermindDL1 commented 1 week ago

Describe the bug When running cargo install hex-patch it fails with:

Compiling mlua v0.9.9
   Compiling pdb v0.8.0
error: failed to run custom build command for `keystone-engine v0.1.0`

Caused by:
  process didn't exit successfully: `/tmp/cargo-installulYd3V/release/build/keystone-engine-94d53d2e7c1ab5b4/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-installulYd3V/release/build/keystone-engine-35fc3ba6664cacb7/out/build" && CMAKE_PREFIX_PATH="" PYTHONDONTWRITEBYTECODE="1" "cmake" "/home/overminddl1/.cargo/registry/src/index.crates.io-6f17d22bba15001f/keystone-engine-0.1.0/keystone" "-DCMAKE_INSTALL_LIBDIR=lib" "-DBUILD_LIBS_ONLY=1" "-DBUILD_SHARED_LIBS=OFF" "-DLLVM_TARGETS_TO_BUILD=all" "-DCMAKE_INSTALL_PREFIX=/tmp/cargo-installulYd3V/release/build/keystone-engine-35fc3ba6664cacb7/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
  -- The ASM compiler identification is GNU
  -- Found assembler: /usr/bin/cc
  -- Looking for dirent.h
  -- Looking for dirent.h - found
  -- Looking for dlfcn.h
  -- Looking for dlfcn.h - found
  -- Looking for errno.h
  -- Looking for errno.h - found
  -- Looking for execinfo.h
  -- Looking for execinfo.h - found
  -- Looking for fcntl.h
  -- Looking for fcntl.h - found
  -- Looking for inttypes.h
  -- Looking for inttypes.h - found
  -- Looking for limits.h
  -- Looking for limits.h - found
  -- Looking for link.h
  -- Looking for link.h - found
  -- Looking for malloc.h
  -- Looking for malloc.h - found
  -- Looking for malloc/malloc.h
  -- Looking for malloc/malloc.h - not found
  -- Looking for ndir.h
  -- Looking for ndir.h - not found
  -- Looking for pthread.h
  -- Looking for pthread.h - found
  -- Looking for signal.h
  -- Looking for signal.h - found
  -- Looking for stdint.h
  -- Looking for stdint.h - found
  -- Looking for sys/dir.h
  -- Looking for sys/dir.h - found
  -- Looking for sys/ioctl.h
  -- Looking for sys/ioctl.h - found
  -- Looking for sys/mman.h
  -- Looking for sys/mman.h - found
  -- Looking for sys/ndir.h
  -- Looking for sys/ndir.h - not found
  -- Looking for sys/param.h
  -- Looking for sys/param.h - found
  -- Looking for sys/resource.h
  -- Looking for sys/resource.h - found
  -- Looking for sys/stat.h
  -- Looking for sys/stat.h - found
  -- Looking for sys/time.h
  -- Looking for sys/time.h - found
  -- Looking for sys/uio.h
  -- Looking for sys/uio.h - found
  -- Looking for termios.h
  -- Looking for termios.h - found
  -- Looking for unistd.h
  -- Looking for unistd.h - found
  -- Looking for utime.h
  -- Looking for utime.h - found
  -- Looking for zlib.h
  -- Looking for zlib.h - found
  -- Looking for fenv.h
  -- Looking for fenv.h - found
  -- Looking for FE_ALL_EXCEPT
  -- Looking for FE_ALL_EXCEPT - found
  -- Looking for FE_INEXACT
  -- Looking for FE_INEXACT - found
  -- Looking for mach/mach.h
  -- Looking for mach/mach.h - not found
  -- Looking for mach-o/dyld.h
  -- Looking for mach-o/dyld.h - not found
  -- Looking for histedit.h
  -- Looking for histedit.h - not found
  -- Performing Test HAVE_CXXABI_H
  -- Performing Test HAVE_CXXABI_H - Success
  -- Looking for pthread_create in pthread
  -- Looking for pthread_create in pthread - found
  -- Looking for pthread_getspecific in pthread
  -- Looking for pthread_getspecific in pthread - found
  -- Looking for pthread_rwlock_init in pthread
  -- Looking for pthread_rwlock_init in pthread - found
  -- Looking for pthread_mutex_lock in pthread
  -- Looking for pthread_mutex_lock in pthread - found
  -- Looking for dlopen in dl
  -- Looking for dlopen in dl - found
  -- Looking for clock_gettime in rt
  -- Looking for clock_gettime in rt - found
  -- Looking for compress2 in z
  -- Looking for compress2 in z - found
  -- Looking for setupterm in tinfo
  -- Looking for setupterm in tinfo - found
  -- Looking for arc4random
  -- Looking for arc4random - found
  -- Looking for backtrace
  -- Looking for backtrace - found
  -- Looking for getpagesize
  -- Looking for getpagesize - found
  -- Looking for getrusage
  -- Looking for getrusage - found
  -- Looking for setrlimit
  -- Looking for setrlimit - found
  -- Looking for isatty
  -- Looking for isatty - found
  -- Looking for futimens
  -- Looking for futimens - found
  -- Looking for futimes
  -- Looking for futimes - found
  -- Looking for writev
  -- Looking for writev - found
  -- Looking for mallctl
  -- Looking for mallctl - not found
  -- Looking for mallinfo
  -- Looking for mallinfo - found
  -- Looking for malloc_zone_statistics
  -- Looking for malloc_zone_statistics - not found
  -- Looking for mkdtemp
  -- Looking for mkdtemp - found
  -- Looking for mkstemp
  -- Looking for mkstemp - found
  -- Looking for mktemp
  -- Looking for mktemp - found
  -- Looking for closedir
  -- Looking for closedir - found
  -- Looking for opendir
  -- Looking for opendir - found
  -- Looking for readdir
  -- Looking for readdir - found
  -- Looking for getcwd
  -- Looking for getcwd - found
  -- Looking for gettimeofday
  -- Looking for gettimeofday - found
  -- Looking for getrlimit
  -- Looking for getrlimit - found
  -- Looking for posix_spawn
  -- Looking for posix_spawn - found
  -- Looking for pread
  -- Looking for pread - found
  -- Looking for realpath
  -- Looking for realpath - found
  -- Looking for sbrk
  -- Looking for sbrk - found
  -- Looking for srand48
  -- Looking for srand48 - found
  -- Looking for lrand48
  -- Looking for lrand48 - found
  -- Looking for drand48
  -- Looking for drand48 - found
  -- Looking for strtoll
  -- Looking for strtoll - found
  -- Looking for strtoq
  -- Looking for strtoq - found
  -- Looking for strerror
  -- Looking for strerror - found
  -- Looking for strerror_r
  -- Looking for strerror_r - found
  -- Looking for strerror_s
  -- Looking for strerror_s - not found
  -- Looking for setenv
  -- Looking for setenv - found
  -- Looking for dlerror
  -- Looking for dlerror - found
  -- Looking for dlopen
  -- Looking for dlopen - found
  -- Looking for __GLIBC__
  -- Looking for __GLIBC__ - found
  -- Performing Test HAVE_INT64_T
  -- Performing Test HAVE_INT64_T - Success
  -- Performing Test HAVE_UINT64_T
  -- Performing Test HAVE_UINT64_T - Success
  -- Performing Test HAVE_U_INT64_T
  -- Performing Test HAVE_U_INT64_T - Success
  -- Performing Test HAVE_CXX_ATOMICS_WITHOUT_LIB
  -- Performing Test HAVE_CXX_ATOMICS_WITHOUT_LIB - Success
  -- Performing Test LLVM_HAS_ATOMICS
  -- Performing Test LLVM_HAS_ATOMICS - Success
  -- Performing Test SUPPORTS_NO_VARIADIC_MACROS_FLAG
  -- Performing Test SUPPORTS_NO_VARIADIC_MACROS_FLAG - Success
  -- Performing Test HAS_MAYBE_UNINITIALIZED
  -- Performing Test HAS_MAYBE_UNINITIALIZED - Success
  -- Target triple: x86_64-unknown-linux-gnu
  -- Native target architecture is X86
  -- Threads enabled.
  -- Performing Test C_SUPPORTS_FPIC
  -- Performing Test C_SUPPORTS_FPIC - Success
  -- Performing Test CXX_SUPPORTS_FPIC
  -- Performing Test CXX_SUPPORTS_FPIC - Success
  -- Building with -fPIC
  -- Performing Test SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG
  -- Performing Test SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG - Success
  -- Performing Test CXX_SUPPORTS_MISSING_FIELD_INITIALIZERS_FLAG
  -- Performing Test CXX_SUPPORTS_MISSING_FIELD_INITIALIZERS_FLAG - Success
  -- Performing Test C_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG
  -- Performing Test C_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG - Failed
  -- Performing Test CXX_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG
  -- Performing Test CXX_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG - Failed
  -- Performing Test C_SUPPORTS_DELETE_NON_VIRTUAL_DTOR_FLAG
  -- Performing Test C_SUPPORTS_DELETE_NON_VIRTUAL_DTOR_FLAG - Failed
  -- Performing Test CXX_SUPPORTS_DELETE_NON_VIRTUAL_DTOR_FLAG
  -- Performing Test CXX_SUPPORTS_DELETE_NON_VIRTUAL_DTOR_FLAG - Success
  -- Performing Test C_WCOMMENT_ALLOWS_LINE_WRAP
  -- Performing Test C_WCOMMENT_ALLOWS_LINE_WRAP - Failed
  -- Performing Test CXX_SUPPORTS_CXX11
  -- Performing Test CXX_SUPPORTS_CXX11 - Success
  -- Performing Test C_SUPPORTS_FNO_FUNCTION_SECTIONS
  -- Performing Test C_SUPPORTS_FNO_FUNCTION_SECTIONS - Success
  -- Performing Test C_SUPPORTS_FFUNCTION_SECTIONS
  -- Performing Test C_SUPPORTS_FFUNCTION_SECTIONS - Success
  -- Performing Test CXX_SUPPORTS_FFUNCTION_SECTIONS
  -- Performing Test CXX_SUPPORTS_FFUNCTION_SECTIONS - Success
  -- Performing Test C_SUPPORTS_FDATA_SECTIONS
  -- Performing Test C_SUPPORTS_FDATA_SECTIONS - Success
  -- Performing Test CXX_SUPPORTS_FDATA_SECTIONS
  -- Performing Test CXX_SUPPORTS_FDATA_SECTIONS - Success
  -- Found PythonInterp: /home/overminddl1/.asdf/shims/python2.7
  -- Configuring incomplete, errors occurred!

  --- stderr
  CMake Deprecation Warning at CMakeLists.txt:4 (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 Deprecation Warning at CMakeLists.txt:27 (cmake_policy):
    The OLD behavior for policy CMP0051 will be removed from a future version
    of CMake.

    The cmake-policies(7) manual explains that the OLD behaviors of all
    policies are deprecated and that a policy should be set to OLD only under
    specific short-term circumstances.  Projects should be ported to the NEW
    behavior and not rely on setting a policy to OLD.

  CMake Deprecation Warning at llvm/CMakeLists.txt:3 (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 Deprecation Warning at llvm/CMakeLists.txt:22 (cmake_policy):
    The OLD behavior for policy CMP0051 will be removed from a future version
    of CMake.

    The cmake-policies(7) manual explains that the OLD behaviors of all
    policies are deprecated and that a policy should be set to OLD only under
    specific short-term circumstances.  Projects should be ported to the NEW
    behavior and not rely on setting a policy to OLD.

  CMake Warning (dev) at /home/overminddl1/.asdf/installs/cmake/3.28.2/share/cmake-3.28/Modules/CheckIncludeFile.cmake:77 (message):
    Policy CMP0075 is not set: Include file check macros honor
    CMAKE_REQUIRED_LIBRARIES.  Run "cmake --help-policy CMP0075" for policy
    details.  Use the cmake_policy command to set the policy and suppress this
    warning.

    CMAKE_REQUIRED_LIBRARIES is set to:

      m

    For compatibility with CMake 3.11 and below this check is ignoring it.
  Call Stack (most recent call first):
    llvm/cmake/config-ix.cmake:45 (check_include_file)
    llvm/CMakeLists.txt:324 (include)
  This warning is for project developers.  Use -Wno-dev to suppress it.

  CMake Warning (dev) at llvm/CMakeLists.txt:338 (include):
    Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
    are removed.  Run "cmake --help-policy CMP0148" for policy details.  Use
    the cmake_policy command to set the policy and suppress this warning.

  This warning is for project developers.  Use -Wno-dev to suppress it.

  CMake Error at llvm/CMakeLists.txt:346 (if):
    if given arguments:

      "VERSION_LESS" "2.7"

    Unknown arguments specified

  thread 'main' panicked at /home/overminddl1/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cmake-0.1.51/src/lib.rs:1100:5:

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

  build script failed, must exit now
  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 `hex-patch v1.8.0`, intermediate artifacts can be found at `/tmp/cargo-installulYd3V`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

Dependency versions:

2024-09-04 07:39:40 : overminddl1@🌐zsh~ via 🌙 v5.2.1
❯ cmake --version
cmake version 3.28.2

CMake suite maintained and supported by Kitware (kitware.com/cmake).

2024-09-04 07:39:49 : overminddl1@🌐zsh~ via 🌙 v5.2.1
❯ cargo --version
cargo 1.80.1 (376290515 2024-07-16)

2024-09-04 07:39:57 : overminddl1@🌐zsh~ via 🌙 v5.2.1

❯ gcc --version
gcc (Ubuntu 13.2.0-23ubuntu4) 13.2.0

Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

2024-09-04 07:46:15 : overminddl1@🌐zsh~ via 🌙 v5.2.1
❯ python3 --version
Python 3.12.3

To Reproduce Steps to reproduce the behavior: All I do is run: cargo install hex-patch

Expected behavior

Expected it to compile and install

Desktop (please complete the following information):

❯ cargo install hex-patch
    Updating crates.io index
  Downloaded hex-patch v1.8.0
  Downloaded 1 crate (4.1 MB) in 0.96s
  Installing hex-patch v1.8.0
...snip...
OvermindDL1 commented 1 week ago

... Pretty sure a Windows program won't help on Linux, and this seems suspiciously virusy the way it's distributed...

Etto48 commented 1 week ago

I'm quite confused, but I found this, maybe the problem you are having will be fixed if you install Python 2, could you try and let me know?

Etto48 commented 1 week ago

... Pretty sure a Windows program won't help on Linux, and this seems suspiciously virusy the way it's distributed...

I don't think I understand, could you explain better what program you are referring to?