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
Turn off debuginfo for build dependencies v2 #11252
Commits on Jan 31, 2023
-
introduce dedicated
DebugInfo
enum inProfile
sThis enum will be used to model the current Option<u32> value in profiles, as the explicitly set value, and also allow to model a deferred value: one that can be ignored for optimization purposes, and used in all other cases. This allows to have a default debuginfo for build dependencies, that can change: - if a dependency is shared between the build and runtime subgraphs, the default value will be used, to that re-use between units will continue. - otherwise, a build dependency is only used in a context where debuginfo is not very useful. We can optimize build times in this situation by not asking rustc to emit debuginfo.
-
optimize build dependency debuginfo level
When a build dependency unit is not within the runtime dependency subgraph, we don't ask for debuginfo to be emitted by default.
-
-
-
-
display note to increase debuginfo level when build deps fail
it's only displayed when backtraces are requested
-
add build script failure test when requesting backtraces
it displays an additional message on how to improve these backtraces, now that debuginfo is turned off most of the time in `dev.build-override`.
-
update build dependencies profiles documentation
This describes the new defaults for build-overrides, and how to make sure backtraces have the usual debug info, when needed.
-
add assertions checking the absence of debuginfo
Add some assertions to ensure that debuginfo is not used to compile build dependencies, in a way that differs between the old and new defaults: some of the assert elision could match the previous defaults with debuginfo. These new assertions break if `-C debuginfo` is present in the commands cargo ran.
-
-
-
use
UnitFor::is_for_host
to detect build depsAlthough `CompileKind::is_host` is currently used for build dependencies prior to unit graph sharing, it's not a guarantee. So we use `UnitFor::is_for_host` to make detection more future-proof.
-
update
optional_build_dep_and_required_normal_dep
test expectationsThis test dynamically enables a shared build/runtime dependency, and therefore doesn't trigger the build/runtime sharing reuse optimization, as the build dep is initially built without debuginfo for optimization purposes.
-
This non-regression test didn't pass as-is because of the new debuginfo build deps optimization. This restores the original intent of the test.
-