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

Tracking issue for cross-compiling doc tests (doctest-xcompile) #7040

Open
Goirad opened this issue Jun 18, 2019 · 0 comments
Open

Tracking issue for cross-compiling doc tests (doctest-xcompile) #7040

Goirad opened this issue Jun 18, 2019 · 0 comments
Labels
A-doctests Area: rustdoc --test C-tracking-issue Category: A tracking issue for something unstable. Command-test S-waiting-on-feedback Status: An implemented feature is waiting on community feedback for bugs or design concerns. Z-doctest-xcompile Nightly: doctest-xcompile

Comments

@Goirad
Copy link
Contributor

Goirad commented Jun 18, 2019

Implementation: #6892
Rustc tracking issue: rust-lang/rust#64245
Documentation: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#doctest-xcompile
Issues: Z-doctest-xcompile Nightly: doctest-xcompile

This PR adds the unstable -Zdoctest-xcompile flag to cargo. When present, instead of skipping doctests when host != target as it does now, cargo parses the runner field for target from .cargo/config and passes that to rustdoc. See here for the companion PR in rust that adds the necessary functionality to rustdoc. The flag also enables a new unstable --enable-per-target-ignores flag in rustdoc, allowing the use of compiletest-style --ignore-foo annotations for doctests so that they are ignored on a per-target basis. The motivation for these PRs, along with another modifying compiltest and bootstrap (not yet submitted), is to allow bootstrap to utilize the many doctests found in the various crates in the rust compiler, notably libstd and libcore.

This should add uniformity and expand testsuites for projects that build for other platforms, since the runner field is already used by cargo test.

@Goirad Goirad added the C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` label Jun 18, 2019
@ehuss ehuss added C-tracking-issue Category: A tracking issue for something unstable. Command-test and removed C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` labels Jun 18, 2019
bors added a commit that referenced this issue Sep 18, 2019
Added ability to crosscompile doctests

This commit adds the ability to cross-compile and run doctests.
Like before cargo checks if target == host, the difference is that if there is a runtool defined in config.toml, it passes the information forward to rustdoc so that it can run the doctests with that tool. If no tool is defined and the target != host, cargo instead displays a message that doctests will not be compiled because of the missing runtool.

See [here](rust-lang/rust#60387) for the companion PR in the rust project that modifies rustdoc to accept the relevant options as well as allow ignoring doctests on a per target level.
Partially resolves [#6460](#6460)

See [here](#7040) for the tracking issue.
@ehuss ehuss added the Z-doctest-xcompile Nightly: doctest-xcompile label Sep 21, 2019
@ehuss ehuss changed the title Tracking issue for PR #6892 : Cross-compiling doc tests Tracking issue for cross-compiling doc tests (doctest-xcompile) Dec 30, 2019
Alexhuszagh added a commit to Alexhuszagh/cross that referenced this issue May 26, 2022
This partially addresses cross-rs#225.

This only works on nightly, due to the use of the unstable feature [doctest-xcompile](https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#doctest-xcompile)

The relevant tracking issues are:
- rust-lang/cargo#7040
- rust-lang/rust#64245

If the subcommand is `test` and the compiler is nightly, we provide the `-Zdoctest-xcompile` flag if `CROSS_UNSTABLE_ENABLE_DOCTESTS=true`.
Alexhuszagh added a commit to Alexhuszagh/cross that referenced this issue May 26, 2022
This partially addresses cross-rs#225.

This only works on nightly, due to the use of the unstable feature [doctest-xcompile](https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#doctest-xcompile)

The relevant tracking issues are:
- rust-lang/cargo#7040
- rust-lang/rust#64245

If the subcommand is `test` and the compiler is nightly, we provide the `-Zdoctest-xcompile` flag if `CROSS_UNSTABLE_ENABLE_DOCTESTS=true`.
Alexhuszagh added a commit to Alexhuszagh/cross that referenced this issue May 26, 2022
This partially addresses cross-rs#225.

This only works on nightly, due to the use of the unstable feature [doctest-xcompile](https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#doctest-xcompile)

The relevant tracking issues are:
- rust-lang/cargo#7040
- rust-lang/rust#64245

If the subcommand is `test` and the compiler is nightly, we provide the `-Zdoctest-xcompile` flag if `CROSS_UNSTABLE_ENABLE_DOCTESTS=true`.
Alexhuszagh added a commit to Alexhuszagh/cross that referenced this issue May 26, 2022
This partially addresses cross-rs#225.

This only works on nightly, due to the use of the unstable feature [doctest-xcompile](https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#doctest-xcompile)

The relevant tracking issues are:
- rust-lang/cargo#7040
- rust-lang/rust#64245

If the subcommand is `test` and the compiler is nightly, we provide the `-Zdoctest-xcompile` flag if `CROSS_UNSTABLE_ENABLE_DOCTESTS=true`.
bors bot added a commit to cross-rs/cross that referenced this issue May 26, 2022
721: Add preliminary support for running doctests. r=Emilgardis a=Alexhuszagh

This partially addresses #225.

This only works on nightly, due to the use of the unstable feature [doctest-xcompile](https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#doctest-xcompile)

The relevant tracking issues are:
- rust-lang/cargo#7040
- rust-lang/rust#64245

If the subcommand is `test` and the compiler is nightly, we provide the `-Zdoctest-xcompile` flag if `CROSS_UNSTABLE_ENABLE_DOCTESTS=true`.

Co-authored-by: Alex Huszagh <ahuszagh@gmail.com>
@ehuss ehuss added the S-waiting-on-feedback Status: An implemented feature is waiting on community feedback for bugs or design concerns. label Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-doctests Area: rustdoc --test C-tracking-issue Category: A tracking issue for something unstable. Command-test S-waiting-on-feedback Status: An implemented feature is waiting on community feedback for bugs or design concerns. Z-doctest-xcompile Nightly: doctest-xcompile
Projects
Status: Unstable, no backers
Status: No status
Development

No branches or pull requests

3 participants