Skip to content

Verify that the tools are actually distributed on beta/stable channels #54483

Closed
@kennytm

Description

@kennytm

In #54206 it was noted that RLS was missing in x86_64-pc-windows-gnu, but toolstate didn't see the issue because it only checks x86_64-pc-windows-msvc and x86_64-unknown-linux-gnu. We ought to ensure that the tools are not forgotten at least on all tier-1 platforms.

The simplest fix right now is to add a check that if a tool failed to build, the whole dist job should be aborted. Currently we allowed tool dist to fail because of this:

rust/src/bootstrap/dist.rs

Lines 1166 to 1169 in e7b5ba8

let rls = builder.ensure(tool::Rls {
compiler: builder.compiler(stage, builder.config.build),
target, extra_features: Vec::new()
}).or_else(|| { println!("Unable to build RLS, skipping dist"); None })?;

similar for Clippy:

rust/src/bootstrap/dist.rs

Lines 1245 to 1252 in e7b5ba8

let clippy = builder.ensure(tool::Clippy {
compiler: builder.compiler(stage, builder.config.build),
target, extra_features: Vec::new()
}).or_else(|| { println!("Unable to build clippy, skipping dist"); None })?;
let cargoclippy = builder.ensure(tool::CargoClippy {
compiler: builder.compiler(stage, builder.config.build),
target, extra_features: Vec::new()
}).or_else(|| { println!("Unable to build cargo clippy, skipping dist"); None })?;

and rustfmt:

rust/src/bootstrap/dist.rs

Lines 1323 to 1331 in e7b5ba8

// Prepare the image directory
let rustfmt = builder.ensure(tool::Rustfmt {
compiler: builder.compiler(stage, builder.config.build),
target, extra_features: Vec::new()
}).or_else(|| { println!("Unable to build Rustfmt, skipping dist"); None })?;
let cargofmt = builder.ensure(tool::Cargofmt {
compiler: builder.compiler(stage, builder.config.build),
target, extra_features: Vec::new()
}).or_else(|| { println!("Unable to build Cargofmt, skipping dist"); None })?;

What we should do is modify the or_else branch to panic! unless we are configured to allow omitting these tools (i.e. in the nightly channel). (Consider refactor this into the same function to avoid writing the same thing 5 times.)

While it is possible to check the release channel directly inside rustbuild, I consider this a bad coupling. It is better to add a configuration variable --enable-missing-tools, and modify src/ci/run.sh to pass this into $RUST_CONFIGURE_ARGS when

  1. $RUST_RELEASE_CHANNEL = "nightly", or
  2. the env var $DIST_REQUIRE_ALL_TOOLS is undefined

You may see #39824 for how to add a config to rustbuild.

After this issue is fixed, we'll ensure RLS/Clippy/Rustfmt will be present on all tier-1 platforms on beta/stable. In the future we should record and alert the tool developers when they fail to build on nightly or lower-tier platforms, but let's get the immediate issue fixed first...

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: An issue proposing an enhancement or a PR with one.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)T-dev-toolsRelevant to the dev-tools subteam, 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