Skip to content

Ability to verify my cargo workspace before packaging but without building. #15433

Open
@eirnym

Description

@eirnym

Problem

Currently packaging verification process run by cargo package and cargo publish runs 2 tasks:

  1. Metadata verification.
  2. Build a package

First task is just cargo build, the second may emit warnings about some metadata is missing

Good practice on CI is to run sequentially or in parallel

  1. Run fast metadata verification, as this process will take short time and it's important. No build required.
  2. Build project and run all checks to verify if even some wrong commit was merged, release would be clean

The metadata verification is done by cargo package and if critical field is missing, a warning is emitted. There's no control on which metadata is critical, which is not and there's no way to enforce it.

Additionally, building a package in most cases is a duplication of responsibility of a user to run at least cargo build first.

I understand historical reasons of this solution in cargo package, and I'd like to have an ability to alter this behaviour on demand/company policies, but not remove this step completely

Previous discussion was here: #15398

Proposed Solution

For making build optional I'd like to have configuration variable to be set to control behaviour of cargo verification process.

Notes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Command-packageCommand-publishS-triageStatus: This issue is waiting on initial triage.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions