diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2024-02-07 00:14:29 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2024-02-07 03:58:35 +0530 |
commit | 35be05359e9c898e7a58abb228f4f060ae29e2a6 (patch) | |
tree | 5a8f2d0b50aca3ce0a8ada364fa591e14917da8c | |
parent | b7a7a65aae00de2a72c0676e3f2691959d741ac6 (diff) |
cerbero: Remove rustup home before installing rust toolchain
Otherwise in-place updates will be broken, because rustup-init will
try to install every target that exists in the prefix, not just the
one we want to install.
Fixes https://gitlab.freedesktop.org/gstreamer/cerbero/-/issues/465
Part-of: <https://gitlab.freedesktop.org/gstreamer/cerbero/-/merge_requests/1345>
-rw-r--r-- | cerbero/bootstrap/rust.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/cerbero/bootstrap/rust.py b/cerbero/bootstrap/rust.py index b1d85d16..4cd4c492 100644 --- a/cerbero/bootstrap/rust.py +++ b/cerbero/bootstrap/rust.py @@ -221,6 +221,8 @@ class RustBootstrapper(BootstrapperBase): for suffix in ('', '.asc', '.sha256'): stable_channel = f'{os.path.dirname(self.channel)}/channel-rust-stable.toml' shutil.copyfile(self.channel + suffix, stable_channel + suffix) + if os.path.exists(self.config.rustup_home): + shutil.rmtree(self.config.rustup_home) # Use async_call_output to discard stdout which contains messages that will confuse the user await shell.async_call_output(rustup_args, cpu_bound=False, env=rustup_env) m.message('Rust toolchain v{} installed at {}'.format(self.RUST_VERSION, self.config.rust_prefix)) |