Skip to content

compiletest remove_and_create_dir_all may need retries #139230

Closed
@jieyouxu

Description

@jieyouxu

cf. #134351. The current impl of remove_and_create_dir_all silently ignores the remove_dir_all failure and tries to create_dir_all, which can fail if remove_dir_all fails and a directory already exists.

fn remove_and_create_dir_all(path: &Path) {
    let _ = fs::remove_dir_all(path);
    fs::create_dir_all(path).unwrap();
}

compiletest cannot paper over create_dir_all failures (esp. if due to the directory already existing) to avoid running tests against outdated/invalid artifacts. So maybe a retry mechanism is needed. However, this should not be spot-fixed, and instead the retry mechanism should be shared between bootstrap/compiletest, preferrably in build_helpers with its own tests.

Metadata

Metadata

Assignees

Labels

A-compiletestArea: The compiletest test runnerA-test-infraArea: test infrastructure (may span bootstrap/compiletest/more)C-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.

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions