Skip to content

Commit

Permalink
Unrolled build for rust-lang#116292
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#116292 - onur-ozkan:warn-wrong-sources, r=clubby789

warn if source is not either a git clone or a dist tarball

When the repository is downloaded directly via HTTP(as in rust-lang#115041), builds may fail due to missing submodules.

This PR adds a check that warns people in such cases.
  • Loading branch information
rust-timer authored Oct 1, 2023
2 parents 7c3eeb9 + 88e7718 commit 97c335a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -1042,6 +1042,12 @@ def bootstrap(args):
"""Configure, fetch, build and run the initial bootstrap"""
rust_root = os.path.abspath(os.path.join(__file__, '../../..'))

if not os.path.exists(os.path.join(rust_root, '.git')) and \
os.path.exists(os.path.join(rust_root, '.github')):
eprint("warn: Looks like you are trying to bootstrap Rust from a source that is neither a "
"git clone nor distributed tarball.\nThis build may fail due to missing submodules "
"unless you put them in place manually.")

# Read from `--config`, then `RUST_BOOTSTRAP_CONFIG`, then `./config.toml`,
# then `config.toml` in the root directory.
toml_path = args.config or os.getenv('RUST_BOOTSTRAP_CONFIG')
Expand Down

0 comments on commit 97c335a

Please sign in to comment.