add bootstrap tests for detecting src and out

e312db9
Opened by jyn at 2023-09-02 06:58:52

I was thinking about the following cases when I wrote the comment in #109055

  1. Running bootstrap from the source root.
  2. Running from a subdirectory of the source root.
  3. Running from outside the source root.
  4. Running on a different machine from where bootstrap was compiled (which will be important for #107812). You can mostly replicate this by renaming the source root so it no longer exists on disk.
  5. Running with --build-dir.
  6. Running with $RUST_BOOTSTRAP_CONFIG set in the environment and build-dir set in the file.

Originally posted by @jyn514 in https://github.com/rust-lang/rust/issues/109055#issuecomment-1467088488