diff options
author | Simon Sapin <simon.sapin@exyr.org> | 2017-07-18 23:05:11 +0200 |
---|---|---|
committer | Simon Sapin <simon.sapin@exyr.org> | 2017-07-19 00:56:30 +0200 |
commit | 8303f5b9263f3dba24cd79202472097f32864b2b (patch) | |
tree | 898bd5eb6079f583eea9f11c166e15edc6743c7b | |
parent | b0e3005dc798e73142a8bdd4a3b1317350620d49 (diff) | |
download | servo-8303f5b9263f3dba24cd79202472097f32864b2b.tar.gz servo-8303f5b9263f3dba24cd79202472097f32864b2b.zip |
Update to cargo 0.21.0-nightly (eb6cf012a 2017-07-02)
Cargo binaries are now produced on Rust’s CI, not Cargo’s.
Remove cargo-commit-hash and find Cargo based on rust-commit-hash.
-rw-r--r-- | appveyor.yml | 4 | ||||
-rw-r--r-- | cargo-commit-hash | 1 | ||||
-rw-r--r-- | python/servo/bootstrap_commands.py | 44 | ||||
-rw-r--r-- | python/servo/command_base.py | 4 | ||||
-rw-r--r-- | python/servo/devenv_commands.py | 15 |
5 files changed, 22 insertions, 46 deletions
diff --git a/appveyor.yml b/appveyor.yml index 4fb2b2e832f..b648da06876 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -36,8 +36,8 @@ branches: - master cache: - - .servo -> rust-commit-hash, cargo-commit-hash - - .cargo -> rust-commit-hash, cargo-commit-hash + - .servo -> rust-commit-hash + - .cargo -> rust-commit-hash - .ccache # Uncomment these lines to expose RDP access information to the build machine in the build log. diff --git a/cargo-commit-hash b/cargo-commit-hash deleted file mode 100644 index 78b19407e07..00000000000 --- a/cargo-commit-hash +++ /dev/null @@ -1 +0,0 @@ -2233f515b1e8281841ceaed802f74fe2f9e54701 diff --git a/python/servo/bootstrap_commands.py b/python/servo/bootstrap_commands.py index ceab1907f46..b12ba0242d7 100644 --- a/python/servo/bootstrap_commands.py +++ b/python/servo/bootstrap_commands.py @@ -207,8 +207,8 @@ class MachCommands(CommandBase): os.makedirs(cargo_dir) tgz_file = "cargo-nightly-%s.tar.gz" % host_triple() - nightly_url = "https://s3.amazonaws.com/rust-lang-ci/cargo-builds/%s/%s" % \ - (self.cargo_build_id(), tgz_file) + nightly_url = "https://s3.amazonaws.com/rust-lang-ci/rustc-builds/%s/%s" % \ + (self.cargo_build_id()[len("rust-"):], tgz_file) download_file("Cargo nightly", nightly_url, tgz_file) @@ -295,34 +295,24 @@ class MachCommands(CommandBase): 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 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(), - 'cargo': set(), - } + to_keep = set() if int(keep) == 1: # Optimize keep=1 case to not invoke git - to_keep['rust'].add(rust_current_nightly) - to_keep['rust'].add(rust_current_stable) - to_keep['cargo'].add(cargo_current) + to_keep.add(rust_current_nightly) + to_keep.add(rust_current_stable) else: - 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(b"+") and not line.startswith(b"+++"): - to_keep[tool].add(line[1:]) + for version_file in ['rust-commit-hash', 'rust-stable-version']: + 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(b"+") and not line.startswith(b"+++"): + to_keep.add(line[1:]) removing_anything = False for tool in ["rust", "cargo"]: @@ -330,11 +320,13 @@ class MachCommands(CommandBase): if not path.isdir(base): continue for name in os.listdir(base): + if name.startswith("rust-"): + name = name[len("rust-"):] # We append `-alt` if LLVM assertions aren't enabled, # so use just the commit hash itself. # This may occasionally leave an extra nightly behind # but won't remove too many nightlies. - if name.partition('-')[0] not in to_keep[tool]: + if name.partition('-')[0] not in to_keep: removing_anything = True full_path = path.join(base, name) if force: diff --git a/python/servo/command_base.py b/python/servo/command_base.py index e8bad0a742f..abaa643fbb3 100644 --- a/python/servo/command_base.py +++ b/python/servo/command_base.py @@ -326,9 +326,9 @@ class CommandBase(object): def cargo_build_id(self): if self._cargo_build_id is None: - filename = path.join(self.context.topdir, "cargo-commit-hash") + filename = path.join(self.context.topdir, "rust-commit-hash") with open(filename) as f: - self._cargo_build_id = f.read().strip() + self._cargo_build_id = "rust-" + f.read().strip() return self._cargo_build_id def get_top_dir(self): diff --git a/python/servo/devenv_commands.py b/python/servo/devenv_commands.py index ff70769771a..e66fa7b457d 100644 --- a/python/servo/devenv_commands.py +++ b/python/servo/devenv_commands.py @@ -284,21 +284,6 @@ class MachCommands(CommandBase): # Reset self.config["tools"]["rust-root"] self._rust_version = None self.set_use_stable_rust(False) - - self.fetch() - - @Command('cargoup', - description='Update the Cargo version to latest master', - category='devenv') - def cargoup(self): - url = "https://api.github.com/repos/rust-lang/cargo/git/refs/heads/master" - commit = json.load(urllib2.urlopen(url))["object"]["sha"] - filename = path.join(self.context.topdir, "cargo-commit-hash") - with open(filename, "w") as f: - f.write(commit + "\n") - - # Reset self.config["tools"]["cargo-root"] - self._cargo_build_id = None self.set_cargo_root() self.fetch() |