-
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
feat: fallback to build protobuf from source #67
Conversation
1. Avoid bundle binaries 2. Leverage C++ portability Signed-off-by: tison <[email protected]>
See https://protobuf.dev/support/version-support/ Signed-off-by: tison <[email protected]>
Signed-off-by: tison <[email protected]>
Signed-off-by: tison <[email protected]>
I'm afraid building from source would require extra dependencies like C/C++ compilers. |
This patch include three changes:
If you'd prefer add macos aarch64 binary to resolve 3 and agree on the changes for 1 and 2, I can find time to restore and update the binaries. |
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.
I believe protoc-osx-aarch64 was omitted because it exceeded the size limit (10MiB at that time) of a crate that can be published to crates.io. Better check if the problem still exists.
src/lib.rs
Outdated
let caps = ver_re.captures(from_utf8(&o.stdout).unwrap()).unwrap(); | ||
let major = caps.get(1).unwrap().as_str().parse::<i16>().unwrap(); | ||
let minor = caps.get(2).unwrap().as_str().parse::<i16>().unwrap(); | ||
if (major == 3 && minor >= 1) || (major >= 20) { |
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.
How about (major, minor) >= (3, 1)
?
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 the link in commit c1462c6.
I tried to follow protobuf's version policy that they change the version pattern only after 20.x. But it should be physically OK to use (major, minor) >= (3, 1)
.
Note protobuf-src may not work for Windows. |
OK. Then I'll try the restore and update binaries way. Perhaps I can run |
Signed-off-by: tison <[email protected]>
@BusyJay Updated. I use 23.3 protoc and check it works well on osx-aarch_64 env. |
The resulting package is clearly larger than 10MiB, I'm afraid this change can't be published to crates.io. |
It seems dry-run doesn't test against it. cc @nrc could you please take a look and check the cargo limitation? cc @weihanglo |
crates.io has its own stricter limitations that Cargo doesn't check at this time. Part of the reason Cargo has less checks because Cargo is not only for crates.io. We would like to see a new publish check API but the work is not on priority so far I can tell. The 10MiB limit is documented here. See also |
@BusyJay Perhaps we drop the support to
|
@weihanglo ... and Thank you! |
I think fallback to build from source may not be a bad idea giving that the community prefers not to use bundled binaries (like prost-build recently did). But we still need to think a way to support Windows. |
linux-ppcle_64 and linux-aarch_64 are mainly used on server side. |
Signed-off-by: tison <[email protected]>
@BusyJay Updated. As we discussed offline -
|
Yeah. I suspect on server side they're used less, while aarch_64 can be a trend :D |
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.
Rest LGTM
Signed-off-by: tison <[email protected]>
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.
LGTM
Maybe we can release a 0.15.0 now and upgrade downsteams like raft-rs and tikv. |
No description provided.