Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing 1.15.0 from source fails in bootstrap.py #39469

Closed
djc opened this issue Feb 2, 2017 · 5 comments
Closed

Installing 1.15.0 from source fails in bootstrap.py #39469

djc opened this issue Feb 2, 2017 · 5 comments

Comments

@djc
Copy link
Contributor

djc commented Feb 2, 2017

While updating the Gentoo package for rust to 1.15.0, I get this error:

Traceback (most recent call last):
  File "/var/tmp/portage/dev-lang/rust-1.15.0/work/rustc-1.15.0-src/src/bootstrap/bootstrap.py", line 491, in <module>
    main()
  File "/var/tmp/portage/dev-lang/rust-1.15.0/work/rustc-1.15.0-src/src/bootstrap/bootstrap.py", line 440, in main
    if os.environ['USER'] != os.environ['SUDO_USER']:
  File "/usr/lib64/python2.7/UserDict.py", line 40, in __getitem__
    raise KeyError(key)
KeyError: 'USER'

This appears to have been introduced as part of 0e272de, the commit that switched to rustbuild by default. I don't really get what the USER != SUDO_USER heuristic is intended to protect against, but it looks a bit fishy to me. For one thing, from this failure it would seem that it has not seen testing in very diverse environments, so using .get('USER') and .get('SUDO_USER') would probably make a lot more sense here. Second, while the goal appears to be to set enable_vendored_sources in some situations, this code is still executed when enable_vendored_sources is already set. Finally, there is a typo in the help text that is printed for this case ('intall').

@durka
Copy link
Contributor

durka commented Feb 2, 2017

Strange, Gentoo doesn't have $USER or names it something else?

@alexcrichton
Copy link
Member

This was originally intended to detect sudo make install and warn you that you should do make first then sudo make install. There's no need for us to require these env vars, though, so a patch to use .get should work just fie!

@djc
Copy link
Contributor Author

djc commented Feb 2, 2017

@durka I think it has it, but it's probably not available in the constrained environment set up by the package manager.

frewsxcv added a commit to frewsxcv/rust that referenced this issue Feb 4, 2017
Fix bootstrap.py issues with new rustbuild build system (fixes rust-lang#39469)
frewsxcv added a commit to frewsxcv/rust that referenced this issue Feb 4, 2017
Fix bootstrap.py issues with new rustbuild build system (fixes rust-lang#39469)
frewsxcv added a commit to frewsxcv/rust that referenced this issue Feb 5, 2017
Fix bootstrap.py issues with new rustbuild build system (fixes rust-lang#39469)
@bors bors closed this as completed in e7f6c36 Feb 5, 2017
@djc
Copy link
Contributor Author

djc commented Feb 17, 2017

Would it make sense to uplift this to 1.16.0? If so, how do I go about nominating it?

@alexcrichton
Copy link
Member

@djc sure yeah, I've nominated #39471 for a backport (tag)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants