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

rustdoc: force binary filename for compiled doctests #57338

Merged
merged 1 commit into from Jan 5, 2019

Conversation

Projects
None yet
3 participants
@QuietMisdreavus
Copy link
Member

QuietMisdreavus commented Jan 4, 2019

Fixes #57317, needed for rust-lang/rust-by-example#1137

Right now, when building a doctest, rustdoc provides the compiler an output directory (a temp dir) but lets the compiler name the executable. If the doctest needs to be executed, it then tries to run a binary named rust_out from that directory. For the most part, this works fine. However, if the doctest sets its own crate name, the compiler uses that name for the output binary instead. This causes rustdoc to try to execute a nonexistent binary, causing the test to fail.

This PR changes the paths rustdoc gives to the compiler when building doctests to force the output filename instead of just the directory.

@QuietMisdreavus

This comment has been minimized.

Copy link
Member

QuietMisdreavus commented Jan 4, 2019

@GuillaumeGomez

This comment has been minimized.

Copy link
Member

GuillaumeGomez commented Jan 5, 2019

Thanks!

@bors: r+ rollup

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Jan 5, 2019

📌 Commit 0b55c79 has been approved by GuillaumeGomez

kennytm added a commit to kennytm/rust that referenced this pull request Jan 5, 2019

Rollup merge of rust-lang#57338 - QuietMisdreavus:doctest-file-name, …
…r=GuillaumeGomez

rustdoc: force binary filename for compiled doctests

Fixes rust-lang#57317, needed for rust-lang/rust-by-example#1137

Right now, when building a doctest, rustdoc provides the compiler an output directory (a temp dir) but lets the compiler name the executable. If the doctest needs to be executed, it then tries to run a binary named `rust_out` from that directory. For the most part, this works fine. However, if the doctest sets its own crate name, the compiler uses that name for the output binary instead. This causes rustdoc to try to execute a nonexistent binary, causing the test to fail.

This PR changes the paths rustdoc gives to the compiler when building doctests to force the output *filename* instead of just the *directory*.

bors added a commit that referenced this pull request Jan 5, 2019

Auto merge of #57354 - kennytm:rollup, r=kennytm
Rollup of 17 pull requests

Successful merges:

 - #57219 (Remove some unused code)
 - #57229 (Fix #56806 by using `delay_span_bug` in object safety layout sanity checks)
 - #57233 (Rename and fix nolink-with-link-args test)
 - #57238 (Fix backtraces for inlined functions on Windows)
 - #57249 (Fix broken links to second edition TRPL.)
 - #57267 (src/jemalloc is gone, remove its mention from COPYRIGHT)
 - #57273 (Update the stdsimd submodule)
 - #57278 (Add Clippy to config.toml.example)
 - #57295 (Fix 'be be' constructs)
 - #57311 (VaList::copy should not require a mutable ref)
 - #57312 (`const fn` is no longer coming soon (const keyword docs))
 - #57313 (Improve Box<T> -> Pin<Box<T>> conversion)
 - #57314 (Fix repeated word typos)
 - #57326 (Doc rewording, use the same name `writer`)
 - #57338 (rustdoc: force binary filename for compiled doctests)
 - #57342 (librustc_mir: Make qualify_min_const_fn module public)
 - #57343 (Calculate privacy access only via query)

Failed merges:

 - #57340 (Use correct tracking issue for c_variadic)

r? @ghost

@bors bors merged commit 0b55c79 into rust-lang:master Jan 5, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@QuietMisdreavus QuietMisdreavus deleted the QuietMisdreavus:doctest-file-name branch Jan 7, 2019

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