Skip to content

test rustc-dev dist component on CI #138646

Closed

Description

@Kobzol

Recently, the rustc-dev component was broken several times in a row (#138304, #138647).

It would be nice if we had some CI check that would at least run cargo metadata on the extracted rustc-src component.

CC @RalfJung - Would running cargo metadata be enough as a smoke test?

Activity

  1. added
    C-bugCategory: This is a bug.
    T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
    on Mar 18, 2025
  2. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Mar 18, 2025
  3. added
    A-compiletestArea: The compiletest test runner
    and removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    C-bugCategory: This is a bug.
    on Mar 18, 2025
  4. jieyouxu commented on Mar 18, 2025

    @jieyouxu
    Member

    (Related to #136822)

  5. jieyouxu commented on Mar 18, 2025

    @jieyouxu
    Member

    I also don't think this is really compiletest, it probably needs to be its own test suite post-dist doing some basic checks.

  6. added
    C-enhancementCategory: An issue proposing an enhancement or a PR with one.
    A-testsuiteArea: The testsuite used to check the correctness of rustc
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    and removed
    A-compiletestArea: The compiletest test runner
    on Mar 18, 2025
  7. RalfJung commented on Mar 18, 2025

    @RalfJung
    Member

    Would running cargo metadata be enough as a smoke test?

    Yes, at least for these two recent issues that would have been enough.
    I was about to open an issue asking @rust-lang/infra for what is the best way to test this. :)

  8. RalfJung commented on Mar 18, 2025

    @RalfJung
    Member

    (Related to #136822)

    Maybe let's make this issue here specific for rustc-src, and use the other one to track more potential tests.

  9. changed the title [-]Add a way to test dist components[/-] [+]test `rustc-src` dist component on CI[/+] on Mar 18, 2025
  10. 2 remaining items

  11. jieyouxu commented on Mar 18, 2025

    @jieyouxu
    Member

    I wonder if it makes sense to have something like citool, but post-dist build, which actually exercises the final dist artifacts (literally unpacking from a dist archive, for instance) that the users would actually receive.

    (Testing rustc-src dist component may be one of its jobs)

  12. Kobzol commented on Mar 18, 2025

    @Kobzol
    MemberAuthor

    I mean, in the ideal world we should do all (or almost all) of our testing on the dist artifacts, but that woud be too costly CI wise at the moment (apart from other problems).

    The rustc-src component should IMO have its own separate job, rather than being a part of the x64 dist builder. Then we could add specific smoke tests to it.

  13. jieyouxu commented on Mar 18, 2025

    @jieyouxu
    Member

    Wait, wouldn't we still have to produce the rustc-src dist component in the first place? Or as in a fast custom dist component (say at stage 1 or sth)?

  14. Kobzol commented on Mar 18, 2025

    @Kobzol
    MemberAuthor

    Yeah I meant to create a new CI job that would create the dist rustc-src component. It doesn't require almost anything and should be very fast to build.

  15. Kobzol commented on Mar 18, 2025

    @Kobzol
    MemberAuthor

    Just a note that this problem occurred in the rustc-dev component, not rustc-src.

  16. RalfJung commented on Mar 18, 2025

    @RalfJung
    Member

    Ah, the folder is called rustc-src but the component rustc-dev.

  17. changed the title [-]test `rustc-src` dist component on CI[/-] [+]test `rustc-dev` dist component on CI[/+] on Mar 18, 2025
  18. RalfJung commented on Sep 2, 2025

    @RalfJung
    Member

    This would have caught the recent regression (rust-lang/rust-analyzer#20584).

    Where in CI (i.e. which runner and where in the logic that runs CI) would even be the right place for such tests?
    EDIT: Ah seems this was already discussed a bit and the suggestion was to add a new runner. Is the idea that it would duplicate the work of building the artifact but then instead of uploading it somewhere it would test it? Wouldn't it be easier to do this somewhere where the artifact is already being built anyway?

  19. Kobzol commented on Sep 2, 2025

    @Kobzol
    MemberAuthor

    The runners where we build dist components don't do almost any testing today, so I don't think that it would be necessarily easier.

    We can add a new bootstrap step (e.g. similar to x test distcheck, which already tries to build rustc from the plain source tarball archive) for this. The important part is determining what we actually want to test; we most likely won't be able to replicate exactly what downstream does, so we should instead write down some rules, like "it has to be possible to extract rustc-dev and then build a simple rustc_private component from it", or something like that.

  20. RalfJung commented on Sep 2, 2025

    @RalfJung
    Member

    Just running cargo metadata --manifest-path .../compiler/rustc/Cargo.toml would already have caught all the regressions mentioned here, I think.

    In particular, building Miri wasn't even broken (since it uses the rlibs and does not care about the sources). Only the RA/vscode integration broke.

  21. Kobzol commented on Sep 2, 2025

    @Kobzol
    MemberAuthor

    Let's try: #146124

  22. added 2 commits that reference this issue on Sep 4, 2025
  23. added a commit that references this issue on Sep 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-testsuiteArea: The testsuite used to check the correctness of rustcC-enhancementCategory: An issue proposing an enhancement or a PR with one.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-infraRelevant to the infrastructure team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions