-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
fix 13773 - 'cargo build' fails when list_files() with gix is triggered #13777
Conversation
r? @weihanglo rustbot has assigned @weihanglo. Use |
4741df6
to
5cfd783
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix! Always amazed how quick you respond to an issue :)
Would you like to follow the pattern as #13770 that first commit a test showing the problematic behavior, and the following commit fixes both test and bug? I am fine with it if you don't have time.
Also, I am too dumb to understand the change in git-dir. Not a blocker but would love to learn more:
assure worktree-roots aren't pruned with pathspecs that are never meant for them.
Previously, when pathspecs were defined, the classification of the worktree-root
would also be using them. This means that depending on the pathspec, worktree-roots would
be pruned, which in turn makes it impossible to recurse into them.Now pathspecs are disabled when classifying the worktree-root directory.
What are worktree-roots, and what does classification of worktree-root do?
Thanks :)!
Actually I think I did. The first commit 07d2bd7 adds a test and fails exactly like it should, the second commit includes the fix. Is there anything I am missing?
The worktree root is basically invisible, or Now that I write this, the question really is if empty paths should ever be excluded by pathspecs, and if the pathspec-check makes a mistake. Right now it's fixed by having an empty pathspec check the empty path, which indeed considers it to be included. In fact that should also work for any other pathspec (I suppose). Something to look into again, maybe the bug is fixed in the wrong location, and the trick would be to simply always incude the empty path. |
This improvement was triggered by [this question](rust-lang/cargo#13777 (review)).
This improvement was triggered by [this question](rust-lang/cargo#13777 (review)).
Thanks so much for asking that question :) - it made me think again, less rushed this time. After revisiting this I realized that the underlying problem was indeed related to handling empty input paths with pathspecs. These, I think I have fixed and tested there now, while having cleaned up An immediate change to what's released isn't necessary, I think, so these improvements will come in with the next natural release in a month or so. Thanks again! |
Yes, you did it pretty good. For myself, I also match the failure output in the test in the first commit, so the next commit we shows both fix and test change. Should we wait for GitoxideLabs/gitoxide@5dea6f1 and update to the new version? |
Ok okay I missed this:
Let's merge this. Thanks! @bors r+ |
☀️ Test successful - checks-actions |
Update cargo 8 commits in 6f06fe908a5ee0f415c187f868ea627e82efe07d..80d5b607dde6ef97dfff4e23923822c01d2bb036 2024-04-16 18:47:44 +0000 to 2024-04-19 18:39:22 +0000 - fix 13773 - 'cargo build' fails when list_files() with gix is triggered (rust-lang/cargo#13777) - fix(toml): Don't crash on parse errors that point to multi-byte character (rust-lang/cargo#13780) - fix(toml)!: Disallow source-less dependencies (rust-lang/cargo#13775) - fix(msrv): Put MSRV-aware resolver behind a config (rust-lang/cargo#13769) - fix(msrv): Error, rather than panic, on rust-version 'x' (rust-lang/cargo#13771) - fix(credential): trim newlines in tokens from stdin (rust-lang/cargo#13770) - test(msrv): Re-organize MSRV tests (rust-lang/cargo#13767) - feat(install): Including Locking message (rust-lang/cargo#13764) r? ghost
Update cargo 8 commits in 6f06fe908a5ee0f415c187f868ea627e82efe07d..80d5b607dde6ef97dfff4e23923822c01d2bb036 2024-04-16 18:47:44 +0000 to 2024-04-19 18:39:22 +0000 - fix 13773 - 'cargo build' fails when list_files() with gix is triggered (rust-lang/cargo#13777) - fix(toml): Don't crash on parse errors that point to multi-byte character (rust-lang/cargo#13780) - fix(toml)!: Disallow source-less dependencies (rust-lang/cargo#13775) - fix(msrv): Put MSRV-aware resolver behind a config (rust-lang/cargo#13769) - fix(msrv): Error, rather than panic, on rust-version 'x' (rust-lang/cargo#13771) - fix(credential): trim newlines in tokens from stdin (rust-lang/cargo#13770) - test(msrv): Re-organize MSRV tests (rust-lang/cargo#13767) - feat(install): Including Locking message (rust-lang/cargo#13764) r? ghost
Update cargo 8 commits in 6f06fe908a5ee0f415c187f868ea627e82efe07d..80d5b607dde6ef97dfff4e23923822c01d2bb036 2024-04-16 18:47:44 +0000 to 2024-04-19 18:39:22 +0000 - fix 13773 - 'cargo build' fails when list_files() with gix is triggered (rust-lang/cargo#13777) - fix(toml): Don't crash on parse errors that point to multi-byte character (rust-lang/cargo#13780) - fix(toml)!: Disallow source-less dependencies (rust-lang/cargo#13775) - fix(msrv): Put MSRV-aware resolver behind a config (rust-lang/cargo#13769) - fix(msrv): Error, rather than panic, on rust-version 'x' (rust-lang/cargo#13771) - fix(credential): trim newlines in tokens from stdin (rust-lang/cargo#13770) - test(msrv): Re-organize MSRV tests (rust-lang/cargo#13767) - feat(install): Including Locking message (rust-lang/cargo#13764) r? ghost
Oh, right! I don't know how I could miss this opportunity - I just visually inspected the output. With a test-assertion on stderr, it would have been far clearer though, as the test would still have failed. Next time, even though I hope there won't be, who needs bugs ;). |
Fixes #13773.
Tasks
gix-dir
in Cargo.lock to turn test green