Skip to content

change "/dev/tty does not exist" to something more helpful #648

@ketralnis

Description

@ketralnis

Rustup simply dies with the error message "/dev/tty does not exist" when a TTY isn't available. This is particularly troublesome when its run as part of e.g. a cron job, CI system, or vagrant script.

It dies with a particularly unhelpful message:

info: downloading installer
./rustup.sh: 79: ./rustup.sh:
cannot open /dev/tty: No such device or address

Looking at the script, that corresponds to:

# The installer is going to want to ask for confirmation by
# reading stdin.  This script was piped into `sh` though and
# doesn't have stdin to pass to its children. Instead we're going
# to explicitly connect /dev/tty to the installer's stdin.
if [ ! -e "/dev/tty" ]; then
    err "/dev/tty does not exist"
fi

There's no way to know what's wrong or how to fix it without actually reading the script. AFAICT there's no way to proceed without a TTY other than accepting the defaults since no other options are accepted or env variables checked. So that error message could read something like:

err "/dev/tty not available, prompts unavailable. Run with '-y' to accept defaults"

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions