diff options
| author | Mark Rousskov <mark.simulacrum@gmail.com> | 2020-01-31 12:25:14 -0500 |
|---|---|---|
| committer | Mark Rousskov <mark.simulacrum@gmail.com> | 2020-01-31 12:25:14 -0500 |
| commit | b613b0cb3641a7a5be74471e8e5963e52adf30ea (patch) | |
| tree | e53a2a51e85eca5754e2a5ab6abd827be6ec1d3b | |
| parent | ecde10fc283530db0db42e2c3e2e3132e809b139 (diff) | |
| download | rust-b613b0cb3641a7a5be74471e8e5963e52adf30ea.tar.gz rust-b613b0cb3641a7a5be74471e8e5963e52adf30ea.zip | |
Correctly reinstall rustfmt on channel change
| -rw-r--r-- | src/bootstrap/bootstrap.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index 6737086f6e5..1935759a562 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -397,7 +397,7 @@ class RustBuild(object): if self.rustfmt() and self.rustfmt().startswith(self.bin_root()) and ( not os.path.exists(self.rustfmt()) - or self.program_out_of_date(self.rustfmt_stamp()) + or self.program_out_of_date(self.rustfmt_stamp(), self.rustfmt_channel) ): if rustfmt_channel: tarball_suffix = '.tar.xz' if support_xz() else '.tar.gz' @@ -407,7 +407,7 @@ class RustBuild(object): self.fix_executable("{}/bin/rustfmt".format(self.bin_root())) self.fix_executable("{}/bin/cargo-fmt".format(self.bin_root())) with output(self.rustfmt_stamp()) as rustfmt_stamp: - rustfmt_stamp.write(self.date) + rustfmt_stamp.write(self.date + self.rustfmt_channel) def _download_stage0_helper(self, filename, pattern, tarball_suffix, date=None): if date is None: @@ -521,12 +521,12 @@ class RustBuild(object): """ return os.path.join(self.bin_root(), '.rustfmt-stamp') - def program_out_of_date(self, stamp_path): + def program_out_of_date(self, stamp_path, extra=""): """Check if the given program stamp is out of date""" if not os.path.exists(stamp_path) or self.clean: return True with open(stamp_path, 'r') as stamp: - return self.date != stamp.read() + return (self.date + extra) != stamp.read() def bin_root(self): """Return the binary root directory |
