upgrade gix to the latest release 0.69.#14975
Merged
weihanglo merged 1 commit intorust-lang:masterfrom Dec 22, 2024
Merged
Conversation
Collaborator
The main benefit is that it won't facilitate hangs due to attempts to read from untrackable directory entries, like names pipes or sockets. Related to GitoxideLabs/gitoxide#1629
weihanglo
approved these changes
Dec 22, 2024
Member
weihanglo
left a comment
There was a problem hiding this comment.
Interesting FIFO issue 😆.
Agree we can deal with it separately. Thank you for this update!
github-merge-queue bot
pushed a commit
that referenced
this pull request
Dec 24, 2024
…up for publishing. (#14977) Follow-up of #14975, related to GitoxideLabs/gitoxide#1629. This would otherwise cause the publish to hang if it tries to read from a fifo.
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Dec 25, 2024
Update cargo 6 commits in 652623b779c88fe44afede28bf7f1c9c07812511..c86f4b3a1b153218e6e50861214b0b4b4e695f23 2024-12-20 15:44:42 +0000 to 2024-12-24 17:49:48 +0000 - fix(package): check dirtiness of path fields in manifest (rust-lang/cargo#14966) - test: make path arguments more generic and flexible (rust-lang/cargo#14979) - Moved manifest metadata tracking from fingerprint to dep info (rust-lang/cargo#14973) - fix: assure possibly blocking non-files (like FIFOs) won't be picked up for publishing. (rust-lang/cargo#14977) - simplify SourceID Hash (rust-lang/cargo#14800) - upgrade `gix` to the latest release 0.69. (rust-lang/cargo#14975)
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The main benefit is that it won't facilitate hangs due to attempts to read from untrackable directory entries, like names pipes or sockets.
Related to GitoxideLabs/gitoxide#1629
Tasks
gixonce everything is fixed.Postponed
It turns out that the new
gixversion doesn't magically fix the FIFO issue, so the following test still fails.It's not super-trivial to fix apparently (I tried), so let's do it in a separate PR.
Here is the patch I have so far in case anyone is interested to fix it earlier or wants to share insights :).
commit dfef545eae215f0b9da9f3d4424b52cba7edaec3 Author: Sebastian Thiel <sebastian.thiel@icloud.com> Date: Sun Dec 22 19:05:40 2024 +0100 fix: assure possibly blocking non-files (like FIFOs) won't be picked up for publishing. This would otherwise cause the publish to hang. diff --git a/src/cargo/sources/path.rs b/src/cargo/sources/path.rs index 776590697..c78463a32 100644 --- a/src/cargo/sources/path.rs +++ b/src/cargo/sources/path.rs @@ -626,8 +626,11 @@ fn list_files_gix( .filter(|res| { // Don't include Cargo.lock if it is untracked. Packaging will // generate a new one as needed. + // Also don't include untrackable directory entries, like FIFOs. res.as_ref().map_or(true, |item| { - !(item.entry.status == Status::Untracked && item.entry.rela_path == "Cargo.lock") + item.entry.disk_kind != Some(gix::dir::entry::Kind::Untrackable) + && !(item.entry.status == Status::Untracked + && item.entry.rela_path == "Cargo.lock") }) }) .map(|res| res.map(|item| (item.entry.rela_path, item.entry.disk_kind))) diff --git a/tests/testsuite/package.rs b/tests/testsuite/package.rs index 1740de4ac..1c6b3db89 100644 --- a/tests/testsuite/package.rs +++ b/tests/testsuite/package.rs @@ -6873,3 +6873,29 @@ See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for "#]]) .run(); } + +#[cargo_test] +#[cfg(unix)] +fn simple_with_fifo() { + let p = project() + .file( + "Cargo.toml", + r#" + [package] + name = "foo" + version = "0.1.0" + edition = "2015" + "#, + ) + .file("src/main.rs", "fn main() {}") + .build(); + + std::process::Command::new("mkfifo") + .current_dir(p.root()) + .arg(p.root().join("blocks-when-read")) + .status() + .expect("a FIFO can be created"); + + // If this hangs, Cargo tried to package a FIFO and is reading it forever. + p.cargo("package").run(); +}