Skip to content

fix: revert the behavior checking lockfile's VCS status #15341

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 25, 2025

Conversation

weihanglo
Copy link
Member

@weihanglo weihanglo commented Mar 21, 2025

What does this PR try to resolve?

Fixes #15339

Lockfile might be gitignore'd,
So it never shows up in git status.

However, cargo packag vcs checks actually performs git status --untracked --ignored.
It is a bit confusing that lockfile is ignored but still counts as dirty from the report of cargo package.

There are some more nuances:
We check lockfile's VCS status if the lockfile is ouside the current package root. That means a non-workspace Cargo package will not have this VCS check. I don't think it is good that we have diverged behaviors Hence this revert.

We can always re-evaluate later,
as we've reserved rooms for doing more dirty checks.

#14967 (comment)

How should we test and review this PR?

See if the revert is what we want now.
Or we should do a more thorough check for both workspace and non-workspace cases.

Additional information

This is a revert of f0907fc from #15276

@rustbot
Copy link
Collaborator

rustbot commented Mar 21, 2025

r? @epage

rustbot has assigned @epage.
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

@rustbot rustbot added A-git Area: anything dealing with git Command-package S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 21, 2025
Copy link
Contributor

Choose a reason for hiding this comment

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

Note that f0907fc has a comment change that was not reverted in this commit

@epage
Copy link
Contributor

epage commented Mar 24, 2025

Feel free to merge when CI is green

Lockfile might be gitignore'd,
So it never shows up in `git status`.

However, `cargo packag` vcs checks actually performs
`git status --untracked --ignored`.
It is a bit confusing that lockfile is ignored but still counts as dirty
from the report of `cargo package`.

There are some more nuances:
We check lockfile's VCS status if the lockfile is ouside the current
package root. That means a non-workspace Cargo package will not have
this VCS check. I don't think it is good that we have diverged behaviors
Hence this revert.

We can always re-evaluate later,
as we've reserved rooms for doing more dirty checks.

rust-lang#14967 (comment)
@epage epage enabled auto-merge March 25, 2025 17:31
@epage epage added this pull request to the merge queue Mar 25, 2025
Merged via the queue into rust-lang:master with commit 6890735 Mar 25, 2025
21 checks passed
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 27, 2025
Update cargo

10 commits in 307cbfda3119f06600e43cd38283f4a746fe1f8b..a6c604d1b8a2f2a8ff1f3ba6092f9fda42f4b7e9
2025-03-20 20:00:39 +0000 to 2025-03-26 18:11:00 +0000
- fix(package): update tracking issue for `--message-format` (rust-lang/cargo#15354)
- docs(contrib): Expand the description of team meetings (rust-lang/cargo#15349)
- feat(package): add unstable `--message-format` flag  (rust-lang/cargo#15311)
- feat(complete): Added completion for `--profile` (rust-lang/cargo#15308)
- Uplift windows Cygwin DLL import libraries (rust-lang/cargo#15193)
- do not pass cdylib link args to test (rust-lang/cargo#15317)
- fix: revert the behavior checking lockfile's VCS status (rust-lang/cargo#15341)
- Temporarily ignore cargo_test_doctest_xcompile_ignores (rust-lang/cargo#15348)
- docs: fix typo in the "Shared cache" section (rust-lang/cargo#15346)
- Fix some issues with future-incompat report generation (rust-lang/cargo#15345)

r? ghost
@rustbot rustbot added this to the 1.87.0 milestone Mar 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-git Area: anything dealing with git Command-package S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dirty Cargo.lock file reported on package/publish even if in .gitignore
3 participants