Skip to content

x.py test --bless tidy step does not work outside of root dir #122202

Closed
@pnkfelix

Description

@pnkfelix

I tried this: In a subdirectory root/objdir/, after a successful build, I then did ../x.py test --stage 1 --bless

I expected to see this happen: The test files that need updating get updated.

Instead, this happened: tidy panicked

[...]
tidy check
thread 'ui_tests (tests)' panicked at src/tools/tidy/src/ui_tests.rs:191:77:
called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at src/tools/tidy/src/main.rs:55:61:
called `Result::unwrap()` on an `Err` value: Any { .. }

I believe this is because of this code, which seems to contain an assumption that the current_dir will be the root of the source tree, which is not true in general for x.py:

let tidy_src = std::env::current_dir().unwrap().join("src/tools/tidy/src");

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions