mirror of
https://github.com/servo/servo.git
synced 2025-06-19 14:48:59 +01:00
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.
This commit is contained in:
parent
b0e3005dc7
commit
8303f5b926
5 changed files with 22 additions and 46 deletions
|
@ -36,8 +36,8 @@ branches:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
- .servo -> rust-commit-hash, cargo-commit-hash
|
- .servo -> rust-commit-hash
|
||||||
- .cargo -> rust-commit-hash, cargo-commit-hash
|
- .cargo -> rust-commit-hash
|
||||||
- .ccache
|
- .ccache
|
||||||
|
|
||||||
# Uncomment these lines to expose RDP access information to the build machine in the build log.
|
# Uncomment these lines to expose RDP access information to the build machine in the build log.
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
2233f515b1e8281841ceaed802f74fe2f9e54701
|
|
|
@ -207,8 +207,8 @@ class MachCommands(CommandBase):
|
||||||
os.makedirs(cargo_dir)
|
os.makedirs(cargo_dir)
|
||||||
|
|
||||||
tgz_file = "cargo-nightly-%s.tar.gz" % host_triple()
|
tgz_file = "cargo-nightly-%s.tar.gz" % host_triple()
|
||||||
nightly_url = "https://s3.amazonaws.com/rust-lang-ci/cargo-builds/%s/%s" % \
|
nightly_url = "https://s3.amazonaws.com/rust-lang-ci/rustc-builds/%s/%s" % \
|
||||||
(self.cargo_build_id(), tgz_file)
|
(self.cargo_build_id()[len("rust-"):], tgz_file)
|
||||||
|
|
||||||
download_file("Cargo nightly", nightly_url, tgz_file)
|
download_file("Cargo nightly", nightly_url, tgz_file)
|
||||||
|
|
||||||
|
@ -295,34 +295,24 @@ class MachCommands(CommandBase):
|
||||||
rust_current_nightly = self.rust_version()
|
rust_current_nightly = self.rust_version()
|
||||||
self.set_use_stable_rust(True)
|
self.set_use_stable_rust(True)
|
||||||
rust_current_stable = self.rust_version()
|
rust_current_stable = self.rust_version()
|
||||||
cargo_current = self.cargo_build_id()
|
|
||||||
print("Current Rust nightly version: {}".format(rust_current_nightly))
|
print("Current Rust nightly version: {}".format(rust_current_nightly))
|
||||||
print("Current Rust stable version: {}".format(rust_current_stable))
|
print("Current Rust stable version: {}".format(rust_current_stable))
|
||||||
print("Current Cargo version: {}".format(cargo_current))
|
to_keep = set()
|
||||||
to_keep = {
|
|
||||||
'rust': set(),
|
|
||||||
'cargo': set(),
|
|
||||||
}
|
|
||||||
if int(keep) == 1:
|
if int(keep) == 1:
|
||||||
# Optimize keep=1 case to not invoke git
|
# Optimize keep=1 case to not invoke git
|
||||||
to_keep['rust'].add(rust_current_nightly)
|
to_keep.add(rust_current_nightly)
|
||||||
to_keep['rust'].add(rust_current_stable)
|
to_keep.add(rust_current_stable)
|
||||||
to_keep['cargo'].add(cargo_current)
|
|
||||||
else:
|
else:
|
||||||
for tool, version_files in {
|
for version_file in ['rust-commit-hash', 'rust-stable-version']:
|
||||||
'rust': ['rust-commit-hash', 'rust-stable-version'],
|
cmd = subprocess.Popen(
|
||||||
'cargo': ['cargo-commit-hash'],
|
['git', 'log', '--oneline', '--no-color', '-n', keep, '--patch', version_file],
|
||||||
}.items():
|
stdout=subprocess.PIPE,
|
||||||
for version_file in version_files:
|
universal_newlines=True
|
||||||
cmd = subprocess.Popen(
|
)
|
||||||
['git', 'log', '--oneline', '--no-color', '-n', keep, '--patch', version_file],
|
stdout, _ = cmd.communicate()
|
||||||
stdout=subprocess.PIPE,
|
for line in stdout.splitlines():
|
||||||
universal_newlines=True
|
if line.startswith(b"+") and not line.startswith(b"+++"):
|
||||||
)
|
to_keep.add(line[1:])
|
||||||
stdout, _ = cmd.communicate()
|
|
||||||
for line in stdout.splitlines():
|
|
||||||
if line.startswith(b"+") and not line.startswith(b"+++"):
|
|
||||||
to_keep[tool].add(line[1:])
|
|
||||||
|
|
||||||
removing_anything = False
|
removing_anything = False
|
||||||
for tool in ["rust", "cargo"]:
|
for tool in ["rust", "cargo"]:
|
||||||
|
@ -330,11 +320,13 @@ class MachCommands(CommandBase):
|
||||||
if not path.isdir(base):
|
if not path.isdir(base):
|
||||||
continue
|
continue
|
||||||
for name in os.listdir(base):
|
for name in os.listdir(base):
|
||||||
|
if name.startswith("rust-"):
|
||||||
|
name = name[len("rust-"):]
|
||||||
# We append `-alt` if LLVM assertions aren't enabled,
|
# We append `-alt` if LLVM assertions aren't enabled,
|
||||||
# so use just the commit hash itself.
|
# so use just the commit hash itself.
|
||||||
# This may occasionally leave an extra nightly behind
|
# This may occasionally leave an extra nightly behind
|
||||||
# but won't remove too many nightlies.
|
# 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
|
removing_anything = True
|
||||||
full_path = path.join(base, name)
|
full_path = path.join(base, name)
|
||||||
if force:
|
if force:
|
||||||
|
|
|
@ -326,9 +326,9 @@ class CommandBase(object):
|
||||||
|
|
||||||
def cargo_build_id(self):
|
def cargo_build_id(self):
|
||||||
if self._cargo_build_id is None:
|
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:
|
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
|
return self._cargo_build_id
|
||||||
|
|
||||||
def get_top_dir(self):
|
def get_top_dir(self):
|
||||||
|
|
|
@ -284,21 +284,6 @@ class MachCommands(CommandBase):
|
||||||
# Reset self.config["tools"]["rust-root"]
|
# Reset self.config["tools"]["rust-root"]
|
||||||
self._rust_version = None
|
self._rust_version = None
|
||||||
self.set_use_stable_rust(False)
|
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.set_cargo_root()
|
||||||
|
|
||||||
self.fetch()
|
self.fetch()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue