diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index 00dc7da275a43..52eaee8e9280c 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -1172,9 +1172,9 @@ def check_vendored_status(self): """Check that vendoring is configured properly""" vendor_dir = os.path.join(self.rust_root, 'vendor') if 'SUDO_USER' in os.environ and not self.use_vendored_sources: - if os.environ.get('USER') != os.environ['SUDO_USER']: + if os.getuid() == 0: self.use_vendored_sources = True - print('info: looks like you are running this command under `sudo`') + print('info: looks like you\'re trying to run this command as root') print(' and so in order to preserve your $HOME this will now') print(' use vendored sources by default.') if not os.path.exists(vendor_dir):