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

grpcio: pre-generate bindings for common targets #356

Merged
merged 40 commits into from
Aug 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
f7b4b4f
use environment variable to control build
hunterlxt Jul 25, 2019
290c4cd
update
hunterlxt Jul 29, 2019
84225c9
update
hunterlxt Jul 29, 2019
d45975c
update
hunterlxt Jul 29, 2019
8abd525
update
hunterlxt Jul 29, 2019
c9ee115
update
hunterlxt Jul 29, 2019
a32a1c7
update
hunterlxt Jul 29, 2019
00e5122
update
hunterlxt Jul 29, 2019
1962edc
update
hunterlxt Jul 29, 2019
0b723fd
update
hunterlxt Jul 29, 2019
982726d
update
hunterlxt Jul 29, 2019
a42cf69
update
hunterlxt Jul 29, 2019
02aaa91
update
hunterlxt Jul 29, 2019
cce3d18
update
hunterlxt Jul 29, 2019
50b9abe
update
hunterlxt Jul 29, 2019
6e825d0
update
hunterlxt Jul 29, 2019
0481522
noc++
hunterlxt Jul 29, 2019
9afddf2
update script name
hunterlxt Jul 30, 2019
8c41cf3
add macos bindings
mahjonp Jul 30, 2019
46a47ae
cargo fmt
hunterlxt Jul 30, 2019
bf23bb2
update
hunterlxt Jul 30, 2019
cb6cb3c
update
hunterlxt Jul 30, 2019
706cf01
Good Night
hunterlxt Jul 30, 2019
5d75a79
Good Night
hunterlxt Jul 30, 2019
e34a695
Update build.rs
hunterlxt Jul 30, 2019
ce54a95
update
hunterlxt Jul 31, 2019
054ed05
update
hunterlxt Jul 31, 2019
fe857cb
update
hunterlxt Jul 31, 2019
2871e8a
add macos bindings
mahjonp Jul 31, 2019
298aa3e
update
hunterlxt Jul 31, 2019
bdd1454
update
hunterlxt Jul 31, 2019
e5fc34a
update
hunterlxt Jul 31, 2019
6333612
update
hunterlxt Jul 31, 2019
ef52f2d
update by reviews
hunterlxt Aug 2, 2019
036dc37
update
hunterlxt Aug 2, 2019
a1ca387
address comment and remove osx support
BusyJay Aug 5, 2019
696a9dd
update README
BusyJay Aug 5, 2019
ec29b89
fix eol
BusyJay Aug 5, 2019
baf33ed
address comment
BusyJay Aug 5, 2019
537f2ef
address comment
BusyJay Aug 5, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,6 @@ sudo: false
language: rust
git:
submodules: false
cache:
directories:
- $HOME/.cargo
- $HOME/.cache
- $HOME/tools
- $TRAVIS_BUILD_DIR/target
before_cache:
- find $TRAVIS_BUILD_DIR/target/debug -maxdepth 1 -type f -delete

env:
global:
Expand Down Expand Up @@ -60,6 +52,7 @@ matrix:

addons:
apt:
update: true
sources:
- llvm-toolchain-xenial-7
packages:
Expand Down Expand Up @@ -100,6 +93,7 @@ before_script:
script:
- if [[ $TRAVIS_OS_NAME == "linux" ]] && [[ $TRAVIS_RUST_VERSION == "stable" ]]; then
rustup component add rustfmt && cargo fmt --all -- --check;
scripts/generate-bindings.sh && git diff --exit-code HEAD;
fi
- if [[ $TRAVIS_OS_NAME == "linux" ]]; then scripts/lint-grpc-sys.sh && git diff-index --quiet HEAD; fi
- if [[ $TRAVIS_RUST_VERSION == "stable" ]]; then rustup component add clippy && cargo clippy --all -- -D clippy::all && cargo clippy --all --no-default-features --features prost-codec -- -D clippy::all; fi
Expand Down
20 changes: 16 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ This project is still under development. The following features with the check m
- CMake >= 3.8.0
- Rust >= 1.19.0
- binutils >= 2.22
- LLVM and Clang >= 3.9 recommended by bindgen
- By default, the [secure feature](#feature-secure) is enabled, therefore Go (>=1.7) is required.
- LLVM and Clang >= 3.9 if you need to generate bindings at compile time.
- By default, the [secure feature](#feature-secure) is provided by boringssl, which requires Go (>=1.7) to build. You can also use openssl instead by enabling [openssl feature](#feature-openssl).

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

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

For Windows, you also need to install following software:

- Active State Perl
Expand All @@ -41,7 +43,7 @@ For Windows, you also need to install following software:
## Build

```
$ git submodule update --init --recursive # if you just cloned the repository
$ ./scripts/reset-submodule.cmd # if you just cloned the repository
$ cargo build
```

Expand Down Expand Up @@ -113,11 +115,21 @@ your `Cargo.toml`'s features list for `gprcio`. E.g.:
grpcio = { version = "0.4.4", features = ["openssl"] }
```


## Performance

See [benchmark](https://github.com/pingcap/grpc-rs/tree/master/benchmark) to find out how to run a benchmark by yourself.

Cross Compile
-------------
See [cross_compile](cross_compile.md)

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
```
2 changes: 1 addition & 1 deletion grpc-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ cc = "1.0"
cmake = "0.1.40"
pkg-config = "0.3"
walkdir = "2.2.9"
bindgen = { version = "0.50.0", default-features = false }
bindgen = { version = "0.51.0", default-features = false }
Loading