about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-12-18 19:09:17 +0000
committerbors <bors@rust-lang.org>2020-12-18 19:09:17 +0000
commitf74583445702e2e27ec4415376f2c540a83d7ded (patch)
treec14fcbc86a09f9d8a853eb873c3c3a0f65c3b75e /src/bootstrap
parente4297ba39ce07a0b0000841b50154ea53783a024 (diff)
parent74498c17e0d7ba29dd33e7765234ea75929b6aa7 (diff)
downloadrust-f74583445702e2e27ec4415376f2c540a83d7ded.tar.gz
rust-f74583445702e2e27ec4415376f2c540a83d7ded.zip
Auto merge of #80081 - ehuss:update-cargo, r=Mark-Simulacrum
Update cargo

4 commits in d274fcf862b89264fa2c6b917b15230705257317..a3c2627fbc2f5391c65ba45ab53b81bf71fa323c
2020-12-07 23:08:44 +0000 to 2020-12-14 17:21:26 +0000
- Check if rerun-if-changed points to a directory. (rust-lang/cargo#8973)
- Implement external credential process. (RFC 2730) (rust-lang/cargo#8934)
- Revert recent build-std vendoring changes (rust-lang/cargo#8968)
- Fix the unit dependency graph with dev-dependency `links` (rust-lang/cargo#8969)
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/dist.rs6
-rw-r--r--src/bootstrap/tool.rs37
2 files changed, 41 insertions, 2 deletions
diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs
index 8ccb9dbdf01..9ebf76dceef 100644
--- a/src/bootstrap/dist.rs
+++ b/src/bootstrap/dist.rs
@@ -1228,6 +1228,12 @@ impl Step for Cargo {
         builder.create_dir(&image.join("etc/bash_completion.d"));
         let cargo = builder.ensure(tool::Cargo { compiler, target });
         builder.install(&cargo, &image.join("bin"), 0o755);
+        for dirent in fs::read_dir(cargo.parent().unwrap()).expect("read_dir") {
+            let dirent = dirent.expect("read dir entry");
+            if dirent.file_name().to_str().expect("utf8").starts_with("cargo-credential-") {
+                builder.install(&dirent.path(), &image.join("libexec"), 0o755);
+            }
+        }
         for man in t!(etc.join("man").read_dir()) {
             let man = t!(man);
             builder.install(&man.path(), &image.join("share/man/man1"), 0o644);
diff --git a/src/bootstrap/tool.rs b/src/bootstrap/tool.rs
index 290e3744852..dc786249d99 100644
--- a/src/bootstrap/tool.rs
+++ b/src/bootstrap/tool.rs
@@ -563,7 +563,7 @@ impl Step for Cargo {
     }
 
     fn run(self, builder: &Builder<'_>) -> PathBuf {
-        builder
+        let cargo_bin_path = builder
             .ensure(ToolBuild {
                 compiler: self.compiler,
                 target: self.target,
@@ -574,7 +574,40 @@ impl Step for Cargo {
                 source_type: SourceType::Submodule,
                 extra_features: Vec::new(),
             })
-            .expect("expected to build -- essential tool")
+            .expect("expected to build -- essential tool");
+
+        let build_cred = |name, path| {
+            // These credential helpers are currently experimental.
+            // Any build failures will be ignored.
+            let _ = builder.ensure(ToolBuild {
+                compiler: self.compiler,
+                target: self.target,
+                tool: name,
+                mode: Mode::ToolRustc,
+                path,
+                is_optional_tool: true,
+                source_type: SourceType::Submodule,
+                extra_features: Vec::new(),
+            });
+        };
+
+        if self.target.contains("windows") {
+            build_cred(
+                "cargo-credential-wincred",
+                "src/tools/cargo/crates/credential/cargo-credential-wincred",
+            );
+        }
+        if self.target.contains("apple-darwin") {
+            build_cred(
+                "cargo-credential-macos-keychain",
+                "src/tools/cargo/crates/credential/cargo-credential-macos-keychain",
+            );
+        }
+        build_cred(
+            "cargo-credential-1password",
+            "src/tools/cargo/crates/credential/cargo-credential-1password",
+        );
+        cargo_bin_path
     }
 }