rust-lang/rust · error · anyhow::Error
Computed job list is empty
Error message
Computed job list is empty
What it means
Thrown by calculate_job_matrix after calculate_jobs returns an empty Vec, as long as the run type is not RunType::MainJob. calculate_jobs filters the JobDatabase by run type, channel (only_on_channel), and try-job glob patterns; if every job is filtered out there is nothing to execute. MainJob is exempt because a main-branch push legitimately runs no citool-scheduled jobs.
Source
Thrown at src/ci/citool/src/jobs.rs:382
})
.collect();
Ok(jobs)
}
pub fn calculate_job_matrix(
db: JobDatabase,
gh_ctx: GitHubContext,
channel: &str,
) -> anyhow::Result<()> {
let run_type = gh_ctx.get_run_type().ok_or_else(|| {
anyhow::anyhow!("Cannot determine the type of workflow that is being executed")
})?;
eprintln!("Run type: {run_type:?}");
let jobs = calculate_jobs(&run_type, &db, channel)?;
if jobs.is_empty() && !matches!(run_type, RunType::MainJob) {
return Err(anyhow::anyhow!("Computed job list is empty"));
}
let run_type = match run_type {
RunType::PullRequest => "pr",
RunType::TryJob { .. } => "try",
RunType::AutoJob => "auto",
RunType::MainJob => "main",
};
eprintln!("Output");
eprintln!("jobs={jobs:?}");
eprintln!("run_type={run_type}");
println!("jobs={}", serde_json::to_string(&jobs)?);
println!("run_type={run_type}");
Ok(())
}
View on GitHub (pinned to 7088e4b63a)
Solutions
- Inspect the 'Run type:' line citool prints just before the error to confirm the run type, then check jobs.yml for that bucket's contents.
- For try jobs, verify the try-job: patterns in the commit message against actual job names in jobs.yml (glob_match syntax).
- Check each candidate job's only_on_channel field against the channel argument passed to calculate_job_matrix.
- If the empty list is expected for your run type, confirm whether the run type should be MainJob (which is allowed to be empty).
Example fix
// before // commit message body: // try-job: dist-x86_64-unkown-linux-gnu (typo: unkown) // after // try-job: dist-x86_64-unknown-linux-gnu
Defensive patterns
Strategy: validation
Validate before calling
// Before calculate_job_matrix, sanity-check the bucket for the run type is non-empty
// (unless it is MainJob, which is allowed to be empty).
let run_type = gh_ctx.get_run_type();
if run_type.is_some() && !matches!(run_type, Some(RunType::MainJob)) {
let probe = calculate_jobs(&run_type.unwrap(), &db, channel)?;
if probe.is_empty() {
eprintln!("Warning: no jobs match the current run type/channel/patterns");
}
} Prevention
- Validate try-job: glob patterns against jobs.yml before pushing the try commit.
- Keep only_on_channel values consistent with the channels you actually run.
- When restructuring jobs.yml, verify each run-type bucket still resolves to jobs.
When it happens
Trigger: A try-job whose commit message lists try-job: patterns that match zero auto/optional jobs; a PR/try/auto run restricted to a channel where all candidate jobs carry only_on_channel set to a different channel; jobs.yml edited so a run-type bucket is empty.
Common situations: Typo in a try-job: <pattern> line (glob matches nothing); jobs.yml refactored and a job moved out of the pr/try/auto list; running on a beta/stable channel while every job is pinned only_on_channel: nightly.
Related errors
- Cannot determine the type of workflow that is being executed
- Job {name} not found. The following jobs are available: {}
- Cannot get jobs of workflow run {workflow_run_id}: {status}
- duplicate job name `{job_name}` in section `{section}`
- PR job `{}` differs from corresponding Auto job `{}` in conf
AI-assisted analysis of rust-lang/rust@7088e4b63a (2026-08-10).
Data as JSON: /api/errors/19c07434683c44fe.
Report an issue: GitHub.