Skip to content

Installing 1.15.0 from source fails in bootstrap.py #39469

Closed
@djc

Description

@djc

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').

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions