mtp401 / protoc-grpcio Goto Github PK
View Code? Open in Web Editor NEWA programmatic API to the grpc-rs compiler
License: Other
A programmatic API to the grpc-rs compiler
License: Other
A tag is needed for 4.0.0
after running cargo update
on my project it fails with the following
error: failed to run custom build command for `grpcio-sys v0.6.0`
Caused by:
process didn't exit successfully: `/target/release/build/grpcio-sys-b68f9838a28e5f40/build-script-build` (exit status: 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:rerun-if-env-changed=CARGO_CFG_TARGET_OS
cargo:rerun-if-env-changed=CARGO_CFG_TARGET_OS
cargo:rustc-link-search=native=/target/x86_64-unknown-linux-gnu/release/build/libz-sys-59bf788a8acc8bd7/out/build
cargo:rustc-link-search=native=/target/x86_64-unknown-linux-gnu/release/build/libz-sys-59bf788a8acc8bd7/out/lib
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 = Some("/target/x86_64-unknown-linux-gnu/release/build/libz-sys-59bf788a8acc8bd7/out/build")
CMAKE_x86_64-unknown-linux-gnu = None
CMAKE_x86_64_unknown_linux_gnu = None
HOST_CMAKE = None
CMAKE = None
running: "cmake" "/cargo/registry/src/github.com-1ecc6299db9ec823/grpcio-sys-0.6.0/grpc" "-DgRPC_INSTALL=false" "-DgRPC_BUILD_CSHARP_EXT=false" "-DgRPC_BUILD_CODEGEN=false" "-DgRPC_BENCHMARK_PROVIDER=none" "-DgRPC_SSL_PROVIDER=package" "-DgRPC_ZLIB_PROVIDER=package" "-DCMAKE_INSTALL_PREFIX=/target/x86_64-unknown-linux-gnu/release/build/grpcio-sys-a2da621fb4d4ddf1/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"
-- Configuring done
-- Generating done
-- Build files have been written to: /target/x86_64-unknown-linux-gnu/release/build/grpcio-sys-a2da621fb4d4ddf1/out/build
running: "cmake" "--build" "." "--target" "grpc" "--config" "Release" "--parallel" "32"
--- stderr
CMake Warning at cmake/protobuf.cmake:51 (message):
gRPC_PROTOBUF_PROVIDER is "module" but PROTOBUF_ROOT_DIR is wrong
Call Stack (most recent call first):
CMakeLists.txt:207 (include)
Unknown argument --parallel
Unknown argument 32
Usage: cmake --build <dir> [options] [-- [native-options]]
Options:
<dir> = Project binary directory to be built.
--target <tgt> = Build <tgt> instead of default targets.
May only be specified once.
--config <cfg> = For multi-configuration tools, choose <cfg>.
--clean-first = Build target 'clean' first, then build.
(To clean only, use --target 'clean'.)
--use-stderr = Ignored. Behavior is default in CMake >= 3.0.
-- = Pass remaining options to the native tool.
thread 'main' panicked at '
command did not execute successfully, got: exit status: 1
build script failed, must exit now', /cargo/registry/src/github.com-1ecc6299db9ec823/cmake-0.1.46/src/lib.rs:974:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
I think cmake
patch bump broke, pinning it to previous version works fine
```[build-dependencies]
protoc-grpcio = "3.0"
cmake = "=0.1.45"
sorry,my English isnt well,so I try to descript the problem I had
Describe the bug
After read the Readme, I can generate throuth the first way Manual Generation with command
protoc --rust_out=. --grpc_out=. --plugin=protoc-gen-grpc=which grpc_rust_plugin example.proto.
bug when I try to generate proto file by protoc-grpcio.cargo build fail
failed to execute command: Permission denied (os error 13)
.
and the trace show that it panic at
if self.always_configure || !build.join("CMakeCache.txt").exists() {
run(cmd.env("CMAKE_PREFIX_PATH", cmake_prefix_path), "cmake");
} else {
println!("CMake project was already configured. Skipping configuration step.");
}
fn run(cmd: &mut Command, program: &str) {
println!("running: {:?}", cmd);
let status = match cmd.status() {
Ok(status) => status,
Err(ref e) if e.kind() == ErrorKind::NotFound => {
fail(&format!("failed to execute command: {}\nis `{}` not installed?",
e, program));
}
Err(e) => fail(&format!("failed to execute command: {}", e)),
};
if !status.success() {
fail(&format!("command did not execute successfully, got: {}", status));
}
}
To Reproduce
Steps to reproduce the behavior:
cargo run --manifest-path example/Cargo.toml --bin server
Expected behavior
build fail and panic
thread 'main' panicked at ' failed to execute command: Permission denied (os error 13)
System information
Additional context
Right now, if I want to use protobuf_codegen::Customize
to enable serde support, I have to include protobuf_codegen
in my codebase. I think it'd make sense if this library reexported it.
Hello, I was trying to use this to build my proto file. I have used them in go and java with the recommended library and so I know they are good.
Here is the snippet of my terminal :
$ git clone https://github.com/mtp401/protoc-grpcio
Cloning into 'protoc-grpcio'...
remote: Enumerating objects: 243, done.
remote: Total 243 (delta 0), reused 0 (delta 0), pack-reused 243
Receiving objects: 100% (243/243), 82.05 KiB | 1012.00 KiB/s, done.
Resolving deltas: 100% (118/118), done.
$ cd protoc-grpcio/example/
$ ls
Cargo.lock Cargo.toml build.rs src
$ cd ..
$ cargo run --manifest-path example/Cargo.toml --bin server
Downloaded aho-corasick v0.7.10
Downloaded shlex v0.1.1
Downloaded log v0.4.8
Downloaded unicode-xid v0.2.0
Downloaded quote v1.0.2
Downloaded protobuf-codegen v2.14.0
Downloaded protobuf v2.14.0
Downloaded nom v4.2.3
Downloaded peeking_take_while v0.1.2
Downloaded proc-macro-hack v0.5.16
Downloaded synstructure v0.10.2
Downloaded proc-macro2 v0.4.30
Downloaded version_check v0.1.5
Downloaded protoc v2.14.0
Downloaded rand_chacha v0.2.1
Downloaded clang-sys v0.28.1
Downloaded syn v1.0.31
Downloaded rustc-hash v1.1.0
Downloaded remove_dir_all v0.5.2
Downloaded backtrace v0.3.38
Downloaded rand v0.7.2
Downloaded parking_lot v0.10.2
Downloaded failure_derive v0.1.5
Downloaded cmake v0.1.42
Downloaded pin-project-internal v0.4.20
Downloaded syn v0.15.44
Downloaded unicode-xid v0.1.0
Downloaded smallvec v1.4.0
Downloaded bindgen v0.51.1
Downloaded ppv-lite86 v0.2.5
Downloaded c2-chacha v0.2.2
Downloaded failure v0.1.5
Downloaded grpcio-compiler v0.6.0
Downloaded pkg-config v0.3.16
Downloaded parking_lot_core v0.7.2
Downloaded proc-macro2 v1.0.18
Downloaded pin-project v0.4.20
Downloaded cexpr v0.3.6
Downloaded quote v0.6.13
Downloaded proc-macro-nested v0.1.5
Downloaded lock_api v0.3.4
Downloaded libloading v0.5.2
Downloaded grpcio-sys v0.6.0
Downloaded grpcio v0.6.0
Downloaded getrandom v0.1.12
Downloaded 45 crates (12.2 MB) in 2.22s (largest was `grpcio-sys` at 10.4 MB)
Compiling libc v0.2.62
Compiling cc v1.0.45
Compiling cfg-if v0.1.10
Compiling proc-macro2 v1.0.18
Compiling lazy_static v1.4.0
Compiling unicode-xid v0.2.0
Compiling memchr v2.3.3
Compiling proc-macro2 v0.4.30
Compiling unicode-xid v0.1.0
Compiling syn v1.0.31
Compiling version_check v0.1.5
Compiling getrandom v0.1.12
Compiling glob v0.3.0
Compiling syn v0.15.44
Compiling protobuf v2.14.0
Compiling pkg-config v0.3.16
Compiling bitflags v1.2.1
Compiling ppv-lite86 v0.2.5
Compiling log v0.4.8
Compiling failure_derive v0.1.5
Compiling bindgen v0.51.1
Compiling proc-macro-nested v0.1.5
Compiling regex-syntax v0.6.18
Compiling same-file v1.0.6
Compiling shlex v0.1.1
Compiling proc-macro-hack v0.5.16
Compiling rustc-demangle v0.1.16
Compiling peeking_take_while v0.1.2
Compiling rustc-hash v1.1.0
Compiling futures-sink v0.3.5
Compiling futures-core v0.3.5
Compiling once_cell v1.4.0
Compiling slab v0.4.2
Compiling pin-utils v0.1.0
Compiling futures-io v0.3.5
Compiling remove_dir_all v0.5.2
Compiling scopeguard v1.1.0
Compiling smallvec v1.4.0
Compiling thread_local v1.0.1
Compiling nom v4.2.3
Compiling walkdir v2.3.1
Compiling cmake v0.1.42
Compiling futures-channel v0.3.5
Compiling clang-sys v0.28.1
Compiling lock_api v0.3.4
Compiling futures-task v0.3.5
Compiling c2-chacha v0.2.2
Compiling libloading v0.5.2
Compiling backtrace-sys v0.1.31
Compiling libz-sys v1.0.25
Compiling aho-corasick v0.7.10
Compiling protoc v2.14.0
Compiling parking_lot_core v0.7.2
Compiling quote v0.6.13
Compiling rand_core v0.5.1
Compiling quote v1.0.2
Compiling parking_lot v0.10.2
Compiling rand_chacha v0.2.1
Compiling rand v0.7.2
Compiling cexpr v0.3.6
The following warnings were emitted during compilation:
warning: src/zlib/gzlib.c:214:15: error: implicitly declaring library function 'snprintf' with type 'int (char *, unsigned long, const char *, ...)' [-Werror,-Wimplicit-function-declaration]
warning: (void)snprintf(state->path, len + 1, "%s", (const char *)path);
warning: ^
warning: src/zlib/gzlib.c:214:15: note: include the header <stdio.h> or explicitly provide a declaration for 'snprintf'
warning: 1 error generated.
error: failed to run custom build command for `libz-sys v1.0.25`
Caused by:
process didn't exit successfully: `****/dev/protoc-grpcio/example/target/debug/build/libz-sys-258fc38e23001e92/build-script-build` (exit code: 1)
--- stdout
cargo:rerun-if-env-changed=LIBZ_SYS_STATIC
cargo:rerun-if-changed=build.rs
TARGET = Some("x86_64-apple-darwin")
OPT_LEVEL = Some("0")
HOST = Some("x86_64-apple-darwin")
CC_x86_64-apple-darwin = None
CC_x86_64_apple_darwin = None
HOST_CC = None
CC = None
CFLAGS_x86_64-apple-darwin = None
CFLAGS_x86_64_apple_darwin = None
HOST_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("true")
CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2,sse3,ssse3")
running: "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-I" "src/zlib" "-fvisibility=hidden" "-DSTDC" "-D_LARGEFILE64_SOURCE" "-D_POSIX_SOURCE" "-o" "****/dev/protoc-grpcio/example/target/debug/build/libz-sys-fe0e84e226ff4395/out/build/src/zlib/adler32.o" "-c" "src/zlib/adler32.c"
exit code: 0
running: "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-I" "src/zlib" "-fvisibility=hidden" "-DSTDC" "-D_LARGEFILE64_SOURCE" "-D_POSIX_SOURCE" "-o" "****/dev/protoc-grpcio/example/target/debug/build/libz-sys-fe0e84e226ff4395/out/build/src/zlib/compress.o" "-c" "src/zlib/compress.c"
exit code: 0
running: "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-I" "src/zlib" "-fvisibility=hidden" "-DSTDC" "-D_LARGEFILE64_SOURCE" "-D_POSIX_SOURCE" "-o" "****/dev/protoc-grpcio/example/target/debug/build/libz-sys-fe0e84e226ff4395/out/build/src/zlib/crc32.o" "-c" "src/zlib/crc32.c"
exit code: 0
running: "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-I" "src/zlib" "-fvisibility=hidden" "-DSTDC" "-D_LARGEFILE64_SOURCE" "-D_POSIX_SOURCE" "-o" "****/dev/protoc-grpcio/example/target/debug/build/libz-sys-fe0e84e226ff4395/out/build/src/zlib/deflate.o" "-c" "src/zlib/deflate.c"
exit code: 0
running: "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-I" "src/zlib" "-fvisibility=hidden" "-DSTDC" "-D_LARGEFILE64_SOURCE" "-D_POSIX_SOURCE" "-o" "****/dev/protoc-grpcio/example/target/debug/build/libz-sys-fe0e84e226ff4395/out/build/src/zlib/gzclose.o" "-c" "src/zlib/gzclose.c"
exit code: 0
running: "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-I" "src/zlib" "-fvisibility=hidden" "-DSTDC" "-D_LARGEFILE64_SOURCE" "-D_POSIX_SOURCE" "-o" "****/dev/protoc-grpcio/example/target/debug/build/libz-sys-fe0e84e226ff4395/out/build/src/zlib/gzlib.o" "-c" "src/zlib/gzlib.c"
cargo:warning=src/zlib/gzlib.c:214:15: error: implicitly declaring library function 'snprintf' with type 'int (char *, unsigned long, const char *, ...)' [-Werror,-Wimplicit-function-declaration]
cargo:warning= (void)snprintf(state->path, len + 1, "%s", (const char *)path);
cargo:warning= ^
cargo:warning=src/zlib/gzlib.c:214:15: note: include the header <stdio.h> or explicitly provide a declaration for 'snprintf'
cargo:warning=1 error generated.
exit code: 1
--- stderr
error occurred: Command "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-I" "src/zlib" "-fvisibility=hidden" "-DSTDC" "-D_LARGEFILE64_SOURCE" "-D_POSIX_SOURCE" "-o" "placeholder/dev/protoc-grpcio/example/target/debug/build/libz-sys-fe0e84e226ff4395/out/build/src/zlib/gzlib.o" "-c" "src/zlib/gzlib.c" with args "cc" did not execute successfully (status code exit code: 1).
warning: build failed, waiting for other jobs to finish...
error: build failed
I can't really give pointers on this, I'm trying out Rust with this so I'm not good for now. If had to guess I would say it's in the C compilation process.
If it's of any use, I'm on OSX last version.
The example project requires use of 0.1.26, and currently generated code depends on that
tikv/grpc-rs#187 was recently merged into grpc-rs
to move to protobuf
~2.0.
This issue is a request for protoc-grpcio
to update to protobuf
2.0 as well. This would be dependent upon a new release of the grpcio-compiler
crate, which hasn't yet been pushed.
I've pushed up commit a99c4d2 to my fork that, right now, is rev-pinned because the updated grpcio-compiler
crate hasn't yet been released. I've tested it against my build.rs
script to generate from my protos and it seems to work just fine thus far (my grpc-rs
dependency was also rev-pinned to the merge commit of tikv/grpc-rs#187).
Thank you!
Here's my repo (ignore the state it's it, im transitioning it from grpc-rust to try things out):
https://github.com/brandonpollack23/rustchat
Here's the error:
C:\Users\brandon\AppData\Local\Temp\.tmpRoIDe7: Permission denied
thread 'main' panicked at 'Failed to compile gRPC protos: Custom { kind: Other, error: StringError("protoc exited with non-zero exit code") }
stack backtrace:
0: failure::backtrace::internal::InternalBacktrace::new (0x7ff7167aa6b3)
at C:\Users\brandon\.cargo\registry\src\github.com-1ecc6299db9ec823\failure-0.1.3\src\backtrace\internal.rs:44
1: failure::backtrace::Backtrace::new (0x7ff7167a955e)
at C:\Users\brandon\.cargo\registry\src\github.com-1ecc6299db9ec823\failure-0.1.3\src\backtrace\mod.rs:111
2: failure::error::error_impl::{{impl}}::from<std::io::error::Error> (0x7ff71675c7d0)
at C:\Users\brandon\.cargo\registry\src\github.com-1ecc6299db9ec823\failure-0.1.3\src\error\error_impl.rs:19
3: failure::error::{{impl}}::from<std::io::error::Error> (0x7ff71675c3bf)
at C:\Users\brandon\.cargo\registry\src\github.com-1ecc6299db9ec823\failure-0.1.3\src\error\mod.rs:36
4: core::convert::{{impl}}::into<std::io::error::Error,failure::error::Error> (0x7ff71676469f)
at \libcore\convert.rs:456
5: failure::context::Context<str*>::with_err<str*,std::io::error::Error> (0x7ff71675f67f)
at C:\Users\brandon\.cargo\registry\src\github.com-1ecc6299db9ec823\failure-0.1.3\src\context.rs:105
6: failure::Fail::context<std::io::error::Error,str*> (0x7ff716764791)
at C:\Users\brandon\.cargo\registry\src\github.com-1ecc6299db9ec823\failure-0.1.3\src\lib.rs:154
7: failure::result_ext::{{impl}}::context::{{closure}}<(),std::io::error::Error,str*> (0x7ff71676448b)
at C:\Users\brandon\.cargo\registry\src\github.com-1ecc6299db9ec823\failure-0.1.3\src\result_ext.rs:164
8: core::result::Result<(), std::io::error::Error>::map_err<(),std::io::error::Error,failure::context::Context<str*>,closure> (0x7ff71675b7e2)
at \libcore\result.rs:530
9: failure::result_ext::{{impl}}::context<(),std::io::error::Error,str*> (0x7ff716758fdf)
at C:\Users\brandon\.cargo\registry\src\github.com-1ecc6299db9ec823\failure-0.1.3\src\result_ext.rs:165
10: protoc_grpcio::compile_grpc_protos<[str*; 1]*,[str*; 1]*,str*> (0x7ff716754e40)
at C:\Users\brandon\.cargo\registry\src\github.com-1ecc6299db9ec823\protoc-grpcio-0.3.1\src\lib.rs:225
11: build_script_build::main (0x7ff716764da7)
at C:\Users\brandon\CLionProjects\rustchat\build.rs:4
12: std::rt::lang_start::{{closure}}<()> (0x7ff7167516b0)
at \libstd\rt.rs:74
13: std::panicking::try::do_call<closure,i32> (0x7ff716a393e7)
at /rustc/b6c32da9b0481e3e9d737153286b3ff8aa39a22c\src/libstd\panicking.rs:310
14: panic_unwind::__rust_maybe_catch_panic (0x7ff716a447b2)
at /rustc/b6c32da9b0481e3e9d737153286b3ff8aa39a22c\src/libpanic_unwind\lib.rs:102
15: std::rt::lang_start_internal (0x7ff716a27c83)
at /rustc/b6c32da9b0481e3e9d737153286b3ff8aa39a22c\src/libstd\rt.rs:58
16: std::rt::lang_start<()> (0x7ff71675168b)
at \libstd\rt.rs:74
17: main (0x7ff716764e00)
18: __scrt_common_main_seh (0x7ff716a5360c)
at f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:283
19: BaseThreadInitThunk (0x7fff3b1c3034)
https://docs.rs/protobuf just released v3, with changes that make generated code to fail to compile.
Are there any plans to support passing the binary location of protoc, similar to https://docs.rs/protoc-rust/2.14.0/protoc_rust/struct.Codegen.html#method.protoc_path?
Hi there,
Thanks for your crate! I'm trying to use it for a project, and I'm having an issue telling protoc where my protos live. The example in this repo yields a similar for me:
$ cd example
$ cargo build
--- stdout
cargo:rerun-if-changed=src/protos
--- stderr
example/diner.proto: No such file or directory
thread 'main' panicked at 'Failed to compile gRPC definitions!: Custom { kind: Other, error: StringError("protoc exited with non-zero exit code") }
$ protoc --version
libprotoc 3.0.0
$ rustc --version
rustc 1.29.0-nightly (874dec25e 2018-07-21)
$ lsb_release -a
Distributor ID: Ubuntu
Description: Ubuntu 17.10
Release: 17.10
Codename: artful
Do you have any ideas?
Hello,
I'd like to generate my output files in separate folders, and there may be requires on one another.
I fear that the includes would generate dupplicates of my messages for every place they are required on if I just generate them one by one.
This is a bother because we'd like them to be of the same type.
Any idea as to how we can achieve this ?
I ran across an excellent example of sending a file via grpc stream and golang recently.
https://ops.tips/blog/sending-files-via-grpc/
https://github.com/cirocosta/gupload
Golang is very easy to use I must admit.
I tried to modify your rust protoc-grpcio example to hold another grpc function send_file()
imitating the gupload behaviour, but I can't find the equivalent of c++ WritesDone(), WritesFinish(). I found Status::ok.
The other thing I found odd is WriteFlags::default(). It is not explicit nor evident what the default settings are.
I tried sending just one chunk, but it said remote connection cancelled which implies the server didn't receive the equivalent of writesDone/writesfinish.
I did something similar with tarpc by the way however sending larger files bugs it out.
google/tarpc#224 (comment)
BTW grpc-rs route_guide's record_route() function uses a client stream, but I can't for the life of me wrap my head around finding the necessary functions that do as I said c++ writesDone()/writesFinish() capability.
Have you run across these in your travels? Thank you in advance.
I get the following clippy warnings
warning: lint name `clippy` is deprecated and may not have an effect in the future. Also `cfg_attr(cargo-clippy)` won't be necessary anymore
--> oysterpack-trust-grpc/src/protos/metrics.rs:6:10
|
6 | #![allow(clippy)]
| ^^^^^^ help: change it to: `clippy::all`
|
= note: #[warn(renamed_and_removed_lints)] on by default
I am running the latest and greatest versions.
Hello,
Our cargo-audit
run has been advising us that protoc-grpcio
depends on an unmaintaned crate (failure
). I'm opening this mostly as an FYI and to ask whether you'd accept contributions to migrate to some other error-management crate instead, like anyhow
. The downside is that it would obviously break API compatibility.
Initially from tikv/grpc-rs#480
It would be nice if protoc-grpcio
could support generating prost protobuf code
It looks like the path information is thrown out right here and just the basename is used.
We have a more complex proto tree in Pants and I'd like to use your tool in our build script in place of our current shelling-out to protoc.
gRPC compilation fails in a docker container see below how to reproduce this.
Dockerfile
to reproduce run with
docker build -t grpcio-temp .
FROM liuchong/rustup:nightly
RUN apt-get update && \
apt-get install --no-install-recommends -y \
cmake \
golang \
protobuf-compiler \
protobuf-compiler \
git
RUN git clone https://github.com/mtp401/protoc-grpcio.git
RUN cd protoc-grpcio/example && RUST_BACKTRACE=1 cargo test -vv
error: failed to run custom build command for `example v0.0.1 (/root/protoc-grpcio/example)`
process didn't exit successfully: `/root/protoc-grpcio/example/target/debug/build/example-1877cef8f11f8b15/build-script-build` (exit code: 101)
--- stdout
cargo:rerun-if-changed=src/protos
--- stderr
example/diner.proto: No such file or directory
thread 'main' panicked at 'Failed to compile gRPC definitions!: Custom { kind: Other, error: StringError("protoc exited with non-zero exit code") }
stack backtrace:
0: 0x562bed5f3745 - backtrace::backtrace::libunwind::trace::hdbc277b57fee3187
at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.8/src/backtrace/libunwind.rs:53
- backtrace::backtrace::trace::h9517ed56f5dfdeaf
at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.8/src/backtrace/mod.rs:42
1: 0x562bed5e8f7e - backtrace::capture::Backtrace::new_unresolved::h8c3ae1e0a94d4235
at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.8/src/capture.rs:88
2: 0x562bed5e7443 - failure::backtrace::internal::InternalBacktrace::new::h2bc18afefecc8700
at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.1/src/backtrace/internal.rs:44
3: 0x562bed5e688c - failure::backtrace::Backtrace::new::h97a09cb570137c12
at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.1/src/backtrace/mod.rs:98
4: 0x562bed5aa34d - <failure::error::Error as core::convert::From<F>>::from::h6d07176afbacf89e
at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.1/src/error.rs:34
5: 0x562bed5b862e - <T as core::convert::Into<U>>::into::hcd7d6c71dee3a8b8
at libcore/convert.rs:456
6: 0x562bed5b7568 - <failure::context::Context<D>>::with_err::hf3e8e69a867be956
at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.1/src/context.rs:78
7: 0x562bed5b86cc - failure::Fail::context::h89f9f49cf0492ee5
at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.1/src/lib.rs:127
8: 0x562bed5b8b39 - <core::result::Result<T, E> as failure::result_ext::ResultExt<T, E>>::context::{{closure}}::h713b413aed581568
at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.1/src/result_ext.rs:32
9: 0x562bed5b0594 - <core::result::Result<T, E>>::map_err::h35212bb56ba02206
at libcore/result.rs:530
10: 0x562bed5adfbd - <core::result::Result<T, E> as failure::result_ext::ResultExt<T, E>>::context::h1225d02a64e9630d
at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.1/src/result_ext.rs:32
11: 0x562bed5b35c2 - protoc_grpcio::compile_grpc_protos::h2ccd84404bb8aada
at /root/protoc-grpcio/src/lib.rs:224
12: 0x562bed5a4ef1 - build_script_build::main::h3e9df73dbd448825
at /root/protoc-grpcio/example/build.rs:6
13: 0x562bed5b7f9f - std::rt::lang_start::{{closure}}::h9d45ed3ec5f9be81
at libstd/rt.rs:74
14: 0x562bed887f62 - std::rt::lang_start_internal::{{closure}}::hfb96f2c3e3e3ca27
at libstd/rt.rs:59
- std::panicking::try::do_call::hb5c650dad7b54bc8
at libstd/panicking.rs:310
15: 0x562bed8a8459 - __rust_maybe_catch_panic
at libpanic_unwind/lib.rs:102
16: 0x562bed893505 - std::panicking::try::hfdbf960f69164b7e
at libstd/panicking.rs:289
- std::panic::catch_unwind::ha86229f9b0fb2c07
at libstd/panic.rs:392
- std::rt::lang_start_internal::hbe298169bff7a199
at libstd/rt.rs:58
17: 0x562bed5b7f77 - std::rt::lang_start::h283127b68027dc0d
at libstd/rt.rs:74
18: 0x562bed5a4f59 - main
19: 0x7fbc80abf2e0 - __libc_start_main
20: 0x562bed5a4cf9 - _start
21: 0x0 - <unknown>
Because #30 updates grpcio-compiler to a version that generates code non compatible with previous code (hence released as breaking 0.5 -> 0.6), protoc-grpcio now also generates code that is non-compatible with previous code, which makes #30 a breaking change itself.
As such, it should not be released as semver-compatible, as this breaks the projects that depend on it.
So 1.3.0 should be yanked, and this version should be released as 2.0.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.