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

Don't distinguish Debuginfo::None and Debuginfo::Explicit(None) #12205

Merged
merged 2 commits into from
May 31, 2023

Commits on May 30, 2023

  1. Don't distinguish Debuginfo::None and Debuginfo::Explicit(None)

    Previously, `Debuginfo::None` meant "don't pass -C debuginfo" and `Explicit(None)` meant
    "-C debuginfo=0", which occasionally led to caching bugs where cargo would sometimes pass
    `-C debuginfo=0` and sometimes not. There are no such bugs currently that we know of, but
    representing them the same within cargo avoids the possibility of the bug popping up again in the
    future.
    
    I tested the `with_stderr_does_not_contain_tests` with this diff to ensure they did not pass:
    ```diff
    diff --git a/src/cargo/core/compiler/mod.rs b/src/cargo/core/compiler/mod.rs
    index 55ec17182..c186dd00a 100644
    --- a/src/cargo/core/compiler/mod.rs
    +++ b/src/cargo/core/compiler/mod.rs
    @@ -1073,9 +1073,7 @@ fn build_base_args(
    
         let debuginfo = debuginfo.into_inner();
         // Shorten the number of arguments if possible.
    -    if debuginfo != TomlDebugInfo::None {
             cmd.arg("-C").arg(format!("debuginfo={}", debuginfo));
    -    }
    
         cmd.args(unit.pkg.manifest().lint_rustflags());
         if !rustflags.is_empty() {
    ```
    jyn514 committed May 30, 2023
    Configuration menu
    Copy the full SHA
    e2eacc6 View commit details
    Browse the repository at this point in the history
  2. use code formatting for intra-doc link

    Co-authored-by: Weihang Lo <weihanglo@users.noreply.github.com>
    jyn514 and weihanglo committed May 30, 2023
    Configuration menu
    Copy the full SHA
    f74c8df View commit details
    Browse the repository at this point in the history