Skip to content

Allow rustdoc to get compiled with debuginfo #44812

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

Merged
merged 1 commit into from
Sep 27, 2017

Conversation

Mark-Simulacrum
Copy link
Member


// Most tools don't get debuginfo, but rustdoc should.
cargo.env("RUSTC_DEBUGINFO", self.config.rust_debuginfo.to_string())
.env("RUSTC_DEBUGINFO_LINES", self.config.rust_debuginfo_lines.to_string())
Copy link
Member

@kennytm kennytm Sep 24, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be build.config, not self.config.

[00:02:02] error[E0609]: no field `config` on type `tool::Rustdoc`
[00:02:02]    --> /checkout/src/bootstrap/tool.rs:309:43
[00:02:02]     |
[00:02:02] 309 |         cargo.env("RUSTC_DEBUGINFO", self.config.rust_debuginfo.to_string())
[00:02:02]     |                                           ^^^^^^ unknown field
[00:02:02]     |
[00:02:02]     = note: available fields are: `host`
[00:02:02] 
[00:02:02] error[E0609]: no field `config` on type `tool::Rustdoc`
[00:02:02]    --> /checkout/src/bootstrap/tool.rs:310:49
[00:02:02]     |
[00:02:02] 310 |              .env("RUSTC_DEBUGINFO_LINES", self.config.rust_debuginfo_lines.to_string())
[00:02:02]     |                                                 ^^^^^^ unknown field
[00:02:02]     |
[00:02:02]     = note: available fields are: `host`
[00:02:02] 
[00:02:02] error: aborting due to 2 previous errors
[00:02:02] 
[00:02:02] error: Could not compile `bootstrap`.

@QuietMisdreavus
Copy link
Member

librustdoc failed to build, citing the metadata flag:

[00:34:22] error[E0523]: found two different crates with name `env_logger` that are not distinguished by differing `-C metadata`. This will result in symbol conflicts between the two.
[00:34:22]   --> /checkout/src/librustdoc/lib.rs:37:1
[00:34:22]    |
[00:34:22] 37 | extern crate rustc_driver;
[00:34:22]    | ^^^^^^^^^^^^^^^^^^^^^^^^^^
[00:34:22] 
[00:34:22] error: Could not compile `rustdoc`.

@QuietMisdreavus
Copy link
Member

I checked out this branch, and can confirm that Visual Studio happily set breakpoints and stepped through code in librustdoc with this change.

// Most tools don't get debuginfo, but rustdoc should.
cargo.env("RUSTC_DEBUGINFO", builder.config.rust_debuginfo.to_string())
.env("RUSTC_DEBUGINFO_LINES", builder.config.rust_debuginfo_lines.to_string())
.env("RUSTC_FORCE_UNSTABLE", "1");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this env var is necessary because we're not shipping rlibs, just the rustdoc executable

@alexcrichton
Copy link
Member

r=me with one minor nit

@carols10cents carols10cents added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Sep 25, 2017
@Mark-Simulacrum
Copy link
Member Author

@bors r+

@bors
Copy link
Collaborator

bors commented Sep 26, 2017

📌 Commit 33b5ec3 has been approved by Mark-Simulacrum

@Mark-Simulacrum Mark-Simulacrum 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 26, 2017
@Mark-Simulacrum
Copy link
Member Author

@bors r=alexcrichton p=1

Nominating for beta backport. Tiny patch, and I think without this we may lose nice ICEs from rustdoc. Not overly concerned, though, and I'm not sure how much debug information we ship anyway...

@bors
Copy link
Collaborator

bors commented Sep 26, 2017

💡 This pull request was already approved, no need to approve it again.

@bors
Copy link
Collaborator

bors commented Sep 26, 2017

📌 Commit 33b5ec3 has been approved by alexcrichton

@Mark-Simulacrum Mark-Simulacrum added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Sep 26, 2017
@alexcrichton
Copy link
Member

I don't think we've had rustdoc debuginfo turned on for quite awhile now, right?

@alexcrichton
Copy link
Member

(in that I wouldn't personally be inclined to backport)

@bors
Copy link
Collaborator

bors commented Sep 27, 2017

⌛ Testing commit 33b5ec3 with merge e53ab91...

bors added a commit that referenced this pull request Sep 27, 2017
@bors
Copy link
Collaborator

bors commented Sep 27, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: alexcrichton
Pushing e53ab91 to master...

@bors bors merged commit 33b5ec3 into rust-lang:master Sep 27, 2017
@Mark-Simulacrum Mark-Simulacrum deleted the rustdoc-debug branch September 27, 2017 13:28
@Mark-Simulacrum
Copy link
Member Author

Yeah, I don't really care about the backport. I'll denominate -- we can always backport if necessary.

@Mark-Simulacrum Mark-Simulacrum removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Sep 27, 2017
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.

6 participants