The gRPC library for Rust built on C Core library and futures

Related tags

rust grpc
Overview

gRPC-rs

gRPC-rs is a Rust wrapper of gRPC Core. gRPC is a high performance, open source universal RPC framework that puts mobile and HTTP/2 first.

Crates.io docs.rs Build Status Build Status

Status

This project is still under development. The following features with the check marks are supported:

  • Basic asynchronous unary/steaming call
  • SSL
  • Generic call
  • Connection level compression
  • Interoperability test
  • QPS benchmark
  • Custom metadata
  • Health check
  • Reflection
  • Authentication
  • Load balance, client side is fully supported, server side load report is not implemented yet.

Prerequisites

  • CMake >= 3.8.0
  • Rust >= 1.36.0
  • binutils >= 2.22
  • LLVM and Clang >= 3.9 if you need to generate bindings at compile time.
  • By default, the secure feature is provided by boringssl. You can also use openssl instead by enabling openssl feature.

For Linux and MacOS, you also need to install gcc 4.9+ (or clang) too.

Bindings are pre-generated for x86_64/arm64 Linux. For other platforms, bindings are generated at compile time.

For Windows, you also need to install following software:

  • Active State Perl
  • yasm
  • Visual Studio 2015+

Build

$ ./scripts/reset-submodule.cmd # if you just cloned the repository
$ cargo build

Error linking OpenSSL

If you're getting linker errors when building your project using gRPC-rs, head down to the openssl feature section for a possible fix.

Usage

To generate the sources from proto files:

Option 1 - Manual Generation

  1. Install the protobuf compiler:
$ cargo install protobuf-codegen
  1. Install the gRPC compiler:
$ cargo install grpcio-compiler
  1. Generate the sources:
$ protoc --rust_out=. --grpc_out=. --plugin=protoc-gen-grpc=`which grpc_rust_plugin` example.proto

Option 2 - Programmatic Generation

Programmatic generation can be used to generate Rust modules from proto files via your build.rs by using protoc-grpcio.

For more information and examples see README.

To include this project as a dependency:

[dependencies]
grpcio = "0.6"

Feature secure

secure feature enables support for TLS encryption and some authentication mechanism. When you do not need it, for example when working in intranet, you can disable it by using the following configuration:

[dependencies]
grpcio = { version = "0.6", default-features = false, features = ["protobuf-codec"] }

Feature prost-codec and protobuf-codec

gRPC-rs uses protobuf crate by default. If you want to use prost instead, you can enable prost-codec feature. You probably only want to enable only one of the two features. Though grpcio is completely fine with both features enabled at the same time, grpcio-compiler will not going to work as expected.

Feature openssl and openssl-vendored

gRPC-rs comes vendored with gRPC Core, which by default uses BoringSSL instead of OpenSSL. This may cause linking issues due to symbol clashes and/or missing symbols when another one of your dependencies uses OpenSSL. To resolve this, you can tell gRPC-rs to use OpenSSL too by specifying "openssl" in your Cargo.toml's features list for gprcio, which requires openssl (>=1.0.2). E.g.:

[dependencies]
grpcio = { version = "0.6", features = ["openssl"] }

Feature openssl-vendored is the same as feature openssl except it will build openssl from bundled sources.

Performance

See benchmark to find out how to run a benchmark by yourself.

Cross Compile

See cross_compile

Contributing

Make sure to format and test the code before sending a PR.

If the content in grpc-sys/grpc is updated, you may need to regenerate bindings:

$ ./scripts/generate-bindings.sh
Issues
  • travis: add notification hook

    travis: add notification hook

    opened by BusyJay 37
  • Zero copy for receive

    Zero copy for receive

    This is not ready to merge yet, but I'm opening this PR so we can discuss changes related to #134 .

    Enhancement 
    opened by ice1000 37
  • Linking fails against libssl on OS X

    Linking fails against libssl on OS X

    Describe the bug I found this originally on another project, but I can reproduce the same thing against the grpc-rs repo. The final step of cargo build fails with a linker error:

    [...]
      = note: ld: warning: directory not found for option '-L/Users/habnabit/Projects/20181023-activity-aggregator/grpc-rs/target/debug/build/grpcio-sys-88e0b97a2cd094d1/out/build/third_party/boringssl/ssl'
              ld: warning: directory not found for option '-L/Users/habnabit/Projects/20181023-activity-aggregator/grpc-rs/target/debug/build/grpcio-sys-88e0b97a2cd094d1/out/build/third_party/boringssl/crypto'
              ld: library not found for -lssl
              clang: error: linker command failed with exit code 1 (use -v to see invocation)
    

    Full output here: https://gist.github.com/habnabit/1b9a0cf0d0454db3ee98e7bb46f40624

    To Reproduce On a clean grpc-rs checkout:

    $ git checkout v0.4.4
    $ git submodule update --init --recursive
    $ OPENSSL_ROOT_DIR=/usr/local/opt/openssl cargo build --features openssl --examples
    

    Expected behavior Presumably this build should succeed. I don't think I have a broken openssl.

    System information macOS 10.14.5; homebrew openssl.

    $ cargo version
    cargo 1.35.0 (6f3e9c367 2019-04-04)
    $ rustc --version
    rustc 1.35.0 (3c235d560 2019-05-20)
    $ ls -ld /usr/local/opt/openssl
    lrwxr-xr-x  1 habnabit  admin  24 May 31 20:26 /usr/local/opt/openssl -> ../Cellar/openssl/1.0.2r
    
    opened by habnabit 35
  • Zero copy for send

    Zero copy for send

    TODOs

    • [X] Fix benchmark compilation
    • [x] Fix link error (multiple symbol definitions)
    • [x] Fix size_t 6 in Rust becomes size_t in C 140184721559552 via FFI (140184721559552+6 is 2^47)
    • [x] Sync master changes
    • [x] Improve GrpcSlice
    • [x] Improve GrpcByteBuffer
    • [x] (New!) Support bytes in prost

    Now (updated at: 23, April 2019)

    Since @nrc has introduced prost support (instead of rust-protobuf) which is natively using "bytes", we no longer have that one copy for send which is stated to be necessary below. Yay!

    Before:

    • User code deserialize (particularly, the protobuf library), producing a list of &[u8], we copied the data into a Vec<u8>, this is done internally in the protobuf library (copy 0)
    • We create a grpc_slice (a ref-counted single string) by copying the Vec<u8> mentioned above (copy 1)
    • We create a grpc_byte_buffer (a ref-counted list of strings) from only one grpc_slice
    • Send

    Total copy: 2

    After:

    • User code deserialize (particularly, the protobuf library), producing a list of &[u8], we copied each produced &[u8] and collect them into a grpc_byte_buffer (copy 0)
    • Send

    Total copy: 1

    The reason why still one copy:

    • Rust manages its own allocated memory'a lifetime
    • C-side uses a ref-count mechanism to manage the lifetime of objects
    • We either need to longer the Rust objects' lifetime or copy once
    • Tried to longer Rust objects' lifetime in #225
      • Result: grpc supports buffer-hint which requires a much longer lifetime, it's too hard to manage the lifetime in such case
      • This is why I closed #225
    Enhancement 
    opened by ice1000 26
  • grpc-sys 0.4.2 fails to build - but 0.4.1 builds fine

    grpc-sys 0.4.2 fails to build - but 0.4.1 builds fine

    Describe the bug

    0.4.2 fails to build for us with CentOS 7.

    To Reproduce

    On CentOS 7 run cargo build against a crate which depends on either grpc-sys 0.4.2, or grpc-sys 0.4.1

    With grpc-sys 0.4.2, the following is seen:

    error: failed to run custom build command for `grpcio-sys v0.4.2`
    process didn't exit successfully: `/target/debug/build/grpcio-sys-840781b2e44e9c86/build-script-build` (exit code: 101)
    --- stdout
    cargo:rerun-if-changed=grpc_wrap.cc
    cargo:rerun-if-changed=grpc
    cargo:rerun-if-env-changed=GRPCIO_SYS_USE_PKG_CONFIG
    cargo:rerun-if-env-changed=CARGO_CFG_TARGET_OS
    running: "cmake" "/opt/rust/registry/src/github.com-1ecc6299db9ec823/grpcio-sys-0.4.2/grpc" "-DGO_EXECUTABLE=fake-go-nonexist" "-DgRPC_INSTALL=false" "-DgRPC_BUILD_CSHARP_EXT=false" "-DgRPC_BUILD_CODEGEN=false" "-DCMAKE_INSTALL_PREFIX=.../target/debug/build/grpcio-sys-f45f9c164b4a8726/out" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_C_COMPILER=/usr/local/bin/cc" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_CXX_COMPILER=/usr/bin/c++" "-DCMAKE_BUILD_TYPE=Debug"
    -- The C compiler identification is GNU 4.8.5
    -- The CXX compiler identification is GNU 4.8.5
    -- Check for working C compiler: /usr/local/bin/cc
    -- Check for working C compiler: /usr/local/bin/cc -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Check for working CXX compiler: /usr/bin/c++
    -- Check for working CXX compiler: /usr/bin/c++ -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Looking for sys/types.h
    -- Looking for sys/types.h - found
    -- Looking for stdint.h
    -- Looking for stdint.h - found
    -- Looking for stddef.h
    -- Looking for stddef.h - found
    -- Check size of off64_t
    -- Check size of off64_t - done
    -- Looking for fseeko
    -- Looking for fseeko - found
    -- Looking for unistd.h
    -- Looking for unistd.h - found
    -- Renaming
    --     /opt/rust/registry/src/github.com-1ecc6299db9ec823/grpcio-sys-0.4.2/grpc/third_party/zlib/zconf.h
    -- to 'zconf.h.included' because this file is included with zlib
    -- but CMake generates it automatically in the build directory.
    -- Looking for res_servicename in resolv
    -- Looking for res_servicename in resolv - not found
    -- Looking for gethostbyname in nsl
    -- Looking for gethostbyname in nsl - found
    -- Looking for gethostbyname in socket
    -- Looking for gethostbyname in socket - not found
    -- Looking for clock_gettime in rt
    -- Looking for clock_gettime in rt - found
    -- Looking for include file sys/socket.h
    -- Looking for include file sys/socket.h - found
    -- Looking for include file arpa/inet.h
    -- Looking for include file arpa/inet.h - found
    -- Looking for include file arpa/nameser_compat.h
    -- Looking for include file arpa/nameser_compat.h - found
    -- Looking for include file arpa/nameser.h
    -- Looking for include file arpa/nameser.h - found
    -- Looking for include file assert.h
    -- Looking for include file assert.h - found
    -- Looking for include file errno.h
    -- Looking for include file errno.h - found
    -- Looking for include file fcntl.h
    -- Looking for include file fcntl.h - found
    -- Looking for include file inttypes.h
    -- Looking for include file inttypes.h - found
    -- Looking for include file limits.h
    -- Looking for include file limits.h - found
    -- Looking for include file malloc.h
    -- Looking for include file malloc.h - found
    -- Looking for include file memory.h
    -- Looking for include file memory.h - found
    -- Looking for include file netdb.h
    -- Looking for include file netdb.h - found
    -- Looking for include file netinet/in.h
    -- Looking for include file netinet/in.h - found
    -- Looking for include file netinet/tcp.h
    -- Looking for include file netinet/tcp.h - found
    -- Looking for include file net/if.h
    -- Looking for include file net/if.h - found
    -- Looking for include file signal.h
    -- Looking for include file signal.h - found
    -- Looking for include file socket.h
    -- Looking for include file socket.h - not found
    -- Looking for include file stdbool.h
    -- Looking for include file stdbool.h - found
    -- Looking for include file stdlib.h
    -- Looking for include file stdlib.h - found
    -- Looking for include file strings.h
    -- Looking for include file strings.h - found
    -- Looking for include file string.h
    -- Looking for include file string.h - found
    -- Looking for include file stropts.h
    -- Looking for include file stropts.h - not found
    -- Looking for include file sys/ioctl.h
    -- Looking for include file sys/ioctl.h - found
    -- Looking for include file sys/param.h
    -- Looking for include file sys/param.h - found
    -- Looking for include file sys/select.h
    -- Looking for include file sys/select.h - found
    -- Looking for include file sys/stat.h
    -- Looking for include file sys/stat.h - found
    -- Looking for include file sys/time.h
    -- Looking for include file sys/time.h - found
    -- Looking for include file sys/uio.h
    -- Looking for include file sys/uio.h - found
    -- Looking for include file time.h
    -- Looking for include file time.h - found
    -- Looking for include file dlfcn.h
    -- Looking for include file dlfcn.h - found
    -- Looking for include file unistd.h
    -- Looking for include file unistd.h - found
    -- Looking for include files winsock2.h, windows.h
    -- Looking for include files winsock2.h, windows.h - not found
    -- Looking for 3 include files winsock2.h, ..., windows.h
    -- Looking for 3 include files winsock2.h, ..., windows.h - not found
    -- Looking for include files winsock.h, windows.h
    -- Looking for include files winsock.h, windows.h - not found
    -- Looking for include file windows.h
    -- Looking for include file windows.h - not found
    -- Performing Test HAVE_SOCKLEN_T
    -- Performing Test HAVE_SOCKLEN_T - Success
    -- Performing Test HAVE_TYPE_SOCKET
    -- Performing Test HAVE_TYPE_SOCKET - Failed
    -- Performing Test HAVE_BOOL_T
    -- Performing Test HAVE_BOOL_T - Success
    -- Performing Test HAVE_SSIZE_T
    -- Performing Test HAVE_SSIZE_T - Success
    -- Performing Test HAVE_LONGLONG
    -- Performing Test HAVE_LONGLONG - Success
    -- Performing Test HAVE_SIG_ATOMIC_T
    -- Performing Test HAVE_SIG_ATOMIC_T - Success
    -- Performing Test HAVE_STRUCT_ADDRINFO
    -- Performing Test HAVE_STRUCT_ADDRINFO - Success
    -- Performing Test HAVE_STRUCT_IN6_ADDR
    -- Performing Test HAVE_STRUCT_IN6_ADDR - Success
    -- Performing Test HAVE_STRUCT_SOCKADDR_IN6
    -- Performing Test HAVE_STRUCT_SOCKADDR_IN6 - Success
    -- Performing Test HAVE_STRUCT_SOCKADDR_STORAGE
    -- Performing Test HAVE_STRUCT_SOCKADDR_STORAGE - Success
    -- Performing Test HAVE_STRUCT_TIMEVAL
    -- Performing Test HAVE_STRUCT_TIMEVAL - Success
    -- Looking for AF_INET6
    -- Looking for AF_INET6 - found
    -- Looking for O_NONBLOCK
    -- Looking for O_NONBLOCK - found
    -- Looking for FIONBIO
    -- Looking for FIONBIO - found
    -- Looking for SIOCGIFADDR
    -- Looking for SIOCGIFADDR - found
    -- Looking for MSG_NOSIGNAL
    -- Looking for MSG_NOSIGNAL - found
    -- Looking for PF_INET6
    -- Looking for PF_INET6 - found
    -- Looking for SO_NONBLOCK
    -- Looking for SO_NONBLOCK - not found
    -- Looking for CLOCK_MONOTONIC
    -- Looking for CLOCK_MONOTONIC - found
    -- Performing Test HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
    -- Performing Test HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID - Success
    -- Performing Test HAVE_LL
    -- Performing Test HAVE_LL - Success
    -- Looking for bitncmp
    -- Looking for bitncmp - not found
    -- Looking for closesocket
    -- Looking for closesocket - not found
    -- Looking for CloseSocket
    -- Looking for CloseSocket - not found
    -- Looking for connect
    -- Looking for connect - found
    -- Looking for fcntl
    -- Looking for fcntl - found
    -- Looking for freeaddrinfo
    -- Looking for freeaddrinfo - found
    -- Looking for getaddrinfo
    -- Looking for getaddrinfo - found
    -- Looking for getenv
    -- Looking for getenv - found
    -- Looking for gethostbyaddr
    -- Looking for gethostbyaddr - found
    -- Looking for gethostbyname
    -- Looking for gethostbyname - found
    -- Looking for gethostname
    -- Looking for gethostname - found
    -- Looking for getnameinfo
    -- Looking for getnameinfo - found
    -- Looking for getservbyport_r
    -- Looking for getservbyport_r - found
    -- Looking for gettimeofday
    -- Looking for gettimeofday - found
    -- Looking for if_indextoname
    -- Looking for if_indextoname - found
    -- Looking for inet_net_pton
    -- Looking for inet_net_pton - not found
    -- Looking for inet_ntop
    -- Looking for inet_ntop - found
    -- Looking for inet_pton
    -- Looking for inet_pton - found
    -- Looking for ioctl
    -- Looking for ioctl - found
    -- Looking for ioctlsocket
    -- Looking for ioctlsocket - not found
    -- Looking for IoctlSocket
    -- Looking for IoctlSocket - not found
    -- Looking for recv
    -- Looking for recv - found
    -- Looking for recvfrom
    -- Looking for recvfrom - found
    -- Looking for send
    -- Looking for send - found
    -- Looking for setsockopt
    -- Looking for setsockopt - found
    -- Looking for socket
    -- Looking for socket - found
    -- Looking for strcasecmp
    -- Looking for strcasecmp - found
    -- Looking for strcmpi
    -- Looking for strcmpi - not found
    -- Looking for strdup
    -- Looking for strdup - found
    -- Looking for stricmp
    -- Looking for stricmp - not found
    -- Looking for strncasecmp
    -- Looking for strncasecmp - found
    -- Looking for strncmpi
    -- Looking for strncmpi - not found
    -- Looking for strnicmp
    -- Looking for strnicmp - not found
    -- Looking for writev
    -- Looking for writev - found
    -- Found Perl: /usr/bin/perl (found version "5.16.3") 
    -- The ASM compiler identification is GNU
    -- Found assembler: /usr/local/bin/cc
    -- Configuring done
    -- Generating done
    -- Build files have been written to: .../target/debug/build/grpcio-sys-f45f9c164b4a8726/out/build
    
    --- stderr
    CMake Warning at cmake/protobuf.cmake:48 (message):
      gRPC_PROTOBUF_PROVIDER is "module" but PROTOBUF_ROOT_DIR is wrong
    Call Stack (most recent call first):
      CMakeLists.txt:140 (include)
    
    
    CMake Warning at cmake/gflags.cmake:26 (message):
      gRPC_GFLAGS_PROVIDER is "module" but GFLAGS_ROOT_DIR is wrong
    Call Stack (most recent call first):
      CMakeLists.txt:142 (include)
    
    
    CMake Warning at cmake/benchmark.cmake:26 (message):
      gRPC_BENCHMARK_PROVIDER is "module" but BENCHMARK_ROOT_DIR is wrong
    Call Stack (most recent call first):
      CMakeLists.txt:143 (include)
    
    
    CMake Error at CMakeLists.txt:738 (target_compile_options):
      Error evaluating generator expression:
    
        $<COMPILE_LANGUAGE:CXX>
    
      Expression did not evaluate to a known generator expression
    
    
    CMake Error at CMakeLists.txt:6171 (target_compile_options):
      Error evaluating generator expression:
    
        $<COMPILE_LANGUAGE:CXX>
    
      Expression did not evaluate to a known generator expression
    ....
    thread 'main' panicked at '
    command did not execute successfully, got: exit code: 1
    
    build script failed, must exit now', /opt/rust/registry/src/github.com-1ecc6299db9ec823/cmake-0.1.35/src/lib.rs:778:5
    note: Run with `RUST_BACKTRACE=1` for a backtrace.
    
    warning: build failed, waiting for other jobs to finish...
    error: failed to verify package tarball
    
    Caused by:
      build failed
    

    Expected behavior

    grpc-sys to build successfully.

    System information

    • CPU architecture: x86-64
    • Distribution and kernel version: CentOS 7 under Docker on Core OS.
    • SELinux on?:
    • Any other system details we should know?:

    Additional context Add any other context about the problem here.

    Build 
    opened by richardwhiuk 17
  • Rust 2018 Edition Support

    Rust 2018 Edition Support

    Is your feature request related to a problem? Please describe.

    I'd like to use generated code in a Rust 2018 edition project.

    What would it take to have grpc-rs support both Rust 2015 and 2018 editions?

    Additional context

    The release of Rust 1.31.0 on December 6th will be the first release of “Rust 2018.”

    https://blog.rust-lang.org/2018/07/27/what-is-rust-2018.html

    Enhancement 
    opened by xpe 16
  • Update grpc to 1.24.0

    Update grpc to 1.24.0

    Updates grpc and pulls it from upstream, rather than using our fork.

    opened by nrc 16
  • Apply Clang-Tidy's suggestions

    Apply Clang-Tidy's suggestions

    Signed-off-by: ice1000 [email protected]

    Applied some suggestions from Clang-Tidy to grpc_wrap.cc since it's originally C but now C++

    Enhancement 
    opened by ice1000 15
  • centos6 build and link grpc-rs source code error: undefined reference to `__gxx_personality_v0'

    centos6 build and link grpc-rs source code error: undefined reference to `__gxx_personality_v0'

    hi, I use grpc-rs source code as grpcio's patch in my rust project, after complie succ . the link occur error, detail as below: the grpcio use method in my project Cargo.toml is

    ...
    [dependencies]
    grpcio = "*"
    ...
    [patch.crates-io]
    grpcio = { path = "./grpc-rs" }
    

    My build machine os is centos 6, I upgrade the default gcc/g++ version from 4.47 to 4.8.2:

    wget http://people.centos.org/tru/devtools-2/devtools-2.repo -O /etc/yum.repos.d/devtools-2.repo
    yum install devtoolset-2-gcc devtoolset-2-binutils
    yum install devtoolset-2-gcc-c++ devtoolset-2-binutils
    scl enable devtoolset-2 bash
    

    and then upgrade cmake version to 3.10.0-rc4. Then the compile process of my project is completed succ, but the final link process is error:

    Running `rustc --crate-name tt_agentd src/bin/main.rs --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=329f339b6b95c21e -C extra-filename=-329f339b6b95c21e --out-dir /tmp/multipkg/build/tt/target/debug/deps -L dependency=/tmp/multipkg/build/tt/target/debug/deps --extern chrono=/tmp/multipkg/build/tt/target/debug/deps/libchrono-83f205826c8cbe4a.rlib --extern clap=/tmp/multipkg/build/tt/target/debug/deps/libclap-fdb8754d03fe468d.rlib --extern flate2=/tmp/multipkg/build/tt/target/debug/deps/libflate2-ada67b65e8687c66.rlib --extern toml=/tmp/multipkg/build/tt/target/debug/deps/libtoml-01d27e87266f3d49.rlib --extern error_chain=/tmp/multipkg/build/tt/target/debug/deps/liberror_chain-ce7184105e3bc4f5.rlib --extern walkdir=/tmp/multipkg/build/tt/target/debug/deps/libwalkdir-d5b4fa10edee569d.rlib --extern protobuf=/tmp/multipkg/build/tt/target/debug/deps/libprotobuf-328e3d5ed8378a3e.rlib --extern serde=/tmp/multipkg/build/tt/target/debug/deps/libserde-0291d3120fb722a9.rlib --extern futures=/tmp/multipkg/build/tt/target/debug/deps/libfutures-1b9182b76cdcf9bb.rlib --extern tar=/tmp/multipkg/build/tt/target/debug/deps/libtar-2709790813f55833.rlib --extern tempdir=/tmp/multipkg/build/tt/target/debug/deps/libtempdir-8121eea7baa9d710.rlib --extern grpcio=/tmp/multipkg/build/tt/target/debug/deps/libgrpcio-764d63f6dc20aa0a.rlib --extern hostname=/tmp/multipkg/build/tt/target/debug/deps/libhostname-dc250aee9cb87a9a.rlib --extern tt_proto=/tmp/multipkg/build/tt/target/debug/deps/libtt_proto-6fcd2500f251c566.rlib --extern serde_json=/tmp/multipkg/build/tt/target/debug/deps/libserde_json-ca366df264a2aff6.rlib --extern lazy_static=/tmp/multipkg/build/tt/target/debug/deps/liblazy_static-32480de9118a066c.rlib --extern crypto=/tmp/multipkg/build/tt/target/debug/deps/libcrypto-1dcbab75c663e65b.rlib --extern log=/tmp/multipkg/build/tt/target/debug/deps/liblog-76d0e5da518c9890.rlib --extern env_logger=/tmp/multipkg/build/tt/target/debug/deps/libenv_logger-30dd2c8d8b73c017.rlib --extern daemonize=/tmp/multipkg/build/tt/target/debug/deps/libdaemonize-2ee63a9a17dd392a.rlib --extern serde_derive=/tmp/multipkg/build/tt/target/debug/deps/libserde_derive-3331a53d2a1fcf4d.so --extern rayon=/tmp/multipkg/build/tt/target/debug/deps/librayon-4d01f1358960ca65.rlib --extern log4rs=/tmp/multipkg/build/tt/target/debug/deps/liblog4rs-f6ef6bdbff08160d.rlib --extern tt=/tmp/multipkg/build/tt/target/debug/deps/libtt-aee6ced0a9b80889.rlib -L native=/tmp/multipkg/build/tt/target/debug/build/backtrace-sys-943860c9c514961f/out/.libs -L native=/tmp/multipkg/build/tt/target/debug/build/miniz-sys-c1d19ab19aea7dca/out -L native=/tmp/multipkg/build/tt/target/debug/build/grpcio-sys-a451e038565f03cc/out/build -L native=/tmp/multipkg/build/tt/target/debug/build/grpcio-sys-a451e038565f03cc/out/build/third_party/cares -L native=/tmp/multipkg/build/tt/target/debug/build/grpcio-sys-a451e038565f03cc/out/build/third_party/zlib -L native=/tmp/multipkg/build/tt/target/debug/build/grpcio-sys-a451e038565f03cc/out/build/third_party/boringssl/ssl -L native=/tmp/multipkg/build/tt/target/debug/build/grpcio-sys-a451e038565f03cc/out/build/third_party/boringssl/crypto -L native=/tmp/multipkg/build/tt/target/debug/build/grpcio-sys-a451e038565f03cc/out -L native=/tmp/multipkg/build/tt/target/debug/build/rust-crypto-c61e52eda4d55a33/out`
    error: linking with `cc` failed: exit code: 1
      |
      = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/tmp/multipkg/build/tt/target/debug/deps/tt_agentd-329f339b6b95c21e.0.o" "-o" "/tmp/multipkg/build/tt/target/debug/deps/tt_agentd-329f339b6b95c21e" "/tmp/multipkg/build/tt/target/debug/deps/tt_agentd-329f339b6b95c21e.crate.allocator.o" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs" "-L" "/tmp/multipkg/build/tt/target/debug/deps" "-L" "/tmp/multipkg/build/tt/target/debug/build/backtrace-sys-943860c9c514961f/out/.libs" "-L" "/tmp/multipkg/build/tt/target/debug/build/miniz-sys-c1d19ab19aea7dca/out" "-L" "/tmp/multipkg/build/tt/target/debug/build/grpcio-sys-a451e038565f03cc/out/build" "-L" "/tmp/multipkg/build/tt/target/debug/build/grpcio-sys-a451e038565f03cc/out/build/third_party/cares" "-L" "/tmp/multipkg/build/tt/target/debug/build/grpcio-sys-a451e038565f03cc/out/build/third_party/zlib" "-L" "/tmp/multipkg/build/tt/target/debug/build/grpcio-sys-a451e038565f03cc/out/build/third_party/boringssl/ssl" "-L" "/tmp/multipkg/build/tt/target/debug/build/grpcio-sys-a451e038565f03cc/out/build/third_party/boringssl/crypto" "-L" "/tmp/multipkg/build/tt/target/debug/build/grpcio-sys-a451e038565f03cc/out" "-L" "/tmp/multipkg/build/tt/target/debug/build/rust-crypto-c61e52eda4d55a33/out" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/tmp/multipkg/build/tt/target/debug/deps/libtt-aee6ced0a9b80889.rlib" "/tmp/multipkg/build/tt/target/debug/deps/libcrypto-1dcbab75c663e65b.rlib" "/tmp/multipkg/build/tt/target/debug/deps/librayon-4d01f1358960ca65.rlib" "/tmp/multipkg/build/tt/target/debug/deps/libwalkdir-d5b4fa10edee569d.rlib" "/tmp/multipkg/build/tt/target/debug/deps/libsame_file-51f0c58ca561678c.rlib" "/tmp/multipkg/build/tt/target/debug/deps/libdaemonize-2ee63a9a17dd392a.rlib" "/tmp/multipkg/build/tt/target/debug/deps/liberror_chain-ce7184105e3bc4f5.rlib" "/tmp/multipkg/build/tt/target/debug/deps/libbacktrace-0a24a00d800c5483.rlib" "/tmp/multipkg/build/tt/target/debug/deps/libcfg_if-39407a6f5c167a50.rlib" "/tmp/multipkg/build/tt/target/debug/deps/liblog4rs-f6ef6bdbff08160d.rlib" "/tmp/multipkg/build/tt/target/debug/deps/libserde_value-b4c3e2e6c4050fd6.rlib" "/tmp/multipkg/build/tt/target/debug/deps/libordered_float-20975675ecb44655.rlib" "/tmp/multipkg/build/tt/target/debug/deps/libserde_yaml-956020bc20e32987.rlib" "/tmp/multipkg/build/tt/target/debug/deps/libyaml_rust-538e4354afb6f8e7.rlib" "/tmp/multipkg/build/tt/target/debug/deps/liblinked_hash_map-1d5a8c1b2061c143.rlib" "/tmp/multipkg/build/tt/target/debug/deps/libtypemap-fb4413453ccfec24.rlib" "/tmp/multipkg/build/tt/target/debug/deps/libunsafe_any-7e9009d4aefe1b79.rlib" "/tmp/multipkg/build/tt/target/debug/deps/libtraitobject-72ce215889980bac.rlib" "/tmp/multipkg/build/tt/target/debug/deps/libfnv-ce6acad4e6f3bda9.rlib" "/tmp/multipkg/build/tt/target/debug/deps/libcrossbeam-c2ae04e975406371.rlib" "/tmp/multipkg/build/tt/target/debug/deps/libantidote-f05920b405dc5e0e.rlib" "/tmp/multipkg/build/tt/target/debug/deps/liblog_mdc-5d3a1a124d9e6986.rlib" "/tmp/multipkg/build/tt/target/debug/deps/libtt_proto-6fcd2500f251c566.rlib" "/tmp/multipkg/build/tt/target/debug/deps/libgrpcio-764d63f6dc20aa0a.rlib" "/tmp/multipkg/build/tt/target/debug/deps/libgrpcio_sys-6ef1eac6776f3a8d.rlib" "/tmp/multipkg/build/tt/target/debug/deps/libfutures-1b9182b76cdcf9bb.rlib" "/tmp/multipkg/build/tt/target/debug/deps/libprotobuf-328e3d5ed8378a3e.rlib" "/tmp/multipkg/build/tt/target/debug/deps/liblog-76d0e5da518c9890.rlib" "/tmp/multipkg/build/tt/target/debug/deps/libbacktrace_sys-d7c5f51e838320b6.rlib" "/tmp/multipkg/build/tt/target/debug/deps/libserde_json-ca366df264a2aff6.rlib" "/tmp/multipkg/build/tt/target/debug/deps/libdtoa-c31ef64067a24d52.rlib" "/tmp/multipkg/build/tt/target/debug/deps/libitoa-bb9fe302248b7433.rlib" "/tmp/multipkg/build/tt/target/debug/deps/libserde-0291d3120fb722a9.rlib" "/tmp/multipkg/build/tt/target/debug/deps/libhostname-dc250aee9cb87a9a.rlib" "/tmp/multipkg/build/tt/target/debug/deps/librustc_serialize-5c7e94e54f3b2493.rlib" "/tmp/multipkg/build/tt/target/debug/deps/librustc_demangle-83d9ff7249781958.rlib" "/tmp/multipkg/build/tt/target/debug/deps/libhumantime-f510abbb8fd521fa.rlib" "/tmp/multipkg/build/tt/target/debug/deps/libquick_error-bbcdf42bf963990f.rlib" "/tmp/multipkg/build/tt/target/debug/deps/libchrono-6e3e657de0abbfe7.rlib" "/tmp/multipkg/build/tt/target/debug/deps/libnum-7010fdbf340ca145.rlib" "/tmp/multipkg/build/tt/target/debug/deps/libnum_iter-26dbda985b5a9acf.rlib" "/tmp/multipkg/build/tt/target/debug/deps/libnum_integer-97e8ea1ab5063056.rlib" "/tmp/multipkg/build/tt/target/debug/deps/libnum_traits-6fd04028b4ec4415.rlib" "/tmp/multipkg/build/tt/target/debug/deps/libtime-0cd5fac6e6ca5103.rlib" "/tmp/multipkg/build/tt/target/debug/deps/libflate2-ada67b65e8687c66.rlib" "/tmp/multipkg/build/tt/target/debug/deps/libminiz_sys-50ff439e51f909c5.rlib" "/tmp/multipkg/build/tt/target/debug/deps/liblinked_hash_map-1b499928685848af.rlib" "/tmp/multipkg/build/tt/target/debug/deps/libunreachable-3bde6d0dca5f0eff.rlib" "/tmp/multipkg/build/tt/target/debug/deps/libvoid-4861444fc46bd06e.rlib" "/tmp/multipkg/build/tt/target/debug/deps/librayon_core-3f80a41970af947d.rlib" "/tmp/multipkg/build/tt/target/debug/deps/libnum_cpus-2f6edb1d9f9d0ac0.rlib" "/tmp/multipkg/build/tt/target/debug/deps/liblazy_static-32480de9118a066c.rlib" "/tmp/multipkg/build/tt/target/debug/deps/libcoco-bc6af71e91a88e9c.rlib" "/tmp/multipkg/build/tt/target/debug/deps/libscopeguard-a99cb6da8aacdf01.rlib" "/tmp/multipkg/build/tt/target/debug/deps/libeither-8b850cc8c54085ac.rlib" "/tmp/multipkg/build/tt/target/debug/deps/librand-b0b8180ea869605f.rlib" "/tmp/multipkg/build/tt/target/debug/deps/liblibc-42ccb1ab9c602896.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-8eeda694d27cc3ba.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-d9be38a491a6b20b.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc_jemalloc-7df0812865be3e74.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-1768097fd1bb5d0a.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc_system-38bc2ffba7aac62a.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-d4f79324c33264e2.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-e2edf8b78eb9a037.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_unicode-29181a531b1322da.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/librand-30d6b4a7069ee56b.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-ac3876fe094f9f74.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-4917ae9e58e9366a.rlib" "-Wl,-Bdynamic" "-l" "util" "-l" "util" "-l" "dl" "-l" "rt" "-l" "pthread" "-l" "pthread" "-l" "gcc_s" "-l" "c" "-l" "m" "-l" "rt" "-l" "pthread" "-l" "util"
      = note: /tmp/multipkg/build/tt/target/debug/deps/libgrpcio_sys-6ef1eac6776f3a8d.rlib(lame_client.cc.o):(.data.DW.ref.__gxx_personality_v0[DW.ref.__gxx_personality_v0]+0x0): undefined reference to `__gxx_personality_v0'
              collect2: error: ld returned 1 exit status
              
    
    error: aborting due to previous error
    
    error: Could not compile `tt`.
    

    Besides, in centos 7 machine, the build and link is ok.

    opened by dllhlx 15
  • Set TLS versions to enable

    Set TLS versions to enable

    Hi, I am looking for a way to enable only certain TLS versions. I don't know if at this time there is any method to do this. If it is already possible to have this behavior, I ask for help. Thanks.

    opened by NicolaLabanca 1
  • Client-side unary-call metadata support.

    Client-side unary-call metadata support.

    • Add methods to BatchContext to get metadata.
    • Modify BatchFuture to read/return those as well.
    • Update existing code paths to discard metadata read by BatchFuture.
    • Create a new FullClientUnaryReceiver structure to explicitly pass it along.
    • Add async/sync accessors to those details.
    • Add unary metadata to client codegen.

    This was written by my colleague James Cape last year; we are just now getting around to sending a pull request.

    opened by christian-oudard 1
  • Calling from tokio context

    Calling from tokio context

    Hi, Sorry for if the question is too newbie but is it ok to call functions from a tokio context? like below (tx is streamingcallsink and rx is Clientcstreamreceiver)

    tx.feed((data.clone(), WriteFlags::default())).await
    rx.await?
    

    Thanks in advance...

    opened by capacman 4
  • Question on grpc_wrap.cc union comment

    Question on grpc_wrap.cc union comment

    With https://github.com/rust-lang/rust/pull/77547 stable as of rust 1.49, I was curious, is this comment still valid?

    opened by dfreese 1
  • grpc-sys: Use grpc headers found by pkgconfig.

    grpc-sys: Use grpc headers found by pkgconfig.

    Ran into this issue when cross compiling after updating libraries. I had originally fixed and tested this on v0.7.1 but it looks like a PR was just merged so I rebased. Here's the original fix in case you're interested. https://github.com/StarryInternet/grpc-rs/tree/ssloboda/fix-cross-compile-bindgen-v0.7.1

    Happy to refactor if needed.

    opened by ssloboda 6
  • Using other executors

    Using other executors

    Is your feature request related to a problem? Please describe. There are several executors in Rust world, like tokio, async-std, smol. TiKV project has developed its owned thread pool yatp. And grpcio has its own executor too, it's implemented on top of the poll engine build-in grpc c core. Due to grpc c core bind each call to the same thread (https://github.com/grpc/grpc/issues/15535, for better locality), it's not recommended to do time consuming job in the executor. So people usually use one of the other executors mentioned above to get around the issue. For example, TiKV uses yatp to handle heavy computation or file IO.

    But using different executors are not a good idea in some situations. For example, in resource limited environment, too many threads can have huge performance regression due to context switches. Using different executors means more threads usually. For style consideration, it's also cleaner to just keep using one executor.

    grpc c core supports custom poll engine by using grpc_register_event_engine_factory. A custom poll engine can adapt other executors to fit in event_engine_factory_fn. For example, a tokio Reactor exposes similar APIs with event_engine_factory_fn. One downside is that grpc_register_event_engine_factory is a private interface, so it can't work when using dynamic link.

    Proposal 
    opened by BusyJay 0
  • codec: check serialization result length

    codec: check serialization result length

    grpc c core can only handle message that is not larger than 4GiB.

    This is a cherry-pick of #495.

    opened by BusyJay 2
  • codec: avoid overflowing error

    codec: avoid overflowing error

    grpc c core can only handle message that is not larger than 4GiB.

    BugFix 
    opened by BusyJay 0
  • Why not use hyperium/tonic instead

    Why not use hyperium/tonic instead

    Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

    Describe the solution you'd like A clear and concise description of what you want to happen.

    Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

    Additional context Add any other context or screenshots about the feature request here.

    Question 
    opened by jthinking 1
  • compiler: provide a default trait that implements all methods as returning unimplemented error

    compiler: provide a default trait that implements all methods as returning unimplemented error

    This is very useful for testing purpose, in which case, users tend to implement one or several methods of the trait.

    Enhancement Help Wanted 
    opened by BusyJay 1
Releases(v0.9.0)
  • v0.9.0(May 25, 2021)

    • Support rich error (#514)
    • Provide default service implementations (#521)
    • Support abstract UDS (#523)
    • Use default-features=false on libz-sys to allow for zlib-ng (#525)
    • Update grpc to 1.38.0 (#526)
    Source code(tar.gz)
    Source code(zip)
  • v0.8.2(May 25, 2021)

  • grpcio-sys-v0.8.1(Mar 2, 2021)

  • v0.8.0(Feb 25, 2021)

  • v0.7.1(Dec 18, 2020)

  • v0.7.0(Nov 3, 2020)

    • Add blocking callback to EnvBuilder (#474)
    • Enhance sinks to make them batchable (#469)
    • Remove rustfmt_skip attribute since it is unstable (#479)
    • Use grpc_slice to reduce memory copy (#481)
    • Fix the bug that server cannot shutdown itself when drop (#484)
    • Add methods for channels from file descriptors (#488)
    • Update gRPC C core to 1.33.1 (#492)
    Source code(tar.gz)
    Source code(zip)
  • v0.5.4(Jul 27, 2020)

  • v0.6.0(Jun 12, 2020)

Owner
TiKV Project
TiKV Project
Futures implementation for JSON-RPC

futures-jsonrpc Futures + JSON-RPC A lightweight remote procedure call protocol. It is designed to be simple! And, with futures, even more flexible! T

Victor Lopes 14 Jan 10, 2021
Network simulation in Rust

netsim - A Rust library for network simulation and testing (currently linux-only). netsim is a crate for simulating networks for the sake of testing n

Andrew Cann 83 Jun 3, 2021
A runtime for writing reliable asynchronous applications with Rust. Provides I/O, networking, scheduling, timers, ...

Tokio A runtime for writing reliable, asynchronous, and slim applications with the Rust programming language. It is: Fast: Tokio's zero-cost abstracti

Tokio 12.3k Jun 14, 2021
Actor framework for Rust.

Actix Actor framework for Rust Documentation User Guide API Documentation API Documentation (master branch) Features Async and sync actors Actor commu

Actix 6.4k Jun 11, 2021
The Rust Implementation of libp2p networking stack.

Central repository for work on libp2p This repository is the central place for Rust development of the libp2p spec. Warning: While we are trying our b

libp2p 1.8k Jun 13, 2021
Futures-based QUIC implementation in Rust

Pure-rust QUIC protocol implementation Quinn is a pure-rust, future-based implementation of the QUIC transport protocol undergoing standardization by

null 1.6k Jun 13, 2021
Docker daemon API in Rust

Bollard: an asynchronous rust client library for the docker API Bollard leverages the latest Hyper and Tokio improvements for an asynchronous API cont

Niel Drummond 204 May 20, 2021
Crusty - polite && scalable broad web crawler

Broad web crawling is an activity of going through practically boundless web by starting from a set of locations(urls) and following outgoing links. Usually it doesn't matter where you start from as long as it has outgoing links to external domains.

Sergey F. 42 Jun 16, 2021
🥧 Savoury implementation of the QUIC transport protocol and HTTP/3

quiche is an implementation of the QUIC transport protocol and HTTP/3 as specified by the IETF. It provides a low level API for processing QUIC packet

Cloudflare 4.8k Jun 13, 2021
a smol tcp/ip stack

smoltcp smoltcp is a standalone, event-driven TCP/IP stack that is designed for bare-metal, real-time systems. Its design goals are simplicity and rob

smoltcp 2k Jun 14, 2021
Rust bindings for libssh2

ssh2-rs Documentation Rust bindings to libssh2, an ssh client library. Usage # Cargo.toml [dependencies] ssh2 = "0.9" Building on OSX 10.10+ This libr

Alex Crichton 250 Jun 7, 2021
A Constrained Application Protocol(CoAP) library implemented in Rust.

coap-rs A fast and stable Constrained Application Protocol(CoAP) library implemented in Rust. Features: CoAP core protocol RFC 7252 CoAP Observe optio

Covertness 132 May 20, 2021
Rust zeromq bindings.

Rust ZeroMQ bindings. Documentation Release Notes About The zmq crate provides bindings for the libzmq library from the ZeroMQ project. The API expose

Erick Tryzelaar 579 Jun 10, 2021