Skip to content

cargo publish warns about tokens after doing a build #6877

@richardwhiuk

Description

@richardwhiuk

Problem

  • Running cargo publish without having run cargo login results in a complete clean build happening, after which it complains that the login token isn't present.

  • Once you've logged in, running publish again results in yet another clean build.

  • Cargo should abort immediately if you attempt to publish and aren't logged in

Steps

  1. cargo logout
  2. cargo publish
  3. Wait for build to finish
  4. Observe the error message:
    Finished dev [unoptimized + debuginfo] target(s) in 2m 25s
   Uploading swagger v3.0.0
error: no upload token found, please run `cargo login`

Possible Solution(s)

  • Check for a token before running the build

Notes

Output of cargo version: cargo 1.34.0 (6789d8a0a 2019-04-01)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions