Skip to content

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

@Goirad

Description

@Goirad

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.

Unresolved issues

  • For stabilizing flags on rustdoc side, would it be better for cargo to take over the test execution responsibility? See doctests testing-devex-team#5.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-doctestsArea: rustdoc --testC-tracking-issueCategory: A tracking issue for something unstable.Command-testS-waiting-on-feedbackStatus: An implemented feature is waiting on community feedback for bugs or design concerns.Z-doctest-xcompileNightly: doctest-xcompile

    Type

    No type

    Projects

    Status

    Unstable, no backers

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions