Skip to content

Commit 0f219a0

Browse files
authored
Rollup merge of rust-lang#39471 - djc:bootstrap-user, r=alexcrichton
Fix bootstrap.py issues with new rustbuild build system (fixes rust-lang#39469)
2 parents c06488b + 51e5cb5 commit 0f219a0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/bootstrap/bootstrap.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -438,14 +438,14 @@ def main():
438438
rb.use_vendored_sources = '\nvendor = true' in rb.config_toml or \
439439
'CFG_ENABLE_VENDOR' in rb.config_mk
440440

441-
if 'SUDO_USER' in os.environ:
442-
if os.environ['USER'] != os.environ['SUDO_USER']:
441+
if 'SUDO_USER' in os.environ and not rb.use_vendored_sources:
442+
if os.environ.get('USER') != os.environ['SUDO_USER']:
443443
rb.use_vendored_sources = True
444444
print('info: looks like you are running this command under `sudo`')
445445
print(' and so in order to preserve your $HOME this will now')
446446
print(' use vendored sources by default. Note that if this')
447447
print(' does not work you should run a normal build first')
448-
print(' before running a command like `sudo make intall`')
448+
print(' before running a command like `sudo make install`')
449449

450450
if rb.use_vendored_sources:
451451
if not os.path.exists('.cargo'):

0 commit comments

Comments
 (0)