Include vcs_info even if workspace is dirty by torhovland · Pull Request #13960 · rust-lang/cargo (original) (raw)

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

torhovland

What does this PR try to resolve?

Related to #13695.

Generates and packages the .cargo_vcs_info.json file even if the worktree is dirty, as long as --allow-dirty is passed.

Also added a dirty field to the file to record if the Git repository status is dirty.

Tests are included.

@rustbot

r? @ehuss

rustbot has assigned @ehuss.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

weihanglo

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution. Could you adjust the commit order a bit?

The first commit adding a new test (issue_13695_dirty_vcs_info) to show the old behavior, and should pass the CI pipeline. The next commits fix both the behavior and test assertions.

@weihanglo

@weihanglo

@rfcbot fcp merge

With this change, the .cargo_vcs_info.json will always be generated regardless the dirty status of the VCS.

One risk is that people may already rely on the existence of vcs info file to determine if the repository is dirty. That's actually documented in the cargo-package manpage. However, a package without .cargo_vcs_info.json only implies that it was packaged with --allow-dirty passed, but not the repository was actually dirty at that time. Hence I think the risk should be low, and this patch makes it more accurate.


@rfcbot concern doc-update

Since we are going to include VCS info file unconditionally if in a Git repository, this might give people a false impression that Cargo handles package publish provenance against the linked repository. We may want to explicitly call out that Cargo hasn't yet provided the feature in the manpage, as people can fake the file. We should update the doc of the JSON format as well, and add a line saying that new fields may be added in the future and not considered as breaking changes.

@rfcbot

epage

@weihanglo

@torhovland I've posted #13984 to address the concern. If that is merged, would you mind adjusting the doc here and adding a line about the new dirty field below this line?

@weihanglo

@torhovland

weihanglo

@Turbo87

One risk is that people may already rely on the existence of vcs info file to determine if the repository is dirty.

FYI crates.io is parsing this file these days. might be good to at least ping the crates.io team on semantic changes like this 😉

@weihanglo

Thanks for letting us know, @Turbo87!

Does this change make sense to crates.io?

@Turbo87

Does this change make sense to crates.io?

yeah, should be fine now that we know about it and can treat the new field correctly :)

@epage

FYI crates.io is parsing this file these days. might be good to at least ping the crates.io team on semantic changes like this 😉

When I saw Adam's blogpost, I informed him of this. That wasn't yet "crates.io is parsing" though. Was the use of this previously communicated in some other way so we would know to tell crates.io?

@rfcbot

🔔 This is now entering its final comment period, as per the review above. 🔔

@torhovland

weihanglo

@weihanglo

@bors

📌 Commit e7bfed1 has been approved by weihanglo

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

and removed S-waiting-on-author

Status: The marked PR is awaiting some action (such as code changes) from the PR author.

labels

Jun 24, 2024

@bors

@bors

@bors bors mentioned this pull request

Jun 24, 2024

bors added a commit to rust-lang-ci/rust that referenced this pull request

Jun 25, 2024

@bors

bors added a commit to rust-lang-ci/rust that referenced this pull request

Jun 25, 2024

@bors

bors added a commit to rust-lang-ci/rust that referenced this pull request

Jun 25, 2024

@bors

bors added a commit to rust-lang-ci/rust that referenced this pull request

Jun 26, 2024

@bors

flip1995 pushed a commit to flip1995/rust-clippy that referenced this pull request

Jun 28, 2024

@bors

tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request

Sep 11, 2024

@tmeijn

This MR contains the following updates:

Package Update Change
rust minor 1.80.1 -> 1.81.0

MR created with the help of el-capitano/tools/renovate-bot.

Proposed changes to behavior should be submitted there as MRs.


Release Notes

rust-lang/rust (rust)

v1.81.0

Compare Source

==========================

Language

Compiler

Libraries

Stabilized APIs

These APIs are now stable in const contexts:

Cargo

Compatibility Notes

Internal Changes

These changes do not affect any public interfaces of Rust, but they represent significant improvements to the performance or internals of rustc and related tools.


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this MR and you won't be reminded about this update again.



This MR has been generated by Renovate Bot.

wip-sync pushed a commit to NetBSD/pkgsrc-wip that referenced this pull request

Sep 22, 2024

@he32

Pkgsrc changes:

Upstream changes:

Version 1.81.0 (2024-09-05)

Language

Compiler

Libraries

Stabilized APIs

These APIs are now stable in const contexts:

Cargo

Compatibility Notes

Internal Changes

These changes do not affect any public interfaces of Rust, but they represent significant improvements to the performance or internals of rustc and related tools.

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request

Nov 24, 2024

@he32

Pkgsrc changes:

Upstream changes:

Version 1.81.0 (2024-09-05)

Language

Compiler

Libraries

Stabilized APIs

These APIs are now stable in const contexts:

Cargo

Compatibility Notes

Internal Changes

These changes do not affect any public interfaces of Rust, but they represent significant improvements to the performance or internals of rustc and related tools.

@epage epage mentioned this pull request

Dec 10, 2024

This was referenced

Dec 18, 2024