aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2017-05-02 12:37:03 -0500
committerGitHub <noreply@github.com>2017-05-02 12:37:03 -0500
commit225b505d222e0437a4ac0d6d0f5e5221de9c22e6 (patch)
tree132b2777b611026e2f456e42ad214e6f386d4c68
parentf56032b9201ef3227629439552a070ce255facf7 (diff)
parentcc86993857931f85cb4680f30e8f4087c9769998 (diff)
downloadservo-225b505d222e0437a4ac0d6d0f5e5221de9c22e6.tar.gz
servo-225b505d222e0437a4ac0d6d0f5e5221de9c22e6.zip
Auto merge of #16687 - aneeshusa:keep-stable-rustc-during-clean-nightlies, r=mbrubeck
Keep stable rustc versions in `clean-nightlies` Check the `rust-stable-version` file to keep the last n versions of both the nightly and the stable compiler. <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [ ] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #16675 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [x] These changes do not require tests because they should be checked manually <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16687) <!-- Reviewable:end -->
-rw-r--r--python/servo/bootstrap_commands.py36
1 files changed, 22 insertions, 14 deletions
diff --git a/python/servo/bootstrap_commands.py b/python/servo/bootstrap_commands.py
index 6866b543213..a3016014792 100644
--- a/python/servo/bootstrap_commands.py
+++ b/python/servo/bootstrap_commands.py
@@ -290,9 +290,13 @@ class MachCommands(CommandBase):
default='1',
help='Keep up to this many most recent nightlies')
def clean_nightlies(self, force=False, keep=None):
- rust_current = self.rust_version()
+ self.set_use_stable_rust(False)
+ rust_current_nightly = self.rust_version()
+ self.set_use_stable_rust(True)
+ rust_current_stable = self.rust_version()
cargo_current = self.cargo_build_id()
- print("Current Rust version: {}".format(rust_current))
+ print("Current Rust nightly version: {}".format(rust_current_nightly))
+ print("Current Rust stable version: {}".format(rust_current_stable))
print("Current Cargo version: {}".format(cargo_current))
to_keep = {
'rust': set(),
@@ -300,20 +304,24 @@ class MachCommands(CommandBase):
}
if int(keep) == 1:
# Optimize keep=1 case to not invoke git
- to_keep['rust'].add(rust_current)
+ to_keep['rust'].add(rust_current_nightly)
+ to_keep['rust'].add(rust_current_stable)
to_keep['cargo'].add(cargo_current)
else:
- for tool in ["rust", "cargo"]:
- commit_file = '{}-commit-hash'.format(tool)
- cmd = subprocess.Popen(
- ['git', 'log', '--oneline', '--no-color', '-n', keep, '--patch', commit_file],
- stdout=subprocess.PIPE,
- universal_newlines=True
- )
- stdout, _ = cmd.communicate()
- for line in stdout.splitlines():
- if line.startswith("+") and not line.startswith("+++"):
- to_keep[tool].add(line[1:])
+ for tool, version_files in {
+ 'rust': ['rust-commit-hash', 'rust-stable-version'],
+ 'cargo': ['cargo-commit-hash'],
+ }.items():
+ for version_file in version_files:
+ cmd = subprocess.Popen(
+ ['git', 'log', '--oneline', '--no-color', '-n', keep, '--patch', version_file],
+ stdout=subprocess.PIPE,
+ universal_newlines=True
+ )
+ stdout, _ = cmd.communicate()
+ for line in stdout.splitlines():
+ if line.startswith("+") and not line.startswith("+++"):
+ to_keep[tool].add(line[1:])
removing_anything = False
for tool in ["rust", "cargo"]: