rust-lang / rust-lang/cargo

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

Open
#15,433 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-feature-request Command-package Command-publish S-triage
Dominant language
Rust
Stars
15.5k
Forks
3k
Avg merge
23h 30m
Merged PRs (30d)
51

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the cargo package and cargo publish verification flow described in the issue, then review the prior discussion in #15398. Define how a configuration setting would make package building optional while retaining metadata verification. Done means the behavior can be selected on demand without removing the existing verification step.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system, cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.