cargo/tests/testsuite
bors efd37336e9 Auto merge of #11252 - lqd:deferred-debuginfo, r=ehuss
Turn off debuginfo for build dependencies v2

This PR is an alternative to #10493, fixing its most important issue: the unit graph optimization to reuse already built artifacts for dependencies shared between the build-time and runtime subgraphs is preserved (most of the time).

By deferring the default debuginfo level in `dev.build-override` until unit graph sharing, we check whether re-use would happen. If so, we use the debuginfo level to ensure reuse does happen. Otherwise, we can avoid emitting debuginfo and improve compile times (on clean, debug and check builds -- although reuse only happens on debug builds).

I've kept the message explaining how to bump the debuginfo level if an error occurs while running a build script (and backtraces were requested) that was in the previous PR.

I've ran benchmarks on 800 crates, at different parallelism levels, and published the (surprisingly good) results with visualizations, summaries, and raw data [here](https://github.com/lqd/rustc-benchmarking-data/tree/main/experiments/cargo-build-defaults).

Opening this PR as discussed in [Eric's message](https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/Defaults.20for.20faster.20compilation.20of.20.22for.20host.22.20units/near/304236576l) as draft since 2 tests won't pass. That fixes the `cargo-crev` case we saw as a blocker last time, but doesn't fix all such cases of reuse, like the 2 failing tests:

- [`optional_build_dep_and_required_normal_dep`](642a0e625d/tests/testsuite/build_script.rs (L4449))
- and [`proc_macro_ws`](bd5db301b0/tests/testsuite/features2.rs (L1051))

These failures make sense, since the debuginfo optimization is done during traversal, it depends on the contents of the unit graph. These tests ensure that sharing happens even on finer-grained invocations: respectively, with an optional shared dependency that is later enabled, and building shared dependencies by themselves first and later as part of a complete workspace build.

In both these situations, there is no unit that is shared in the graph during the first invocation, so we do the optimization and remove the debuginfo. When the graph changes in the following invocation, sharing is present and we have to build the shared units again with debuginfo.

These cases feel rarer than `cargo-crev`'s case, but I do wonder if there's a way to fix them, or if it's acceptable to not support them.
2023-02-01 23:17:09 +00:00
..
cargo_add Auto merge of #11612 - hi-rustin:rustin-patch-cargo-add, r=epage 2023-01-25 15:44:23 +00:00
cargo_remove chore: reflect to clap updates 2023-01-14 09:23:39 +00:00
init chore: reflect to clap updates 2023-01-14 09:23:39 +00:00
mock-std Revert "Check if rust-src contains a vendor dir, and patch it in" 2020-12-11 07:45:27 -08:00
advanced_env.rs Enable source_config_env test on Windows 2023-01-14 09:48:46 -08:00
alt_registry.rs Stabilize sparse-registry 2023-01-05 11:04:52 -06:00
artifact_dep.rs Simple explanations for why cargo rebuilds crates 2022-12-28 16:27:50 +01:00
bad_config.rs Fix panic on ignored target dependency. 2023-01-04 18:44:51 -08:00
bad_manifest_path.rs track_caller on custom assert functions 2021-03-03 17:17:07 +00:00
bench.rs refactor(testsuite): Replace [project] with [package] 2022-09-26 09:51:16 -06:00
binary_name.rs refactor(testsuite): Replace [project] with [package] 2022-09-26 09:51:16 -06:00
build.rs update tests for build deps debuginfo optimization 2023-01-31 20:12:52 +00:00
build_plan.rs refactor(testsuite): Replace [project] with [package] 2022-09-26 09:51:16 -06:00
build_script.rs do not display message to enable debuginfo when it's already enabled 2023-01-31 22:36:20 +00:00
build_script_env.rs when learning target information, run a little fixedpoint iteration loop 2022-09-26 13:22:43 +01:00
build_script_extra_link_arg.rs remove .masquerade_as_nightly_cargo() from build_script_extra_link_arg.rs 2022-07-14 15:05:33 -05:00
cache_messages.rs Deduplicate compiler diagnostics. 2021-07-09 16:20:46 -07:00
cargo_alias_config.rs Add built-in alias shadowing not warning test 2022-10-13 22:22:52 +01:00
cargo_command.rs chore: Fix typos 2023-01-10 20:03:11 -06:00
cargo_config.rs add a reason to masquerade_as_nightly_cargo so it is searchable 2022-07-15 21:32:23 -05:00
cargo_env_config.rs config: Improve wording of CARGO_HOME in [env] error 2023-02-01 08:21:03 +01:00
cargo_features.rs Fix several tests that are waiting 60 seconds for publishing to time out 2022-11-17 15:54:24 -06:00
cargo_targets.rs Warn if an "all" target is specified, but we don't match anything 2021-06-09 19:29:24 +02:00
cfg.rs test(cfg): parse rustc --print=split-debuginfo 2023-01-27 02:45:04 +00:00
check.rs feat: stabilize auto fix note 2023-01-10 13:52:29 -06:00
check_cfg.rs refactor(testsuite): Replace [project] with [package] 2022-09-26 09:51:16 -06:00
clean.rs Actually make test effective 2022-10-31 20:43:20 -06:00
collisions.rs Fix collision_doc_profile test error 2022-12-15 20:04:50 -08:00
concurrent.rs Re-enable killing_cargo_releases_the_lock on windows. 2022-08-02 12:30:42 -07:00
config.rs Add test for config Value in TOML array. 2023-01-10 14:36:37 +01:00
config_cli.rs chore: Fix typos 2023-01-10 20:03:11 -06:00
config_include.rs Simple explanations for why cargo rebuilds crates 2022-12-28 16:27:50 +01:00
corrupt_git.rs refactor(testsuite): Replace [project] with [package] 2022-09-26 09:51:16 -06:00
credential_process.rs count calls to credential process 2022-12-22 21:53:45 +00:00
cross_compile.rs refactor(testsuite): Replace [project] with [package] 2022-09-26 09:51:16 -06:00
cross_publish.rs update package, publish, and publish_lockfile tests 2022-10-28 17:13:25 -07:00
custom_target.rs Add requirements to cargo_test. 2022-07-30 19:36:58 -07:00
death.rs Normalize raw string indentation. 2020-09-26 17:59:58 -07:00
dep_info.rs Add requirements to cargo_test. 2022-07-30 19:36:58 -07:00
directory.rs Update tests to use registry names 2021-07-22 00:50:30 +08:00
doc.rs Change rustdoc-scrape-examples to be a target-level configuration 2022-11-16 09:18:33 -08:00
docscrape.rs Simplify code and output of skipped_examples warning 2022-12-22 12:37:11 -08:00
edition.rs Add requirements to cargo_test. 2022-07-30 19:36:58 -07:00
error.rs Rework internal errors. 2020-02-17 19:03:57 -08:00
features.rs Add -v to some feature tests 2022-12-28 18:44:05 +01:00
features2.rs update test proc_macro_ws 2023-01-31 22:36:20 +00:00
features_namespaced.rs update stderr in tests for unrelated functionality 2022-10-28 17:13:25 -07:00
fetch.rs Normalize raw string indentation. 2020-09-26 17:59:58 -07:00
fix.rs Fix fix_in_existing_repo_weird_ignore broken test 2022-11-26 20:15:36 +08:00
freshness.rs update tests for build deps debuginfo optimization 2023-01-31 20:12:52 +00:00
future_incompat_report.rs Add requirements to cargo_test. 2022-07-30 19:36:58 -07:00
generate_lockfile.rs add a reason to masquerade_as_nightly_cargo so it is searchable 2022-07-15 21:32:23 -05:00
git.rs Only output field extern_name when using -Zbindeps 2023-01-16 14:12:32 +00:00
git_auth.rs refactor(testsuite): Replace [project] with [package] 2022-09-26 09:51:16 -06:00
git_gc.rs Clean stale git temp files 2022-10-28 15:39:02 -07:00
glob_targets.rs fix typos found by the typos-cli crate 2022-05-10 16:47:28 -05:00
help.rs fix panic if an alias is defined to "" 2021-12-12 13:30:31 -07:00
https.rs Add network container tests 2023-01-14 15:10:16 -08:00
inheritable_workspace_fields.rs refactor(toml): Move TomlWorkspaceDependency out of TomlDependency 2023-01-25 10:50:55 -06:00
install.rs Auto merge of #11558 - Muscraft:stabilize-cargo-fix-message, r=epage 2023-01-22 00:50:42 +00:00
install_upgrade.rs fix(yank): Use '--version' like install 2022-04-19 16:45:13 -05:00
jobserver.rs Auto merge of #10511 - weihanglo:issue-10477, r=ehuss 2022-09-02 14:29:28 +00:00
list_availables.rs test: list availables for clean,tree,update 2020-10-28 02:46:20 +08:00
local_registry.rs refactor(testsuite): Replace [project] with [package] 2022-09-26 09:51:16 -06:00
locate_project.rs Remove the double-backslash escape for matching. 2021-06-16 09:44:29 -07:00
lockfile_compat.rs refactor(testsuite): Replace [project] with [package] 2022-09-26 09:51:16 -06:00
login.rs chore: reflect to clap updates 2023-01-14 09:23:39 +00:00
logout.rs by default saves credentials to .cargo/credentials.toml 2023-01-04 16:25:52 +00:00
lto.rs Simple explanations for why cargo rebuilds crates 2022-12-28 16:27:50 +01:00
main.rs Add network container tests 2023-01-14 15:10:16 -08:00
member_discovery.rs refactor(testsuite): Replace [project] with [package] 2022-09-26 09:51:16 -06:00
member_errors.rs refactor(testsuite): Replace [project] with [package] 2022-09-26 09:51:16 -06:00
message_format.rs Bump to 0.54.0 2021-03-26 12:28:47 -07:00
messages.rs feat: stabilize auto fix note 2023-01-10 13:52:29 -06:00
metabuild.rs add a reason to masquerade_as_nightly_cargo so it is searchable 2022-07-15 21:32:23 -05:00
metadata.rs Only output field extern_name when using -Zbindeps 2023-01-16 14:12:32 +00:00
minimal_versions.rs add a reason to masquerade_as_nightly_cargo so it is searchable 2022-07-15 21:32:23 -05:00
multitarget.rs Update tests to reflect -Zmultitarget stabilization 2022-07-17 11:02:01 +01:00
net_config.rs refactor(testsuite): Replace [project] with [package] 2022-09-26 09:51:16 -06:00
new.rs chore: reflect to clap updates 2023-01-14 09:23:39 +00:00
offline.rs refactor(testsuite): Replace [project] with [package] 2022-09-26 09:51:16 -06:00
old_cargos.rs Add reasons to all ignored tests. 2022-08-02 12:24:00 -07:00
out_dir.rs refactor(testsuite): Replace [project] with [package] 2022-09-26 09:51:16 -06:00
owner.rs cleanups round 1 2022-12-13 23:49:07 +00:00
package.rs add new tests for filesizes 2022-10-28 17:13:25 -07:00
package_features.rs Change rustdoc-scrape-examples to be a target-level configuration 2022-11-16 09:18:33 -08:00
patch.rs refactor(testsuite): Replace [project] with [package] 2022-09-26 09:51:16 -06:00
path.rs refactor(testsuite): Replace [project] with [package] 2022-09-26 09:51:16 -06:00
paths.rs Replace deprecated [replace] references with [patch] 2021-06-02 12:30:56 +02:00
pkgid.rs fix some typos 2022-05-08 01:07:28 +08:00
plugins.rs test: revive nightly plugin tests to work 2023-01-04 13:45:25 +00:00
proc_macro.rs Add requirements to cargo_test. 2022-07-30 19:36:58 -07:00
profile_config.rs introduce dedicated DebugInfo enum in Profiles 2023-01-31 19:05:20 +00:00
profile_custom.rs Add reasons to all ignored tests. 2022-08-02 12:24:00 -07:00
profile_overrides.rs Extend pkgid syntax with @ support 2022-04-19 16:00:15 -05:00
profile_targets.rs add assertions checking the absence of debuginfo 2023-01-31 22:36:20 +00:00
profiles.rs refactor(testsuite): Replace [project] with [package] 2022-09-26 09:51:16 -06:00
progress.rs Normalize raw string indentation. 2020-09-26 17:59:58 -07:00
pub_priv.rs Add requirements to cargo_test. 2022-07-30 19:36:58 -07:00
publish.rs Stabilize sparse-registry 2023-01-05 11:04:52 -06:00
publish_lockfile.rs make test clearer 2022-12-19 10:50:55 -07:00
read_manifest.rs Add rust_metadata to SerializedPackage 2021-10-12 14:07:19 +02:00
registry.rs Handle .cargo-ok being truncated 2023-01-31 15:03:28 -08:00
registry_auth.rs Do not error for auth-required: true without -Z sparse-registry 2023-01-31 11:03:02 -06:00
rename_deps.rs refactor(testsuite): Replace [project] with [package] 2022-09-26 09:51:16 -06:00
replace.rs Extend pkgid syntax with @ support 2022-04-19 16:00:15 -05:00
required_features.rs Add test of the new warning about missing features 2023-01-31 19:59:49 +01:00
run.rs chore: reflect to clap updates 2023-01-14 09:23:39 +00:00
rust_version.rs refactor(testsuite): Replace [project] with [package] 2022-09-26 09:51:16 -06:00
rustc.rs chore: reflect to clap updates 2023-01-14 09:23:39 +00:00
rustc_info_cache.rs Don't re-use rustc cache when RUSTC_WRAPPER changes 2021-04-16 20:08:11 +03:00
rustdoc.rs Update rustdoc tests with -Cmetadata flag 2021-10-12 19:33:23 -07:00
rustdoc_extern_html.rs Add test for rustdoc map usage with sparse alternative registries 2022-11-29 19:28:03 +11:00
rustdocflags.rs Gleaning rustdocflags from target.cfg(…) is not supported 2022-11-01 15:01:44 +00:00
rustflags.rs add a reason to masquerade_as_nightly_cargo so it is searchable 2022-07-15 21:32:23 -05:00
search.rs Implement RFC 3139: alternative registry authentication support 2022-11-16 14:36:19 -06:00
shell_quoting.rs refactor(testsuite): Replace [project] with [package] 2022-09-26 09:51:16 -06:00
source_replacement.rs update stderr in tests for unrelated functionality 2022-10-28 17:13:25 -07:00
ssh.rs Fix unused attribute on Windows. 2023-01-22 14:02:23 -08:00
standard_lib.rs Add requirements to cargo_test. 2022-07-30 19:36:58 -07:00
test.rs Simple explanations for why cargo rebuilds crates 2022-12-28 16:27:50 +01:00
timings.rs Move timing reports to target/cargo-timings 2022-01-30 21:43:52 -08:00
tool_paths.rs Fix test 2022-08-10 23:19:35 +08:00
tree.rs Fix typo try use -> try to use 2022-11-20 18:14:17 +08:00
tree_graph_features.rs Do not ignore --features when --all-features is present 2022-01-28 02:49:42 +03:00
unit_graph.rs add a reason to masquerade_as_nightly_cargo so it is searchable 2022-07-15 21:32:23 -05:00
update.rs Only output field extern_name when using -Zbindeps 2023-01-16 14:12:32 +00:00
vendor.rs fix(vendor): Make vendor use Manifest's "original" Cargo.toml 2023-01-18 22:19:56 -06:00
verify_project.rs add a reason to masquerade_as_nightly_cargo so it is searchable 2022-07-15 21:32:23 -05:00
version.rs Re-enable version_works_without_rustc on windows. 2022-08-02 12:54:16 -07:00
warn_on_failure.rs Normalize raw string indentation. 2020-09-26 17:59:58 -07:00
weak_dep_features.rs update stderr in tests for unrelated functionality 2022-10-28 17:13:25 -07:00
workspaces.rs refactor(testsuite): Replace [project] with [package] 2022-09-26 09:51:16 -06:00
yank.rs cleanups round 1 2022-12-13 23:49:07 +00:00