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

delete bootstrap build before switching to bumped rustc #125911

Merged
merged 1 commit into from
Jun 5, 2024
Merged
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
18 changes: 17 additions & 1 deletion src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,12 @@ def download_toolchain(self):
print('Choosing a pool size of', pool_size, 'for the unpacking of the tarballs')
p = Pool(pool_size)
try:
# FIXME: A cheap workaround for https://github.com/rust-lang/rust/issues/125578,
# remove this once the issue is closed.
bootstrap_out = self.bootstrap_out()
if os.path.exists(bootstrap_out):
shutil.rmtree(bootstrap_out)

p.map(unpack_component, tarballs_download_info)
finally:
p.close()
Expand Down Expand Up @@ -864,6 +870,16 @@ def get_string(line):
return line[start + 1:end]
return None

def bootstrap_out(self):
"""Return the path of the bootstrap build artifacts

>>> rb = RustBuild()
>>> rb.build_dir = "build"
>>> rb.bootstrap_binary() == os.path.join("build", "bootstrap")
True
"""
return os.path.join(self.build_dir, "bootstrap")

def bootstrap_binary(self):
"""Return the path of the bootstrap binary

Expand All @@ -873,7 +889,7 @@ def bootstrap_binary(self):
... "debug", "bootstrap")
True
"""
return os.path.join(self.build_dir, "bootstrap", "debug", "bootstrap")
return os.path.join(self.bootstrap_out(), "debug", "bootstrap")

def build_bootstrap(self):
"""Build bootstrap"""
Expand Down
Loading