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

rustc: Stabilize -Zrun-dsymutil as -Csplit-debuginfo #79570

Merged
merged 1 commit into from
Jan 29, 2021

Commits on Jan 28, 2021

  1. rustc: Stabilize -Zrun-dsymutil as -Csplit-debuginfo

    This commit adds a new stable codegen option to rustc,
    `-Csplit-debuginfo`. The old `-Zrun-dsymutil` flag is deleted and now
    subsumed by this stable flag. Additionally `-Zsplit-dwarf` is also
    subsumed by this flag but still requires `-Zunstable-options` to
    actually activate. The `-Csplit-debuginfo` flag takes one of
    three values:
    
    * `off` - This indicates that split-debuginfo from the final artifact is
      not desired. This is not supported on Windows and is the default on
      Unix platforms except macOS. On macOS this means that `dsymutil` is
      not executed.
    
    * `packed` - This means that debuginfo is desired in one location
      separate from the main executable. This is the default on Windows
      (`*.pdb`) and macOS (`*.dSYM`). On other Unix platforms this subsumes
      `-Zsplit-dwarf=single` and produces a `*.dwp` file.
    
    * `unpacked` - This means that debuginfo will be roughly equivalent to
      object files, meaning that it's throughout the build directory
      rather than in one location (often the fastest for local development).
      This is not the default on any platform and is not supported on Windows.
    
    Each target can indicate its own default preference for how debuginfo is
    handled. Almost all platforms default to `off` except for Windows and
    macOS which default to `packed` for historical reasons.
    
    Some equivalencies for previous unstable flags with the new flags are:
    
    * `-Zrun-dsymutil=yes` -> `-Csplit-debuginfo=packed`
    * `-Zrun-dsymutil=no` -> `-Csplit-debuginfo=unpacked`
    * `-Zsplit-dwarf=single` -> `-Csplit-debuginfo=packed`
    * `-Zsplit-dwarf=split` -> `-Csplit-debuginfo=unpacked`
    
    Note that `-Csplit-debuginfo` still requires `-Zunstable-options` for
    non-macOS platforms since split-dwarf support was *just* implemented in
    rustc.
    
    There's some more rationale listed on rust-lang#79361, but the main gist of the
    motivation for this commit is that `dsymutil` can take quite a long time
    to execute in debug builds and provides little benefit. This means that
    incremental compile times appear that much worse on macOS because the
    compiler is constantly running `dsymutil` over every single binary it
    produces during `cargo build` (even build scripts!). Ideally rustc would
    switch to not running `dsymutil` by default, but that's a problem left
    to get tackled another day.
    
    Closes rust-lang#79361
    alexcrichton committed Jan 28, 2021
    Configuration menu
    Copy the full SHA
    a124043 View commit details
    Browse the repository at this point in the history