Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error early if there are spaces in the source directory path, rather than waiting for LLVM to fail #101043

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions x.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

import os
import sys
import re
import logging

# If this is python2, check if python3 is available and re-execute with that
# interpreter. Only python3 allows downloading CI LLVM.
Expand All @@ -22,7 +24,22 @@
pass

rust_dir = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.join(rust_dir, "src", "bootstrap"))

import bootstrap
bootstrap.main()
# Temporary 'fix' for https://github.com/rust-lang/rust/issues/56650.
# Various chunks of the build system can't correctly handle spaces in paths, and
# will break in unexpected ways if there are any. This tests to see if there
# are spaces in the path, quitting with an error if there are any
if re.search("\s", rust_dir):
logging.critical("There is a known bug in the build system "
"(https://github.com/rust-lang/rust/issues/56650) "
"that means that if there are spaces in your path then "
"the build system will fail. Your path ('%s') contains "
"at least one space in it. Either move your rust "
"repository to a path that has no spaces in it, or "
"change your path to remove all spaces. Now quitting.",
rust_dir)
else:
sys.path.append(os.path.join(rust_dir, "src", "bootstrap"))

import bootstrap
bootstrap.main()