Skip to content

Commit

Permalink
Rollup merge of rust-lang#39471 - djc:bootstrap-user, r=alexcrichton
Browse files Browse the repository at this point in the history
Fix bootstrap.py issues with new rustbuild build system (fixes rust-lang#39469)
  • Loading branch information
frewsxcv authored Feb 4, 2017
2 parents 660a2b2 + 51e5cb5 commit d0e569e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,14 +438,14 @@ def main():
rb.use_vendored_sources = '\nvendor = true' in rb.config_toml or \
'CFG_ENABLE_VENDOR' in rb.config_mk

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

if rb.use_vendored_sources:
if not os.path.exists('.cargo'):
Expand Down

0 comments on commit d0e569e

Please sign in to comment.