summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-09-19 14:06:23 +0000
committerbors <bors@rust-lang.org>2022-09-19 14:06:23 +0000
commita55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52 (patch)
tree2de5a3c571f7f5b54f4922b644f72f33786eb0e0 /src/bootstrap
parentb31188e88b245f48b364c6cb186b821bd472bd8a (diff)
parent7358a9b03e5d22ea4d74d89cb00d3985fc89c773 (diff)
downloadrust-1.64.0.tar.gz
rust-1.64.0.zip
Auto merge of #102018 - pietroalbini:pa-1.64.0, r=pietroalbini 1.64.0
[stable] Prepare 1.64.0 release

This PR prepares the 1.64.0 stable release builds.

In addition to bumping the channel and including the latest release notes changes, this PR also backports the following PRs:

*  #100852
*  #101366
*  #101468
*  #101922

This PR also reverts the following PRs, as decided in https://github.com/rust-lang/rust/issues/101899#issuecomment-1250996783:

* https://github.com/rust-lang/rust/pull/95295
* https://github.com/rust-lang/rust/pull/99136 (followup to the previous PR)

r? `@ghost`
cc `@rust-lang/release`
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/bootstrap.py2
-rw-r--r--src/bootstrap/lib.rs13
2 files changed, 11 insertions, 4 deletions
diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py
index 9301c5a2ff3..03eec02a8bf 100644
--- a/src/bootstrap/bootstrap.py
+++ b/src/bootstrap/bootstrap.py
@@ -793,6 +793,8 @@ class RustBuild(object):
 
     def check_vendored_status(self):
         """Check that vendoring is configured properly"""
+        # keep this consistent with the equivalent check in rustbuild:
+        # https://github.com/rust-lang/rust/blob/a8a33cf27166d3eabaffc58ed3799e054af3b0c6/src/bootstrap/lib.rs#L399-L405
         if 'SUDO_USER' in os.environ and not self.use_vendored_sources:
             if os.getuid() == 0:
                 self.use_vendored_sources = True
diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs
index f84de73297a..d265277b406 100644
--- a/src/bootstrap/lib.rs
+++ b/src/bootstrap/lib.rs
@@ -396,13 +396,18 @@ impl Build {
         let src = config.src.clone();
         let out = config.out.clone();
 
+        #[cfg(unix)]
+        // keep this consistent with the equivalent check in x.py:
+        // https://github.com/rust-lang/rust/blob/a8a33cf27166d3eabaffc58ed3799e054af3b0c6/src/bootstrap/bootstrap.py#L796-L797
         let is_sudo = match env::var_os("SUDO_USER") {
-            Some(sudo_user) => match env::var_os("USER") {
-                Some(user) => user != sudo_user,
-                None => false,
-            },
+            Some(_sudo_user) => {
+                let uid = unsafe { libc::getuid() };
+                uid == 0
+            }
             None => false,
         };
+        #[cfg(not(unix))]
+        let is_sudo = false;
 
         let ignore_git = config.ignore_git;
         let rust_info = channel::GitInfo::new(ignore_git, &src);