Skip to content

Issue with 0.1.49 on Windows i686 cross compilation #171

Open
@elast0ny

Description

@elast0ny

The latest patch bump of cmake-rs broke our CD/CI when cross compiling to Windows x86 on x86_64 Windows hosts.

The error logs are somewhat misleading but we were able to identify that the root cause was the automatic update from 0.1.48 to 0.1.49 :

error: failed to run custom build command for `my-crate-sys v2.0.12 (C:\tmp\my-crate\my-crate-sys)`

Caused by:
  process didn't exit successfully: `C:\tmp\my-crate\target\debug\build\my-crate-sys-3968ddac5f286e98\build-script-build` (exit code: 101)
  --- stdout
  CMAKE_TOOLCHAIN_FILE_i686-pc-windows-msvc = None
  CMAKE_TOOLCHAIN_FILE_i686_pc_windows_msvc = None
  TARGET_CMAKE_TOOLCHAIN_FILE = None
  CMAKE_TOOLCHAIN_FILE = None
  CMAKE_PREFIX_PATH_i686-pc-windows-msvc = None
  CMAKE_PREFIX_PATH_i686_pc_windows_msvc = None
  TARGET_CMAKE_PREFIX_PATH = None
  CMAKE_PREFIX_PATH = None
  CMAKE_i686-pc-windows-msvc = None
  CMAKE_i686_pc_windows_msvc = None
  TARGET_CMAKE = None
  CMAKE = None
  running: "cmake" "C:\\tmp\\my-crate\\my-crate-sys\\xgboost" "-G" "Ninja" "-DUSE_CUDA=OFF" "-DUSE_OPENMP=OFF" "-DBUILD_STATIC_LIB=ON" "-DCMAKE_INSTALL_PREFIX=C:\\tmp\\my-crate\\target\\i686-pc-windows-msvc\\debug\\build\\my-crate-sys-92f6057c6e2a7e9f\\out\\opt" "-DCMAKE_INSTALL_LIBDIR=C:\\tmp\\my-crate\\target\\i686-pc-windows-msvc\\debug\\build\\my-crate-sys-92f6057c6e2a7e9f\\out\\opt\\lib" "-DDMLC_LOG_CUSTOMIZE=1" "-DRABIT_CUSTOMIZE_MSG_=1" "-DFORCE_SHARED_CRT=ON" "-DCMAKE_CXX_FLAGS_DEBUG=/Z7 /EHs /MD" "-DCMAKE_C_FLAGS_DEBUG=/Z7 /EHs /MD" "-DCMAKE_CXX_FLAGS_RELEASE=/Z7 /EHs" "-DCMAKE_C_FLAGS_RELEASE=/Z7 /EHs" "-DCMAKE_SYSTEM_NAME=windows" "-DCMAKE_SYSTEM_PROCESSOR=x86" "-DCMAKE_C_FLAGS= -nologo -MD -Brepro" "-DCMAKE_C_COMPILER=C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.28.29910/bin/HostX86/x86/cl.exe" "-DCMAKE_CXX_FLAGS= -nologo -MD -Brepro" "-DCMAKE_CXX_COMPILER=C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.28.29910/bin/HostX86/x86/cl.exe" "-DCMAKE_ASM_FLAGS= -nologo -MD -Brepro" "-DCMAKE_ASM_COMPILER=C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.28.29910/bin/HostX86/x86/cl.exe" "-DCMAKE_BUILD_TYPE=Debug"
  -- The CXX compiler identification is MSVC 19.28.29924.0
  -- The C compiler identification is MSVC 19.28.29924.0
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.28.29910/bin/HostX86/x86/cl.exe - skipped
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.28.29910/bin/HostX86/x86/cl.exe - skipped
  -- Detecting C compile features
  -- Detecting C compile features - done
  -- CMake version 3.24.0-rc2
  -- Performing Test XGBOOST_MM_PREFETCH_PRESENT
  -- Performing Test XGBOOST_MM_PREFETCH_PRESENT - Success
  -- Performing Test XGBOOST_BUILTIN_PREFETCH_PRESENT
  -- Performing Test XGBOOST_BUILTIN_PREFETCH_PRESENT - Failed
  -- xgboost VERSION: 1.6.1
  -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
  -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
  -- Looking for pthread_create in pthreads
  -- Looking for pthread_create in pthreads - not found
  -- Looking for pthread_create in pthread
  -- Looking for pthread_create in pthread - not found
  -- Check if compiler accepts -pthread
  -- Check if compiler accepts -pthread - no
  -- Configuring incomplete, errors occurred!
  See also "C:/tmp/my-crate/target/i686-pc-windows-msvc/debug/build/my-crate-sys-92f6057c6e2a7e9f/out/build/CMakeFiles/CMakeOutput.log".
  See also "C:/tmp/my-crate/target/i686-pc-windows-msvc/debug/build/my-crate-sys-92f6057c6e2a7e9f/out/build/CMakeFiles/CMakeError.log".

  --- stderr
  CMake Error at C:/Program Files/CMake/share/cmake-3.24/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
    Could NOT find Threads (missing: Threads_FOUND)
  Call Stack (most recent call first):
    C:/Program Files/CMake/share/cmake-3.24/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
    C:/Program Files/CMake/share/cmake-3.24/Modules/FindThreads.cmake:226 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
    CMakeLists.txt:163 (find_package)


  thread 'main' panicked at '
  command did not execute successfully, got: exit code: 1

  build script failed, must exit now', C:\tmp\.cargo\registry\src\github.com-1ecc6299db9ec823\cmake-0.1.49\src\lib.rs:1104:5

One noticeable change from 0.1.48 is that the failing cmake command now has new arguments :
"-DCMAKE_SYSTEM_NAME=windows" "-DCMAKE_SYSTEM_PROCESSOR=x86"

But its not clear to me why this would cause the failure seen above...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions