about summary refs log tree commit diff
path: root/src/tools
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-06-25 17:22:12 +0000
committerbors <bors@rust-lang.org>2018-06-25 17:22:12 +0000
commitb7c6e8f1805cd8a4b0a1c1f22f17a89e9e2cea23 (patch)
tree900d5440d16c5ad7a996e07958fcefcf0113dc14 /src/tools
parent8acec1f9d0b40dde142e6c26d7358b9ab232d2b4 (diff)
parentf10da5fdb9f08a70d2917aadf51c1e7952b9027b (diff)
downloadrust-b7c6e8f1805cd8a4b0a1c1f22f17a89e9e2cea23.tar.gz
rust-b7c6e8f1805cd8a4b0a1c1f22f17a89e9e2cea23.zip
Auto merge of #51728 - bradjc:llvm-tools2, r=kennytm
build: add llvm-tools to manifest

This commit expands on a previous commit to build llvm-tools as a rustup component. It causes the llvm-tools component to be built if the extended step is active. It also adds llvm-tools to the build manifest so rustup can find it.

I tested this as far as I could, but had to hack `build-manifest/src/main.rs` a bit as it is not supported on MacOS. The main change I am not sure about is this line:

```rust
self.package("llvm-tools", &mut manifest.pkg, TARGETS);
```

There are numerous calls to `self.package()`, and I'm not sure if `TARGETS`, `HOSTS`, or `["*"]` is appropriate for llvm-tools.

Otherwise I mostly copied the example set by `rustfmt-preview`.
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/build-manifest/src/main.rs25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/tools/build-manifest/src/main.rs b/src/tools/build-manifest/src/main.rs
index db30e649a7e..35fc2182313 100644
--- a/src/tools/build-manifest/src/main.rs
+++ b/src/tools/build-manifest/src/main.rs
@@ -184,6 +184,7 @@ struct Builder {
     cargo_release: String,
     rls_release: String,
     rustfmt_release: String,
+    llvm_tools_release: String,
 
     input: PathBuf,
     output: PathBuf,
@@ -196,11 +197,13 @@ struct Builder {
     cargo_version: Option<String>,
     rls_version: Option<String>,
     rustfmt_version: Option<String>,
+    llvm_tools_version: Option<String>,
 
     rust_git_commit_hash: Option<String>,
     cargo_git_commit_hash: Option<String>,
     rls_git_commit_hash: Option<String>,
     rustfmt_git_commit_hash: Option<String>,
+    llvm_tools_git_commit_hash: Option<String>,
 }
 
 fn main() {
@@ -212,7 +215,7 @@ fn main() {
     let cargo_release = args.next().unwrap();
     let rls_release = args.next().unwrap();
     let rustfmt_release = args.next().unwrap();
-    let _llvm_tools_vers = args.next().unwrap(); // FIXME do something with it?
+    let llvm_tools_release = args.next().unwrap();
     let s3_address = args.next().unwrap();
     let mut passphrase = String::new();
     t!(io::stdin().read_to_string(&mut passphrase));
@@ -222,6 +225,7 @@ fn main() {
         cargo_release,
         rls_release,
         rustfmt_release,
+        llvm_tools_release,
 
         input,
         output,
@@ -234,11 +238,13 @@ fn main() {
         cargo_version: None,
         rls_version: None,
         rustfmt_version: None,
+        llvm_tools_version: None,
 
         rust_git_commit_hash: None,
         cargo_git_commit_hash: None,
         rls_git_commit_hash: None,
         rustfmt_git_commit_hash: None,
+        llvm_tools_git_commit_hash: None,
     }.build();
 }
 
@@ -248,11 +254,14 @@ impl Builder {
         self.cargo_version = self.version("cargo", "x86_64-unknown-linux-gnu");
         self.rls_version = self.version("rls", "x86_64-unknown-linux-gnu");
         self.rustfmt_version = self.version("rustfmt", "x86_64-unknown-linux-gnu");
+        self.llvm_tools_version = self.version("llvm-tools", "x86_64-unknown-linux-gnu");
 
         self.rust_git_commit_hash = self.git_commit_hash("rust", "x86_64-unknown-linux-gnu");
         self.cargo_git_commit_hash = self.git_commit_hash("cargo", "x86_64-unknown-linux-gnu");
         self.rls_git_commit_hash = self.git_commit_hash("rls", "x86_64-unknown-linux-gnu");
         self.rustfmt_git_commit_hash = self.git_commit_hash("rustfmt", "x86_64-unknown-linux-gnu");
+        self.llvm_tools_git_commit_hash = self.git_commit_hash("llvm-tools",
+                                                               "x86_64-unknown-linux-gnu");
 
         self.digest_and_sign();
         let manifest = self.build_manifest();
@@ -289,9 +298,11 @@ impl Builder {
         self.package("rls-preview", &mut manifest.pkg, HOSTS);
         self.package("rustfmt-preview", &mut manifest.pkg, HOSTS);
         self.package("rust-analysis", &mut manifest.pkg, TARGETS);
+        self.package("llvm-tools", &mut manifest.pkg, TARGETS);
 
         let rls_present = manifest.pkg.contains_key("rls-preview");
         let rustfmt_present = manifest.pkg.contains_key("rustfmt-preview");
+        let llvm_tools_present = manifest.pkg.contains_key("llvm-tools");
 
         if rls_present {
             manifest.renames.insert("rls".to_owned(), Rename { to: "rls-preview".to_owned() });
@@ -346,6 +357,12 @@ impl Builder {
                     target: host.to_string(),
                 });
             }
+            if llvm_tools_present {
+                extensions.push(Component {
+                    pkg: "llvm-tools".to_string(),
+                    target: host.to_string(),
+                });
+            }
             extensions.push(Component {
                 pkg: "rust-analysis".to_string(),
                 target: host.to_string(),
@@ -455,6 +472,8 @@ impl Builder {
             format!("rls-{}-{}.tar.gz", self.rls_release, target)
         } else if component == "rustfmt" || component == "rustfmt-preview" {
             format!("rustfmt-{}-{}.tar.gz", self.rustfmt_release, target)
+        } else if component == "llvm_tools" {
+            format!("llvm-tools-{}-{}.tar.gz", self.llvm_tools_release, target)
         } else {
             format!("{}-{}-{}.tar.gz", component, self.rust_release, target)
         }
@@ -467,6 +486,8 @@ impl Builder {
             &self.rls_version
         } else if component == "rustfmt" || component == "rustfmt-preview" {
             &self.rustfmt_version
+        } else if component == "llvm-tools" {
+            &self.llvm_tools_version
         } else {
             &self.rust_version
         }
@@ -479,6 +500,8 @@ impl Builder {
             &self.rls_git_commit_hash
         } else if component == "rustfmt" || component == "rustfmt-preview" {
             &self.rustfmt_git_commit_hash
+        } else if component == "llvm-tools" {
+            &self.llvm_tools_git_commit_hash
         } else {
             &self.rust_git_commit_hash
         }