Skip to content

rustdoc: change doctests locating rustc binary#64328

Merged
bors merged 2 commits intorust-lang:masterfrom
Mark-Simulacrum:rustdoc-find-rustc
Sep 12, 2019
Merged

rustdoc: change doctests locating rustc binary#64328
bors merged 2 commits intorust-lang:masterfrom
Mark-Simulacrum:rustdoc-find-rustc

Conversation

@Mark-Simulacrum
Copy link
Member

@Mark-Simulacrum Mark-Simulacrum commented Sep 10, 2019

We previously used the "naive" approach of replacing the current_exe()'s file name with rustc, but now load from the sysroot by default ($sysroot/bin/rustc). The functionality of locating the sysroot overlaps/is the same as the functionality used by codegen backend loading; this ensures that any failure cases we've introduced are not exceeding those, and that improvements to finding the sysroot for loading codegen backends likewise enhance rustdoc.

The second commit adds an unstable --test-builder flag to rustdoc, and is largely separate (I can split into separate PR, but it's a simple and related change). This is largely intended for "advanced" users at this point (I'm not sure if we'll ever stabilize it); it permits use of a different rustc binary for rustdoc compilation of doctests than the rustdoc binary used when loading. Note, that this may not be what you want as the parsers and such differ (and rustdoc uses its own libsyntax, etc.). However, I've been told that running doctests in miri may be assisted by this change, so I've implemented it; I'll file a tracking issue for it if there's interest in it (and we land this PR).

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants