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
*: use lite runtime #366
*: use lite runtime #366
Conversation
According to golang/protobuf#788, |
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 am surprised that this can reduce compiling time, cool job.
LGTM
Cool, LGTM |
It seems this optimization breaks Java code.
Currently TiSpark pins to a specific version of kvproto and integration tests pulls latest version of TiDB bundle making sure that TiSpark still works with latest TiDB. So this PR will not break TiSpark instantly. However, protobuf is not only used in TiSpark, but also all other places in the platform. Instead of carefully shade it with a specific LITE version, I'd rather simply use a script removing the line while building. |
@flowbehappy please take a look at TiFlash part. |
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.
Nice find @BusyJay !
It breaks the build process of TiFlash, which is a CPP project. We should reconsider if this PR is suitable. According to document:
Here is the error log:
|
I'm working on a workaround to get it enabled only for rust. Hopefully stepancheg/rust-protobuf#399 can be merged, otherwise I guess I have to do some scripting. |
I can successfully get it compiled on my local machine, but on CI it fails. It seems cargo in CI resolves protobuf as version 2.6.0, while my local cargo resolves it as 2.0.6. Really magical. 🤔 |
@BusyJay Maybe this article can help us understand how some dependency resolution is done in Rust? Sometimes it's a puzzle to me too. :( http://aturon.github.io/2018/07/25/cargo-version-selection/ Maybe it's related to the patch in the cargo.toml? |
The CI shouldn't be doing any crate resolution at all since the lockfile is checked in! Maybe the lockfile on this branch is not updated. To avoid stale lockfiles in the tree I suggest running CI with cc @zhangjinpeng1987 re adding |
I think there is a bug in cargo. After removing patch configuration, dependencies are resolved as expected. Specifically, protobuf is resolved to 2.0.6 as there is a rule '~2.0' in the Cargo.toml. But adding the patch configuration and removing Cargo.lock,
No, it's not. It's a library, Cargo.lock is not expected to be checked in. |
@ilovesoup @flowbehappy I use custom options to enable lite runtime now, can you check it out again? |
Indeed. I thought I was looking at a tikv pr. |
LGTM 👍 |
|
||
# TODO: use patch instead if rust-lang/cargo#6762 is resolved. | ||
[replace] | ||
"protobuf-codegen:2.0.6" = { git = "https://github.com/busyjay/rust-protobuf.git", branch = "customize-lite-runtime-2.0" } |
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.
can we use lite runtime in prost?
We have never used any features that requires reflection, so use a lite runtime. On my machine, lite runtime compiles faster, and release compile times of TiKV changes from 15 minutes to 13 minutes.
I will check whether TiDB/PD/TiSpark requires full runtime later.