Skip to content

Commit 10fde33

Browse files
authored
Rollup merge of #41600 - ranma42:xz-dist, r=alexcrichton
Generate XZ-compressed tarballs Integrate the new `rust-installer` and extend manifests with keys for xz-compressed tarballs. One of the steps required for #21724
2 parents 9f06dfb + 98dd82c commit 10fde33

File tree

3 files changed

+43
-24
lines changed

3 files changed

+43
-24
lines changed

.travis.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,10 @@ matrix:
9595
MACOSX_DEPLOYMENT_TARGET=10.7
9696
os: osx
9797
osx_image: xcode7
98-
install: *osx_install_sccache
98+
install:
99+
- travis_retry brew update
100+
- travis_retry brew install xz
101+
- *osx_install_sccache
99102
- env: >
100103
RUST_CHECK_TARGET=dist
101104
RUST_CONFIGURE_ARGS="--target=aarch64-apple-ios,armv7-apple-ios,armv7s-apple-ios,i386-apple-ios,x86_64-apple-ios --enable-extended --enable-sanitizers"
@@ -106,7 +109,10 @@ matrix:
106109
MACOSX_DEPLOYMENT_TARGET=10.7
107110
os: osx
108111
osx_image: xcode7
109-
install: *osx_install_sccache
112+
install:
113+
- travis_retry brew update
114+
- travis_retry brew install xz
115+
- *osx_install_sccache
110116
111117
# "alternate" deployments, these are "nightlies" but don't have assertions
112118
# turned on, they're deployed to a different location primarily for projects
@@ -123,7 +129,10 @@ matrix:
123129
MACOSX_DEPLOYMENT_TARGET=10.7
124130
os: osx
125131
osx_image: xcode7
126-
install: *osx_install_sccache
132+
install:
133+
- travis_retry brew update
134+
- travis_retry brew install xz
135+
- *osx_install_sccache
127136
128137
env:
129138
global:

src/tools/build-manifest/src/main.rs

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,26 @@ struct Target {
116116
available: bool,
117117
url: Option<String>,
118118
hash: Option<String>,
119+
xz_url: Option<String>,
120+
xz_hash: Option<String>,
119121
components: Option<Vec<Component>>,
120122
extensions: Option<Vec<Component>>,
121123
}
122124

125+
impl Target {
126+
fn unavailable() -> Target {
127+
Target {
128+
available: false,
129+
url: None,
130+
hash: None,
131+
xz_url: None,
132+
xz_hash: None,
133+
components: None,
134+
extensions: None,
135+
}
136+
}
137+
}
138+
123139
#[derive(RustcEncodable)]
124140
struct Component {
125141
pkg: String,
@@ -242,16 +258,12 @@ impl Builder {
242258
let digest = match self.digests.remove(&filename) {
243259
Some(digest) => digest,
244260
None => {
245-
pkg.target.insert(host.to_string(), Target {
246-
available: false,
247-
url: None,
248-
hash: None,
249-
components: None,
250-
extensions: None,
251-
});
261+
pkg.target.insert(host.to_string(), Target::unavailable());
252262
continue
253263
}
254264
};
265+
let xz_filename = filename.replace(".tar.gz", ".tar.xz");
266+
let xz_digest = self.digests.remove(&xz_filename);
255267
let mut components = Vec::new();
256268
let mut extensions = Vec::new();
257269

@@ -293,8 +305,10 @@ impl Builder {
293305

294306
pkg.target.insert(host.to_string(), Target {
295307
available: true,
296-
url: Some(self.url("rust", host)),
308+
url: Some(self.url(&filename)),
297309
hash: Some(digest),
310+
xz_url: xz_digest.as_ref().map(|_| self.url(&xz_filename)),
311+
xz_hash: xz_digest,
298312
components: Some(components),
299313
extensions: Some(extensions),
300314
});
@@ -312,21 +326,17 @@ impl Builder {
312326
let filename = self.filename(pkgname, name);
313327
let digest = match self.digests.remove(&filename) {
314328
Some(digest) => digest,
315-
None => {
316-
return (name.to_string(), Target {
317-
available: false,
318-
url: None,
319-
hash: None,
320-
components: None,
321-
extensions: None,
322-
})
323-
}
329+
None => return (name.to_string(), Target::unavailable()),
324330
};
331+
let xz_filename = filename.replace(".tar.gz", ".tar.xz");
332+
let xz_digest = self.digests.remove(&xz_filename);
325333

326334
(name.to_string(), Target {
327335
available: true,
328-
url: Some(self.url(pkgname, name)),
336+
url: Some(self.url(&filename)),
329337
hash: Some(digest),
338+
xz_url: xz_digest.as_ref().map(|_| self.url(&xz_filename)),
339+
xz_hash: xz_digest,
330340
components: None,
331341
extensions: None,
332342
})
@@ -338,11 +348,11 @@ impl Builder {
338348
});
339349
}
340350

341-
fn url(&self, component: &str, target: &str) -> String {
351+
fn url(&self, filename: &str) -> String {
342352
format!("{}/{}/{}",
343353
self.s3_address,
344354
self.date,
345-
self.filename(component, target))
355+
filename)
346356
}
347357

348358
fn filename(&self, component: &str, target: &str) -> String {

0 commit comments

Comments
 (0)