Skip to content

Commit 190396e

Browse files
committed
servo: Merge #17780 - Update to cargo 0.21.0-nightly (eb6cf012a 2017-07-02) (from servo:cargoup); r=nox,SimonSapin
Cargo binaries are now produced on Rust’s CI, not Cargo’s. Remove cargo-commit-hash and find Cargo based on rust-commit-hash. Unfortunately, Cargo binaries are not available for every Cargo PR anymore: rust-lang/cargo#4123 (comment) Source-Repo: https://github.com/servo/servo Source-Revision: d403f404382c66485d9744787ce021556be59d6c
1 parent 91ee7b1 commit 190396e

File tree

6 files changed

+32
-49
lines changed

6 files changed

+32
-49
lines changed

servo/Cargo.lock

Lines changed: 10 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

servo/appveyor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ branches:
3636
- master
3737

3838
cache:
39-
- .servo -> rust-commit-hash, cargo-commit-hash
40-
- .cargo -> rust-commit-hash, cargo-commit-hash
39+
- .servo -> rust-commit-hash
40+
- .cargo -> rust-commit-hash
4141
- .ccache
4242

4343
# Uncomment these lines to expose RDP access information to the build machine in the build log.

servo/cargo-commit-hash

Lines changed: 0 additions & 1 deletion
This file was deleted.

servo/python/servo/bootstrap_commands.py

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,8 @@ def bootstrap_cargo(self, force=False):
207207
os.makedirs(cargo_dir)
208208

209209
tgz_file = "cargo-nightly-%s.tar.gz" % host_triple()
210-
nightly_url = "https://s3.amazonaws.com/rust-lang-ci/cargo-builds/%s/%s" % \
211-
(self.cargo_build_id(), tgz_file)
210+
nightly_url = "https://s3.amazonaws.com/rust-lang-ci/rustc-builds/%s/%s" % \
211+
(self.cargo_build_id()[len("rust-"):], tgz_file)
212212

213213
download_file("Cargo nightly", nightly_url, tgz_file)
214214

@@ -295,46 +295,38 @@ def clean_nightlies(self, force=False, keep=None):
295295
rust_current_nightly = self.rust_version()
296296
self.set_use_stable_rust(True)
297297
rust_current_stable = self.rust_version()
298-
cargo_current = self.cargo_build_id()
299298
print("Current Rust nightly version: {}".format(rust_current_nightly))
300299
print("Current Rust stable version: {}".format(rust_current_stable))
301-
print("Current Cargo version: {}".format(cargo_current))
302-
to_keep = {
303-
'rust': set(),
304-
'cargo': set(),
305-
}
300+
to_keep = set()
306301
if int(keep) == 1:
307302
# Optimize keep=1 case to not invoke git
308-
to_keep['rust'].add(rust_current_nightly)
309-
to_keep['rust'].add(rust_current_stable)
310-
to_keep['cargo'].add(cargo_current)
303+
to_keep.add(rust_current_nightly)
304+
to_keep.add(rust_current_stable)
311305
else:
312-
for tool, version_files in {
313-
'rust': ['rust-commit-hash', 'rust-stable-version'],
314-
'cargo': ['cargo-commit-hash'],
315-
}.items():
316-
for version_file in version_files:
317-
cmd = subprocess.Popen(
318-
['git', 'log', '--oneline', '--no-color', '-n', keep, '--patch', version_file],
319-
stdout=subprocess.PIPE,
320-
universal_newlines=True
321-
)
322-
stdout, _ = cmd.communicate()
323-
for line in stdout.splitlines():
324-
if line.startswith(b"+") and not line.startswith(b"+++"):
325-
to_keep[tool].add(line[1:])
306+
for version_file in ['rust-commit-hash', 'rust-stable-version']:
307+
cmd = subprocess.Popen(
308+
['git', 'log', '--oneline', '--no-color', '-n', keep, '--patch', version_file],
309+
stdout=subprocess.PIPE,
310+
universal_newlines=True
311+
)
312+
stdout, _ = cmd.communicate()
313+
for line in stdout.splitlines():
314+
if line.startswith(b"+") and not line.startswith(b"+++"):
315+
to_keep.add(line[1:])
326316

327317
removing_anything = False
328318
for tool in ["rust", "cargo"]:
329319
base = path.join(self.context.sharedir, tool)
330320
if not path.isdir(base):
331321
continue
332322
for name in os.listdir(base):
323+
if name.startswith("rust-"):
324+
name = name[len("rust-"):]
333325
# We append `-alt` if LLVM assertions aren't enabled,
334326
# so use just the commit hash itself.
335327
# This may occasionally leave an extra nightly behind
336328
# but won't remove too many nightlies.
337-
if name.partition('-')[0] not in to_keep[tool]:
329+
if name.partition('-')[0] not in to_keep:
338330
removing_anything = True
339331
full_path = path.join(base, name)
340332
if force:

servo/python/servo/command_base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,9 +326,9 @@ def rust_version(self):
326326

327327
def cargo_build_id(self):
328328
if self._cargo_build_id is None:
329-
filename = path.join(self.context.topdir, "cargo-commit-hash")
329+
filename = path.join(self.context.topdir, "rust-commit-hash")
330330
with open(filename) as f:
331-
self._cargo_build_id = f.read().strip()
331+
self._cargo_build_id = "rust-" + f.read().strip()
332332
return self._cargo_build_id
333333

334334
def get_top_dir(self):

servo/python/servo/devenv_commands.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -284,21 +284,6 @@ def rustup(self, master=False):
284284
# Reset self.config["tools"]["rust-root"]
285285
self._rust_version = None
286286
self.set_use_stable_rust(False)
287-
288-
self.fetch()
289-
290-
@Command('cargoup',
291-
description='Update the Cargo version to latest master',
292-
category='devenv')
293-
def cargoup(self):
294-
url = "https://api.github.com/repos/rust-lang/cargo/git/refs/heads/master"
295-
commit = json.load(urllib2.urlopen(url))["object"]["sha"]
296-
filename = path.join(self.context.topdir, "cargo-commit-hash")
297-
with open(filename, "w") as f:
298-
f.write(commit + "\n")
299-
300-
# Reset self.config["tools"]["cargo-root"]
301-
self._cargo_build_id = None
302287
self.set_cargo_root()
303288

304289
self.fetch()

0 commit comments

Comments
 (0)