-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
C-bugCategory: bugCategory: bugCommand-loginP-highPriority: HighPriority: HighS-acceptedStatus: Issue or feature is accepted, and has a team member available to help mentor or reviewStatus: Issue or feature is accepted, and has a team member available to help mentor or reviewregression-from-stable-to-nightlyRegression in nightly that previously worked in stable.Regression in nightly that previously worked in stable.
Description
Problem
Specifying the logon token via the command-line will cause a hang if stdin
is not attached to a terminal (such as when running in automation).
Steps
cargo login --registry xxxxxxxx "Bearer XXXXXXXXXXXXXXXXXXXXXXXXX"
Possible Solution(s)
Workaround:
"Bearer XXXXXXXXXXXXXXXXXXXXXXXXX" | cargo login --registry xxxxxxxx
Notes
Likely introduced by #12334:
cargo/src/cargo/ops/registry/login.rs
Lines 38 to 44 in 263d24b
if !std::io::stdin().is_terminal() { | |
let token = std::io::read_to_string(std::io::stdin()).unwrap_or_default(); | |
if !token.is_empty() { | |
token_from_stdin = Some(token); | |
} | |
} | |
let token = token_from_cmdline.or_else(|| token_from_stdin.as_deref().map(Secret::from)); |
Version
cargo 1.73.0-nightly (c91a693e7 2023-07-31)
release: 1.73.0-nightly
commit-hash: c91a693e7977e33a1064b63a5daf5fb689f01651
commit-date: 2023-07-31
host: x86_64-unknown-linux-gnu
libgit2: 1.6.4 (sys:0.17.2 vendored)
libcurl: 8.2.1-DEV (sys:0.4.65+curl-8.2.1 vendored ssl:OpenSSL/1.1.1u)
ssl: OpenSSL 1.1.1u 30 May 2023
os: Ubuntu 20.04 (focal) [64-bit]
Metadata
Metadata
Assignees
Labels
C-bugCategory: bugCategory: bugCommand-loginP-highPriority: HighPriority: HighS-acceptedStatus: Issue or feature is accepted, and has a team member available to help mentor or reviewStatus: Issue or feature is accepted, and has a team member available to help mentor or reviewregression-from-stable-to-nightlyRegression in nightly that previously worked in stable.Regression in nightly that previously worked in stable.