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
Split release/dist_release makefile rules in two, reorganize and document makefiles #4996
Conversation
Signed-off-by: Brian Anderson <andersrb@gmail.com>
Re-introduce build_release. Signed-off-by: Brian Anderson <andersrb@gmail.com>
Signed-off-by: Brian Anderson <andersrb@gmail.com>
Signed-off-by: Brian Anderson <andersrb@gmail.com>
Signed-off-by: Brian Anderson <andersrb@gmail.com>
Signed-off-by: Brian Anderson <andersrb@gmail.com>
Signed-off-by: Brian Anderson <andersrb@gmail.com>
It should have been called build_dist_release Signed-off-by: Brian Anderson <andersrb@gmail.com>
Signed-off-by: Brian Anderson <andersrb@gmail.com>
Signed-off-by: Brian Anderson <andersrb@gmail.com>
Great @brson Have we already fixed the problem that removing debuginfo from RocksDB? |
Signed-off-by: Brian Anderson <andersrb@gmail.com>
Signed-off-by: Brian Anderson <andersrb@gmail.com>
Signed-off-by: Brian Anderson <andersrb@gmail.com>
I pushed commits to address feedback @siddontang .
No. There are two problems related to debuginfo in RocksDB. They aren't fixed, but they are also not related specifically to the release profile:
|
@mkdir -p ${BIN_PATH} | ||
@cp -f ${CARGO_TARGET_DIR}/release/tikv-ctl ${CARGO_TARGET_DIR}/release/tikv-server ${CARGO_TARGET_DIR}/release/tikv-importer ${BIN_PATH}/ | ||
bash scripts/check-sse4_2.sh | ||
|
||
# Build with release flag as if it were for distribution, but without | ||
# additional sanity checks and file movement. | ||
build_dist_release: |
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.
please make sure again that now we use dist_release to build TiKV in CI and publish this binary.
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.
Yep, it has been confirmed.
I am with this change PTAL @nrc @breeswish |
This looks great, @brson , thanks for organizing this confusing file. |
Signed-off-by: Brian Anderson <andersrb@gmail.com>
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 (using a script to copy the profiles is pretty awful, but I can't think of a better way to do it)
…ment makefiles (tikv#4996) * make: make dist_ rules call dist_rules Signed-off-by: Brian Anderson <andersrb@gmail.com>
What have you changed? (mandatory)
The main thing this patch does is to modify the default cargo release profile to use thinLTO instead of full LTO, and to turn debuginfo off. This reduces full build time by 25%, and partial build time by 30%.
It makes the various
release
anddist_release
rules independent of each other. Now thedist_release
rules rely on thescripts/run-cargo.sh
script to put a special.cargo/config
in place that contains the "real" release profile. This script requires the use of the unstable-Zcargo-profile
flag.One thing to note about this arrangement is that if any of the
dist_release
commands are interrupted they will leave.cargo/config
in place. Subsequent cargo commands print a warning about cargo profiles being unstable, and effectively ignores the config file. I expect this to not be encountered by most contributors as they are not encouraged to run thedist_release
targets by hand.In the process it deletes all of the experimental
x-foo
makefile rules, leaving only one in place fordist
.As part of this work I restructured and documented the entire makefile. All pre-existing rules remain, they just might be in a different order. The
build_release
rule, which does the dist release without the extra testing and file moving, is renamed tobuild_dist_release
for consistency, andbuild_release
left in with a note to usebuild_dist_release
.I have confirmed @BusyJay that even with debuginfo off perf reports symbol names in profiles. Whether this is sufficient for practical profiling I don't know. We'll find out.
Despite weakening the LTO, I expect the runtime performance to still be excellent, and reasonable to use for benchmarking, as long as the comparison is done between two thinLTO builds. That means one should avoid comparing
release
builds to the actual released binaries; instead always make tworelease
builds to compare, and only as a final sanity check, dodist_release
builds.Locally:
Fixes #4674
What are the type of the changes? (mandatory)
How has this PR been tested? (mandatory)
Scripted timing tests and months of experiments.
Does this PR affect documentation (docs) or release note? (mandatory)
No.
Does this PR affect tidb-ansible update? (mandatory)
No.
Refer to a related PR or issue link (optional)
#4674
Benchmark result if necessary (optional)
See above.
Add a few positive/negative examples (optional)