1 //! Build a dist manifest, hash and sign everything.
2 //! This gets called by `promote-release`
3 //! (https://github.com/rust-lang/rust-central-station/tree/master/promote-release)
4 //! via `x.py dist hash-and-sign`; the cmdline arguments are set up
5 //! by rustbuild (in `src/bootstrap/dist.rs`).
9 use std::collections::BTreeMap;
10 use std::collections::HashMap;
12 use std::fs::{self, File};
13 use std::io::{self, Read, Write};
14 use std::path::{Path, PathBuf};
15 use std::process::{Command, Stdio};
17 static HOSTS: &[&str] = &[
18 "aarch64-unknown-linux-gnu",
19 "arm-unknown-linux-gnueabi",
20 "arm-unknown-linux-gnueabihf",
21 "armv7-unknown-linux-gnueabihf",
23 "i686-pc-windows-gnu",
24 "i686-pc-windows-msvc",
25 "i686-unknown-linux-gnu",
26 "mips-unknown-linux-gnu",
27 "mips64-unknown-linux-gnuabi64",
28 "mips64el-unknown-linux-gnuabi64",
29 "mipsel-unknown-linux-gnu",
30 "mipsisa32r6-unknown-linux-gnu",
31 "mipsisa32r6el-unknown-linux-gnu",
32 "mipsisa64r6-unknown-linux-gnuabi64",
33 "mipsisa64r6el-unknown-linux-gnuabi64",
34 "powerpc-unknown-linux-gnu",
35 "powerpc64-unknown-linux-gnu",
36 "powerpc64le-unknown-linux-gnu",
37 "riscv64gc-unknown-linux-gnu",
38 "s390x-unknown-linux-gnu",
39 "x86_64-apple-darwin",
40 "x86_64-pc-windows-gnu",
41 "x86_64-pc-windows-msvc",
42 "x86_64-unknown-freebsd",
43 "x86_64-unknown-illumos",
44 "x86_64-unknown-linux-gnu",
45 "x86_64-unknown-linux-musl",
46 "x86_64-unknown-netbsd",
49 static TARGETS: &[&str] = &[
52 "aarch64-linux-android",
53 "aarch64-pc-windows-msvc",
54 "aarch64-unknown-cloudabi",
55 "aarch64-unknown-hermit",
56 "aarch64-unknown-linux-gnu",
57 "aarch64-unknown-linux-musl",
58 "aarch64-unknown-none",
59 "aarch64-unknown-none-softfloat",
60 "aarch64-unknown-redox",
61 "arm-linux-androideabi",
62 "arm-unknown-linux-gnueabi",
63 "arm-unknown-linux-gnueabihf",
64 "arm-unknown-linux-musleabi",
65 "arm-unknown-linux-musleabihf",
66 "armv5te-unknown-linux-gnueabi",
67 "armv5te-unknown-linux-musleabi",
69 "armv7-linux-androideabi",
70 "thumbv7neon-linux-androideabi",
71 "armv7-unknown-linux-gnueabi",
72 "armv7-unknown-linux-gnueabihf",
74 "thumbv7neon-unknown-linux-gnueabihf",
75 "armv7-unknown-linux-musleabi",
76 "armv7-unknown-linux-musleabihf",
78 "armebv7r-none-eabihf",
82 "asmjs-unknown-emscripten",
84 "i586-pc-windows-msvc",
85 "i586-unknown-linux-gnu",
86 "i586-unknown-linux-musl",
89 "i686-pc-windows-gnu",
90 "i686-pc-windows-msvc",
91 "i686-unknown-freebsd",
92 "i686-unknown-linux-gnu",
93 "i686-unknown-linux-musl",
94 "mips-unknown-linux-gnu",
95 "mips-unknown-linux-musl",
96 "mips64-unknown-linux-gnuabi64",
97 "mips64-unknown-linux-muslabi64",
98 "mips64el-unknown-linux-gnuabi64",
99 "mips64el-unknown-linux-muslabi64",
100 "mipsisa32r6-unknown-linux-gnu",
101 "mipsisa32r6el-unknown-linux-gnu",
102 "mipsisa64r6-unknown-linux-gnuabi64",
103 "mipsisa64r6el-unknown-linux-gnuabi64",
104 "mipsel-unknown-linux-gnu",
105 "mipsel-unknown-linux-musl",
106 "nvptx64-nvidia-cuda",
107 "powerpc-unknown-linux-gnu",
108 "powerpc64-unknown-linux-gnu",
109 "powerpc64le-unknown-linux-gnu",
110 "riscv32i-unknown-none-elf",
111 "riscv32imc-unknown-none-elf",
112 "riscv32imac-unknown-none-elf",
113 "riscv64imac-unknown-none-elf",
114 "riscv64gc-unknown-none-elf",
115 "riscv64gc-unknown-linux-gnu",
116 "s390x-unknown-linux-gnu",
117 "sparc64-unknown-linux-gnu",
118 "sparcv9-sun-solaris",
119 "thumbv6m-none-eabi",
120 "thumbv7em-none-eabi",
121 "thumbv7em-none-eabihf",
122 "thumbv7m-none-eabi",
123 "thumbv8m.base-none-eabi",
124 "thumbv8m.main-none-eabi",
125 "thumbv8m.main-none-eabihf",
126 "wasm32-unknown-emscripten",
127 "wasm32-unknown-unknown",
129 "x86_64-apple-darwin",
131 "x86_64-fortanix-unknown-sgx",
133 "x86_64-linux-android",
134 "x86_64-pc-windows-gnu",
135 "x86_64-pc-windows-msvc",
136 "x86_64-rumprun-netbsd",
137 "x86_64-sun-solaris",
139 "x86_64-unknown-cloudabi",
140 "x86_64-unknown-freebsd",
141 "x86_64-unknown-illumos",
142 "x86_64-unknown-linux-gnu",
143 "x86_64-unknown-linux-gnux32",
144 "x86_64-unknown-linux-musl",
145 "x86_64-unknown-netbsd",
146 "x86_64-unknown-redox",
147 "x86_64-unknown-hermit",
150 static DOCS_TARGETS: &[&str] = &[
152 "i686-pc-windows-gnu",
153 "i686-pc-windows-msvc",
154 "i686-unknown-linux-gnu",
155 "x86_64-apple-darwin",
156 "x86_64-pc-windows-gnu",
157 "x86_64-pc-windows-msvc",
158 "x86_64-unknown-linux-gnu",
159 "x86_64-unknown-linux-musl",
162 static MINGW: &[&str] = &["i686-pc-windows-gnu", "x86_64-pc-windows-gnu"];
164 static NIGHTLY_ONLY_COMPONENTS: &[&str] = &["miri-preview", "rust-analyzer-preview"];
167 #[serde(rename_all = "kebab-case")]
169 manifest_version: String,
171 pkg: BTreeMap<String, Package>,
172 renames: BTreeMap<String, Rename>,
173 profiles: BTreeMap<String, Vec<String>>,
179 git_commit_hash: Option<String>,
180 target: BTreeMap<String, Target>,
188 #[derive(Serialize, Default)]
192 hash: Option<String>,
193 xz_url: Option<String>,
194 xz_hash: Option<String>,
195 components: Option<Vec<Component>>,
196 extensions: Option<Vec<Component>>,
200 fn unavailable() -> Self {
212 fn from_str(pkg: &str, target: &str) -> Self {
213 Self { pkg: pkg.to_string(), target: target.to_string() }
221 Err(e) => panic!("{} failed with {}", stringify!($e), e),
227 rust_release: String,
228 cargo_release: String,
230 rust_analyzer_release: String,
231 clippy_release: String,
232 rustfmt_release: String,
233 llvm_tools_release: String,
234 miri_release: String,
238 gpg_passphrase: String,
239 digests: BTreeMap<String, String>,
243 rust_version: Option<String>,
244 cargo_version: Option<String>,
245 rls_version: Option<String>,
246 rust_analyzer_version: Option<String>,
247 clippy_version: Option<String>,
248 rustfmt_version: Option<String>,
249 llvm_tools_version: Option<String>,
250 miri_version: Option<String>,
252 rust_git_commit_hash: Option<String>,
253 cargo_git_commit_hash: Option<String>,
254 rls_git_commit_hash: Option<String>,
255 rust_analyzer_git_commit_hash: Option<String>,
256 clippy_git_commit_hash: Option<String>,
257 rustfmt_git_commit_hash: Option<String>,
258 llvm_tools_git_commit_hash: Option<String>,
259 miri_git_commit_hash: Option<String>,
265 // Avoid signing packages while manually testing
266 // Do NOT set this envvar in CI
267 let should_sign = env::var("BUILD_MANIFEST_DISABLE_SIGNING").is_err();
269 // Safety check to ensure signing is always enabled on CI
270 // The CI environment variable is set by both Travis and AppVeyor
271 if !should_sign && env::var("CI").is_ok() {
272 println!("The 'BUILD_MANIFEST_DISABLE_SIGNING' env var can't be enabled on CI.");
273 println!("If you're not running this on CI, unset the 'CI' env var.");
277 let mut args = env::args().skip(1);
278 let input = PathBuf::from(args.next().unwrap());
279 let output = PathBuf::from(args.next().unwrap());
280 let date = args.next().unwrap();
281 let rust_release = args.next().unwrap();
282 let s3_address = args.next().unwrap();
283 let cargo_release = args.next().unwrap();
284 let rls_release = args.next().unwrap();
285 let rust_analyzer_release = args.next().unwrap();
286 let clippy_release = args.next().unwrap();
287 let miri_release = args.next().unwrap();
288 let rustfmt_release = args.next().unwrap();
289 let llvm_tools_release = args.next().unwrap();
291 // Do not ask for a passphrase while manually testing
292 let mut passphrase = String::new();
294 // `x.py` passes the passphrase via stdin.
295 t!(io::stdin().read_to_string(&mut passphrase));
302 rust_analyzer_release,
310 gpg_passphrase: passphrase,
311 digests: BTreeMap::new(),
318 rust_analyzer_version: None,
319 clippy_version: None,
320 rustfmt_version: None,
321 llvm_tools_version: None,
324 rust_git_commit_hash: None,
325 cargo_git_commit_hash: None,
326 rls_git_commit_hash: None,
327 rust_analyzer_git_commit_hash: None,
328 clippy_git_commit_hash: None,
329 rustfmt_git_commit_hash: None,
330 llvm_tools_git_commit_hash: None,
331 miri_git_commit_hash: None,
351 fn from_component(component: &str) -> Self {
354 "rust-src" => RustSrc,
356 "rls" | "rls-preview" => Rls,
357 "rust-analyzer" | "rust-analyzer-preview" => RustAnalyzer,
358 "clippy" | "clippy-preview" => Clippy,
359 "rustfmt" | "rustfmt-preview" => Rustfmt,
360 "llvm-tools" | "llvm-tools-preview" => LlvmTools,
361 "miri" | "miri-preview" => Miri,
368 fn build(&mut self) {
369 self.rust_version = self.version("rust", "x86_64-unknown-linux-gnu");
370 self.cargo_version = self.version("cargo", "x86_64-unknown-linux-gnu");
371 self.rls_version = self.version("rls", "x86_64-unknown-linux-gnu");
372 self.rust_analyzer_version = self.version("rust-analyzer", "x86_64-unknown-linux-gnu");
373 self.clippy_version = self.version("clippy", "x86_64-unknown-linux-gnu");
374 self.rustfmt_version = self.version("rustfmt", "x86_64-unknown-linux-gnu");
375 self.llvm_tools_version = self.version("llvm-tools", "x86_64-unknown-linux-gnu");
376 self.miri_version = self.version("miri", "x86_64-unknown-linux-gnu");
378 self.rust_git_commit_hash = self.git_commit_hash("rust", "x86_64-unknown-linux-gnu");
379 self.cargo_git_commit_hash = self.git_commit_hash("cargo", "x86_64-unknown-linux-gnu");
380 self.rls_git_commit_hash = self.git_commit_hash("rls", "x86_64-unknown-linux-gnu");
381 self.rust_analyzer_git_commit_hash =
382 self.git_commit_hash("rust-analyzer", "x86_64-unknown-linux-gnu");
383 self.clippy_git_commit_hash = self.git_commit_hash("clippy", "x86_64-unknown-linux-gnu");
384 self.rustfmt_git_commit_hash = self.git_commit_hash("rustfmt", "x86_64-unknown-linux-gnu");
385 self.llvm_tools_git_commit_hash =
386 self.git_commit_hash("llvm-tools", "x86_64-unknown-linux-gnu");
387 self.miri_git_commit_hash = self.git_commit_hash("miri", "x86_64-unknown-linux-gnu");
389 self.check_toolstate();
390 self.digest_and_sign();
391 let manifest = self.build_manifest();
392 self.write_channel_files(&self.rust_release, &manifest);
394 if self.rust_release != "beta" && self.rust_release != "nightly" {
395 self.write_channel_files("stable", &manifest);
399 /// If a tool does not pass its tests, don't ship it.
400 /// Right now, we do this only for Miri.
401 fn check_toolstate(&mut self) {
402 let toolstates: Option<HashMap<String, String>> =
403 File::open(self.input.join("toolstates-linux.json"))
405 .and_then(|f| serde_json::from_reader(&f).ok());
406 let toolstates = toolstates.unwrap_or_else(|| {
408 "WARNING: `toolstates-linux.json` missing/malformed; \
409 assuming all tools failed"
411 HashMap::default() // Use empty map if anything went wrong.
413 // Mark some tools as missing based on toolstate.
414 if toolstates.get("miri").map(|s| &*s as &str) != Some("test-pass") {
415 println!("Miri tests are not passing, removing component");
416 self.miri_version = None;
417 self.miri_git_commit_hash = None;
421 /// Hash all files, compute their signatures, and collect the hashes in `self.digests`.
422 fn digest_and_sign(&mut self) {
423 for file in t!(self.input.read_dir()).map(|e| t!(e).path()) {
424 let filename = file.file_name().unwrap().to_str().unwrap();
425 let digest = self.hash(&file);
427 assert!(self.digests.insert(filename.to_string(), digest).is_none());
431 fn build_manifest(&mut self) -> Manifest {
432 let mut manifest = Manifest {
433 manifest_version: "2".to_string(),
434 date: self.date.to_string(),
435 pkg: BTreeMap::new(),
436 renames: BTreeMap::new(),
437 profiles: BTreeMap::new(),
439 self.add_packages_to(&mut manifest);
440 self.add_profiles_to(&mut manifest);
441 self.add_renames_to(&mut manifest);
442 manifest.pkg.insert("rust".to_string(), self.rust_package(&manifest));
446 fn add_packages_to(&mut self, manifest: &mut Manifest) {
447 let mut package = |name, targets| self.package(name, &mut manifest.pkg, targets);
448 package("rustc", HOSTS);
449 package("rustc-dev", HOSTS);
450 package("cargo", HOSTS);
451 package("rust-mingw", MINGW);
452 package("rust-std", TARGETS);
453 package("rust-docs", DOCS_TARGETS);
454 package("rust-src", &["*"]);
455 package("rls-preview", HOSTS);
456 package("rust-analyzer-preview", HOSTS);
457 package("clippy-preview", HOSTS);
458 package("miri-preview", HOSTS);
459 package("rustfmt-preview", HOSTS);
460 package("rust-analysis", TARGETS);
461 package("llvm-tools-preview", TARGETS);
464 fn add_profiles_to(&mut self, manifest: &mut Manifest) {
465 let mut profile = |name, pkgs| self.profile(name, &mut manifest.profiles, pkgs);
466 profile("minimal", &["rustc", "cargo", "rust-std", "rust-mingw"]);
490 "rust-analyzer-preview",
492 "llvm-tools-preview",
498 // The compiler libraries are not stable for end users, and they're also huge, so we only
499 // `rustc-dev` for nightly users, and only in the "complete" profile. It's still possible
500 // for users to install the additional component manually, if needed.
501 if self.rust_release == "nightly" {
502 self.extend_profile("complete", &mut manifest.profiles, &["rustc-dev"]);
506 fn add_renames_to(&self, manifest: &mut Manifest) {
507 let mut rename = |from: &str, to: &str| {
508 manifest.renames.insert(from.to_owned(), Rename { to: to.to_owned() })
510 rename("rls", "rls-preview");
511 rename("rustfmt", "rustfmt-preview");
512 rename("clippy", "clippy-preview");
513 rename("miri", "miri-preview");
516 fn rust_package(&mut self, manifest: &Manifest) -> Package {
517 let mut pkg = Package {
519 .cached_version("rust")
521 .expect("Couldn't find Rust version")
523 git_commit_hash: self.cached_git_commit_hash("rust").clone(),
524 target: BTreeMap::new(),
527 if let Some(target) = self.target_host_combination(host, &manifest) {
528 pkg.target.insert(host.to_string(), target);
530 pkg.target.insert(host.to_string(), Target::unavailable());
537 fn target_host_combination(&mut self, host: &str, manifest: &Manifest) -> Option<Target> {
538 let filename = self.filename("rust", host);
539 let digest = self.digests.remove(&filename)?;
540 let xz_filename = filename.replace(".tar.gz", ".tar.xz");
541 let xz_digest = self.digests.remove(&xz_filename);
542 let mut components = Vec::new();
543 let mut extensions = Vec::new();
545 let host_component = |pkg| Component::from_str(pkg, host);
547 // rustc/rust-std/cargo/docs are all required,
548 // and so is rust-mingw if it's available for the target.
549 components.extend(vec![
550 host_component("rustc"),
551 host_component("rust-std"),
552 host_component("cargo"),
553 host_component("rust-docs"),
555 if host.contains("pc-windows-gnu") {
556 components.push(host_component("rust-mingw"));
559 // Tools are always present in the manifest,
560 // but might be marked as unavailable if they weren't built.
561 extensions.extend(vec![
562 host_component("clippy-preview"),
563 host_component("miri-preview"),
564 host_component("rls-preview"),
565 host_component("rust-analyzer-preview"),
566 host_component("rustfmt-preview"),
567 host_component("llvm-tools-preview"),
568 host_component("rust-analysis"),
574 .filter(|&&target| target != host)
575 .map(|target| Component::from_str("rust-std", target)),
577 extensions.extend(HOSTS.iter().map(|target| Component::from_str("rustc-dev", target)));
578 extensions.push(Component::from_str("rust-src", "*"));
580 // If the components/extensions don't actually exist for this
581 // particular host/target combination then nix it entirely from our
583 let has_component = |c: &Component| {
587 let pkg = match manifest.pkg.get(&c.pkg) {
589 None => return false,
591 pkg.target.get(&c.target).is_some()
593 extensions.retain(&has_component);
594 components.retain(&has_component);
598 url: Some(self.url(&filename)),
600 xz_url: xz_digest.as_ref().map(|_| self.url(&xz_filename)),
602 components: Some(components),
603 extensions: Some(extensions),
610 dst: &mut BTreeMap<String, Vec<String>>,
613 dst.insert(profile_name.to_owned(), pkgs.iter().map(|s| (*s).to_owned()).collect());
619 dst: &mut BTreeMap<String, Vec<String>>,
622 dst.get_mut(profile_name)
623 .expect("existing profile")
624 .extend(pkgs.iter().map(|s| (*s).to_owned()));
627 fn package(&mut self, pkgname: &str, dst: &mut BTreeMap<String, Package>, targets: &[&str]) {
628 let (version, mut is_present) = self
629 .cached_version(pkgname)
632 .map(|version| (version, true))
633 .unwrap_or_default(); // `is_present` defaults to `false` here.
635 // Never ship nightly-only components for other trains.
636 if self.rust_release != "nightly" && NIGHTLY_ONLY_COMPONENTS.contains(&pkgname) {
637 is_present = false; // Pretend the component is entirely missing.
640 let targets = targets
644 // The component generally exists, but it might still be missing for this target.
645 let filename = self.filename(pkgname, name);
646 let digest = match self.digests.remove(&filename) {
647 Some(digest) => digest,
648 // This component does not exist for this target -- skip it.
649 None => return (name.to_string(), Target::unavailable()),
651 let xz_filename = filename.replace(".tar.gz", ".tar.xz");
652 let xz_digest = self.digests.remove(&xz_filename);
658 url: Some(self.url(&filename)),
660 xz_url: xz_digest.as_ref().map(|_| self.url(&xz_filename)),
667 // If the component is not present for this build add it anyway but mark it as
668 // unavailable -- this way rustup won't allow upgrades without --force
669 (name.to_string(), Target::unavailable())
678 git_commit_hash: self.cached_git_commit_hash(pkgname).clone(),
684 fn url(&self, filename: &str) -> String {
685 format!("{}/{}/{}", self.s3_address, self.date, filename)
688 fn filename(&self, component: &str, target: &str) -> String {
690 match PkgType::from_component(component) {
691 RustSrc => format!("rust-src-{}.tar.gz", self.rust_release),
692 Cargo => format!("cargo-{}-{}.tar.gz", self.cargo_release, target),
693 Rls => format!("rls-{}-{}.tar.gz", self.rls_release, target),
695 format!("rust-analyzer-{}-{}.tar.gz", self.rust_analyzer_release, target)
697 Clippy => format!("clippy-{}-{}.tar.gz", self.clippy_release, target),
698 Rustfmt => format!("rustfmt-{}-{}.tar.gz", self.rustfmt_release, target),
699 LlvmTools => format!("llvm-tools-{}-{}.tar.gz", self.llvm_tools_release, target),
700 Miri => format!("miri-{}-{}.tar.gz", self.miri_release, target),
701 Other => format!("{}-{}-{}.tar.gz", component, self.rust_release, target),
705 fn cached_version(&self, component: &str) -> &Option<String> {
707 match PkgType::from_component(component) {
708 Cargo => &self.cargo_version,
709 Rls => &self.rls_version,
710 RustAnalyzer => &self.rust_analyzer_version,
711 Clippy => &self.clippy_version,
712 Rustfmt => &self.rustfmt_version,
713 LlvmTools => &self.llvm_tools_version,
714 Miri => &self.miri_version,
715 _ => &self.rust_version,
719 fn cached_git_commit_hash(&self, component: &str) -> &Option<String> {
721 match PkgType::from_component(component) {
722 Cargo => &self.cargo_git_commit_hash,
723 Rls => &self.rls_git_commit_hash,
724 RustAnalyzer => &self.rust_analyzer_git_commit_hash,
725 Clippy => &self.clippy_git_commit_hash,
726 Rustfmt => &self.rustfmt_git_commit_hash,
727 LlvmTools => &self.llvm_tools_git_commit_hash,
728 Miri => &self.miri_git_commit_hash,
729 _ => &self.rust_git_commit_hash,
733 fn version(&self, component: &str, target: &str) -> Option<String> {
734 self.untar(component, target, |filename| format!("{}/version", filename))
737 fn git_commit_hash(&self, component: &str, target: &str) -> Option<String> {
738 self.untar(component, target, |filename| format!("{}/git-commit-hash", filename))
741 fn untar<F>(&self, component: &str, target: &str, dir: F) -> Option<String>
743 F: FnOnce(String) -> String,
745 let mut cmd = Command::new("tar");
746 let filename = self.filename(component, target);
748 .arg(self.input.join(&filename))
749 .arg(dir(filename.replace(".tar.gz", "")))
751 let output = t!(cmd.output());
752 if output.status.success() {
753 Some(String::from_utf8_lossy(&output.stdout).trim().to_string())
759 fn hash(&self, path: &Path) -> String {
760 let sha = t!(Command::new("shasum")
763 .arg(path.file_name().unwrap())
764 .current_dir(path.parent().unwrap())
766 assert!(sha.status.success());
768 let filename = path.file_name().unwrap().to_str().unwrap();
769 let sha256 = self.output.join(format!("{}.sha256", filename));
770 t!(fs::write(&sha256, &sha.stdout));
772 let stdout = String::from_utf8_lossy(&sha.stdout);
773 stdout.split_whitespace().next().unwrap().to_string()
776 fn sign(&self, path: &Path) {
777 if !self.should_sign {
781 let filename = path.file_name().unwrap().to_str().unwrap();
782 let asc = self.output.join(format!("{}.asc", filename));
783 println!("signing: {:?}", path);
784 let mut cmd = Command::new("gpg");
785 cmd.arg("--pinentry-mode=loopback")
789 .arg("--passphrase-fd")
791 .arg("--personal-digest-preferences")
796 .arg("--detach-sign")
798 .stdin(Stdio::piped());
799 let mut child = t!(cmd.spawn());
800 t!(child.stdin.take().unwrap().write_all(self.gpg_passphrase.as_bytes()));
801 assert!(t!(child.wait()).success());
804 fn write_channel_files(&self, channel_name: &str, manifest: &Manifest) {
805 self.write(&toml::to_string(&manifest).unwrap(), channel_name, ".toml");
806 self.write(&manifest.date, channel_name, "-date.txt");
808 manifest.pkg["rust"].git_commit_hash.as_ref().unwrap(),
810 "-git-commit-hash.txt",
814 fn write(&self, contents: &str, channel_name: &str, suffix: &str) {
815 let dst = self.output.join(format!("channel-rust-{}{}", channel_name, suffix));
816 t!(fs::write(&dst, contents));