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 grpcio-sys v0.5.3 #465

Closed
blackredscarf opened this issue Jun 1, 2020 · 8 comments
Closed

Failed to run custom build command for grpcio-sys v0.5.3 #465

blackredscarf opened this issue Jun 1, 2020 · 8 comments

Comments

@blackredscarf
Copy link

Describe the bug
Build error:

   Compiling grpcio-sys v0.5.3
error: failed to run custom build command for `grpcio-sys v0.5.3`

Caused by:
  process didn't exit successfully: `D:\code\Rust\testgrpc\target\debug\build\grpcio-sys-01f19ba450163add\build-script-build` (exit code: 101)
--- stdout
cargo:rerun-if-changed=grpc_wrap.cc
cargo:rerun-if-changed=grpc
cargo:rerun-if-env-changed=UPDATE_BIND
cargo:rerun-if-env-changed=CARGO_CFG_TARGET_OS
cargo:rerun-if-env-changed=GRPCIO_SYS_USE_PKG_CONFIG
cargo:rerun-if-env-changed=CARGO_CFG_TARGET_OS
cargo:rustc-link-search=native=D:\code\Rust\testgrpc\target\debug\build\libz-sys-668b5b3e353e0033\out/build
cargo:rustc-link-search=native=D:\code\Rust\testgrpc\target\debug\build\libz-sys-668b5b3e353e0033\out/lib
running: "cmake" "D:\\local\\cargo\\registry\\src\\crates.rustcc.cn-46a557d00542c05f\\grpcio-sys-0.5.3\\grpc" "-G" "MinGW Makefiles" "-DgRPC_INSTALL=false" "-DgRPC_BUILD_CSHARP_EXT=false" "-DgRPC_BUILD_CODEGEN=false" "-DgRPC_BENCHMARK_PROVIDER=none" "-DgRPC_ZLIB_PROVIDER=package" "-DCMAKE_INSTALL_PREFIX=D:\\code\\Rust\\testgrpc\\target\\debug\\build\\grpcio-sys-e93dd343e659ed77\\out" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -m64" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -m64" "-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -m64" "-DCMAKE_BUILD_TYPE=Debug"
-- Configuring incomplete, errors occurred!
See also "D:/code/Rust/testgrpc/target/debug/build/grpcio-sys-e93dd343e659ed77/out/build/CMakeFiles/CMakeOutput.log".
See also "D:/code/Rust/testgrpc/target/debug/build/grpcio-sys-e93dd343e659ed77/out/build/CMakeFiles/CMakeError.log".

--- stderr
CMake Warning at cmake/protobuf.cmake:47 (message):
  gRPC_PROTOBUF_PROVIDER is "module" but PROTOBUF_ROOT_DIR is wrong
Call Stack (most recent call first):
  CMakeLists.txt:151 (include)


CMake Error at D:/Lib/cmake-3.15/share/cmake-3.15/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find Perl (missing: PERL_EXECUTABLE)
Call Stack (most recent call first):
  D:/Lib/cmake-3.15/share/cmake-3.15/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  D:/Lib/cmake-3.15/share/cmake-3.15/Modules/FindPerl.cmake:76 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  third_party/boringssl/CMakeLists.txt:32 (find_package)


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

build script failed, must exit now', D:\local\cargo\registry\src\crates.rustcc.cn-46a557d00542c05f\cmake-0.1.44\src\lib.rs:885:5
stack backtrace:
   0: backtrace::backtrace::dbghelp::trace
             at C:\Users\VssAdministrator\.cargo\registry\src\github.jparrowsec.cn-1ecc6299db9ec823\backtrace-0.3.40\src\backtrace/dbghelp.rs:88
   1: backtrace::backtrace::trace_unsynchronized
             at C:\Users\VssAdministrator\.cargo\registry\src\github.jparrowsec.cn-1ecc6299db9ec823\backtrace-0.3.40\src\backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print_fmt
             at src\libstd\sys_common/backtrace.rs:77
   3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
             at src\libstd\sys_common/backtrace.rs:59
   4: core::fmt::write
             at src\libcore\fmt/mod.rs:1052
   5: std::io::Write::write_fmt
             at src\libstd\io/mod.rs:1426
   6: std::sys_common::backtrace::_print
             at src\libstd\sys_common/backtrace.rs:62
   7: std::sys_common::backtrace::print
             at src\libstd\sys_common/backtrace.rs:49
   8: std::panicking::default_hook::{{closure}}
             at src\libstd/panicking.rs:204
   9: std::panicking::default_hook
             at src\libstd/panicking.rs:224
  10: std::panicking::rust_panic_with_hook
             at src\libstd/panicking.rs:472
  11: rust_begin_unwind
             at src\libstd/panicking.rs:380
  12: std::panicking::begin_panic_fmt
             at src\libstd/panicking.rs:334
  13: cmake::fail
             at D:\local\cargo\registry\src\crates.rustcc.cn-46a557d00542c05f\cmake-0.1.44\src/lib.rs:885
  14: cmake::run
             at D:\local\cargo\registry\src\crates.rustcc.cn-46a557d00542c05f\cmake-0.1.44\src/lib.rs:863
  15: cmake::Config::build
             at D:\local\cargo\registry\src\crates.rustcc.cn-46a557d00542c05f\cmake-0.1.44\src/lib.rs:698
  16: build_script_build::build_grpc
             at .\build.rs:144
  17: build_script_build::main
             at .\build.rs:396
  18: std::rt::lang_start::{{closure}}
             at /rustc/b8cedc00407a4c56a3bda1ed605c6fc166655447\src\libstd/rt.rs:67
  19: std::rt::lang_start_internal::{{closure}}
             at src\libstd/rt.rs:52
  20: std::panicking::try::do_call
             at src\libstd/panicking.rs:305
  21: __rust_maybe_catch_panic
             at src\libpanic_unwind/lib.rs:86
  22: std::panicking::try
             at src\libstd/panicking.rs:281
  23: std::panic::catch_unwind
             at src\libstd/panic.rs:394
  24: std::rt::lang_start_internal
             at src\libstd/rt.rs:51
  25: std::rt::lang_start
             at /rustc/b8cedc00407a4c56a3bda1ed605c6fc166655447\src\libstd/rt.rs:67
  26: main
  27: _tmainCRTStartup
  28: mainCRTStartup
  29: unit_addrs_search
  30: unit_addrs_search
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Cargo.toml:

[dependencies]
futures = "^0.1.15"
grpcio = { version="0.5.3", features = [ "secure" ] }
protobuf = { version = "2.0", optional = true }

Golang:

> go version
go version go1.13.4 windows/amd64

CMake:

> cmake --version
cmake version 3.15.6

System information

  • CPU architecture: X86
  • OS System: Windows 10
@BusyJay
Copy link
Member

BusyJay commented Jun 1, 2020

The error message has said the failure reason:

Could NOT find Perl (missing: PERL_EXECUTABLE)

Make sure pre-requisites listed in https://github.com/tikv/grpc-rs#prerequisites are all installed.

@blackredscarf
Copy link
Author

@BusyJay I install the requirements but get a new error now.

--- stderr
CMake Warning at cmake/protobuf.cmake:47 (message):
  gRPC_PROTOBUF_PROVIDER is "module" but PROTOBUF_ROOT_DIR is wrong
Call Stack (most recent call first):
  CMakeLists.txt:151 (include)


In file included from D:/local/cargo/registry/src/crates.rustcc.cn-46a557d00542c05f/grpcio-sys-0.5.3/grpc/include/grpc/support/port_platform.h:22,
                 from D:\local\cargo\registry\src\crates.rustcc.cn-46a557d00542c05f\grpcio-sys-0.5.3\grpc\src\core\lib\gpr\cpu_iphone.cc:19:
D:/local/cargo/registry/src/crates.rustcc.cn-46a557d00542c05f/grpcio-sys-0.5.3/grpc/include/grpc/impl/codegen/port_platform.h:50:2: error: #error "Please compile grpc with _WIN32_WINNT of at least 0x600 (aka Windows Vista)"
 #error \
  ^~~~~

@BusyJay
Copy link
Member

BusyJay commented Jun 1, 2020

Interesting. What's the compilation environment you are using? What's the output of rustc --print=cfg?

@blackredscarf
Copy link
Author

@BusyJay

> rustc --print=cfg
debug_assertions
target_arch="x86_64"
target_endian="little"
target_env="gnu"
target_family="windows"
target_feature="fxsr"
target_feature="sse"
target_feature="sse2"
target_os="windows"
target_pointer_width="64"
target_vendor="pc"
windows

@BusyJay
Copy link
Member

BusyJay commented Jun 1, 2020

You seem to compile it in mingw environment. From what I can see, it should set the flag correctly as target_os is still "windows". @hunterlxt Can you verify it?

@blackredscarf you can also try to compile it using MSVC, which is tested by our CI.

@hunterlxt
Copy link
Member

@BusyJay @blackredscarf I will test once my environment is set up

@hunterlxt
Copy link
Member

hunterlxt commented Jun 2, 2020

I created a new windows os (2004) and installed:

  1. vs builder tools 2019
  2. cmake
  3. go
  4. rust
  5. choco install activeperl llvm nasm

Then cargo build succeeded
cc @BusyJay @blackredscarf

@hunterlxt
Copy link
Member

It seems that upstream does not provide formal support for mingw.
FYI https://github.com/grpc/grpc/blob/master/BUILDING.md#building-with-cmake

You can try to compile grpc-c++ directly following grpc doc, if it can be compiled successfully, I will reopen this issue.

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

3 participants