Skip to content
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

fix handling the default config for profiler and sanitizers #79155

Merged
merged 1 commit into from
Nov 19, 2020

Conversation

12101111
Copy link
Contributor

#78354 don't handle the case that user don't add any target-specific config in [target.*] of config.toml:

changelog-seen = 2
[llvm]
link-shared = true
[build]
sanitizers = true
profiler = true
[install]
[rust]
[dist]

The previes code handle the default config in Config::prase():

target.sanitizers = cfg.sanitizers.unwrap_or(build.sanitizers.unwrap_or_default());
target.profiler = cfg.profiler.unwrap_or(build.profiler.unwrap_or_default());
config.target_config.insert(TargetSelection::from_user(&triple), target);

In this case, toml.target don't contain any target, so the above code won't execute. Instead, a default Target is insert in

build
.config
.target_config
.entry(target.clone())
.or_insert(Target::from_triple(&target.triple));

The default value for bool is false, hence the issue in #79124

This fix change the type of sanitizers and profiler to Option<bool>, so the default value is None, and fallback config is handled in Config::sanitizers_enabled and Config::profiler_enabled

fix #79124

cc @Mark-Simulacrum @richkadel

@rust-highfive
Copy link
Collaborator

r? @Mark-Simulacrum

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 18, 2020
@Mark-Simulacrum
Copy link
Member

@bors r+

Thanks!

@bors
Copy link
Contributor

bors commented Nov 19, 2020

📌 Commit 36972b0 has been approved by Mark-Simulacrum

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 19, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 19, 2020
Rollup of 14 pull requests

Successful merges:

 - rust-lang#78961 (Make bad "rust-call" arguments no longer ICE)
 - rust-lang#79082 (Improve the diagnostic for when an `fn` contains qualifiers inside an `extern` block.)
 - rust-lang#79090 (libary: Forward compiler-builtins "asm"  and "mangled-names" feature)
 - rust-lang#79094 (Add //ignore-macos to pretty-std-collections.rs)
 - rust-lang#79101 (Don't special case constant operands when lowering intrinsics)
 - rust-lang#79102 (Add two regression tests)
 - rust-lang#79110 (Remove redundant notes in E0275)
 - rust-lang#79116 (compiletest: Fix a warning in debuginfo tests on windows-gnu)
 - rust-lang#79117 (add optimization fuel checks to some mir passes)
 - rust-lang#79147 (Highlight MIR as Rust on GitHub)
 - rust-lang#79149 (Move capture lowering from THIR to MIR)
 - rust-lang#79155 (fix handling the default config for profiler and sanitizers)
 - rust-lang#79156 (Allow using `download-ci-llvm` from directories other than the root)
 - rust-lang#79164 (Permit standalone generic parameters as const generic arguments in macros)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 3b857a5 into rust-lang:master Nov 19, 2020
@rustbot rustbot added this to the 1.50.0 milestone Nov 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

profiler = true in config.toml no longer works
5 participants