mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-28 11:20:36 +00:00
upgrade gix
to the latest release 0.69. (#14975)
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 https://github.com/GitoxideLabs/gitoxide/pull/1629 ### Tasks * [x] upgrade * [x] incorporate updated `gix` [once everything is fixed](https://github.com/GitoxideLabs/gitoxide/pull/1740). * [x] assure tests work ### Postponed It turns out that the new `gix` version 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 :). ```patch 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(); +} ```
This commit is contained in:
commit
cfa27f208f
99
Cargo.lock
generated
99
Cargo.lock
generated
@ -1161,9 +1161,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "gix"
|
||||
version = "0.68.0"
|
||||
version = "0.69.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b04c66359b5e17f92395abc433861df0edf48f39f3f590818d1d7217327dd6a1"
|
||||
checksum = "8d0eebdaecdcf405d5433a36f85e4f058cf4de48ee2604388be0dbccbaad353e"
|
||||
dependencies = [
|
||||
"gix-actor",
|
||||
"gix-attributes",
|
||||
@ -1197,6 +1197,7 @@ dependencies = [
|
||||
"gix-revision",
|
||||
"gix-revwalk",
|
||||
"gix-sec",
|
||||
"gix-shallow",
|
||||
"gix-submodule",
|
||||
"gix-tempfile",
|
||||
"gix-trace",
|
||||
@ -1263,9 +1264,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "gix-command"
|
||||
version = "0.3.11"
|
||||
version = "0.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6d7d6b8f3a64453fd7e8191eb80b351eb7ac0839b40a1237cd2c137d5079fe53"
|
||||
checksum = "9405c0a56e17f8365a46870cd2c7db71323ecc8bda04b50cb746ea37bd091e90"
|
||||
dependencies = [
|
||||
"bstr",
|
||||
"gix-path",
|
||||
@ -1323,9 +1324,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "gix-credentials"
|
||||
version = "0.25.1"
|
||||
version = "0.26.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2be87bb8685fc7e6e7032ef71c45068ffff609724a0c897b8047fde10db6ae71"
|
||||
checksum = "82a50c56b785c29a151ab4ccf74a83fe4e21d2feda0d30549504b4baed353e0a"
|
||||
dependencies = [
|
||||
"bstr",
|
||||
"gix-command",
|
||||
@ -1340,9 +1341,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "gix-date"
|
||||
version = "0.9.2"
|
||||
version = "0.9.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "691142b1a34d18e8ed6e6114bc1a2736516c5ad60ef3aa9bd1b694886e3ca92d"
|
||||
checksum = "c57c477b645ee248b173bb1176b52dd528872f12c50375801a58aaf5ae91113f"
|
||||
dependencies = [
|
||||
"bstr",
|
||||
"itoa 1.0.11",
|
||||
@ -1352,9 +1353,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "gix-diff"
|
||||
version = "0.48.0"
|
||||
version = "0.49.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a327be31a392144b60ab0b1c863362c32a1c8f7effdfa2141d5d5b6b916ef3bf"
|
||||
checksum = "a8e92566eccbca205a0a0f96ffb0327c061e85bc5c95abbcddfe177498aa04f6"
|
||||
dependencies = [
|
||||
"bstr",
|
||||
"gix-hash",
|
||||
@ -1364,9 +1365,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "gix-dir"
|
||||
version = "0.10.0"
|
||||
version = "0.11.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "acd6a0618958f9cce78a32724f8e06c4f4a57ca7080f645736d53676dc9b4db9"
|
||||
checksum = "fba2ffbcf4bd34438e8a8367ccbc94870549903d1f193a14f47eb6b0967e1293"
|
||||
dependencies = [
|
||||
"bstr",
|
||||
"gix-discover",
|
||||
@ -1422,9 +1423,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "gix-filter"
|
||||
version = "0.15.0"
|
||||
version = "0.16.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5108cc58d58b27df10ac4de7f31b2eb96d588a33e5eba23739b865f5d8db7995"
|
||||
checksum = "3d0ecdee5667f840ba20c7fe56d63f8e1dc1e6b3bfd296151fe5ef07c874790a"
|
||||
dependencies = [
|
||||
"bstr",
|
||||
"encoding_rs",
|
||||
@ -1443,9 +1444,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "gix-fs"
|
||||
version = "0.12.0"
|
||||
version = "0.12.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "34740384d8d763975858fa2c176b68652a6fcc09f616e24e3ce967b0d370e4d8"
|
||||
checksum = "3b3d4fac505a621f97e5ce2c69fdc425742af00c0920363ca4074f0eb48b1db9"
|
||||
dependencies = [
|
||||
"fastrand",
|
||||
"gix-features",
|
||||
@ -1555,9 +1556,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "gix-object"
|
||||
version = "0.46.0"
|
||||
version = "0.46.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "65d93e2bbfa83a307e47f45e45de7b6c04d7375a8bd5907b215f4bf45237d879"
|
||||
checksum = "e42d58010183ef033f31088479b4eb92b44fe341b35b62d39eb8b185573d77ea"
|
||||
dependencies = [
|
||||
"bstr",
|
||||
"gix-actor",
|
||||
@ -1565,6 +1566,7 @@ dependencies = [
|
||||
"gix-features",
|
||||
"gix-hash",
|
||||
"gix-hashtable",
|
||||
"gix-path",
|
||||
"gix-utils",
|
||||
"gix-validate",
|
||||
"itoa 1.0.11",
|
||||
@ -1575,9 +1577,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "gix-odb"
|
||||
version = "0.65.0"
|
||||
version = "0.66.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "93bed6e1b577c25a6bb8e6ecbf4df525f29a671ddf5f2221821a56a8dbeec4e3"
|
||||
checksum = "cb780eceb3372ee204469478de02eaa34f6ba98247df0186337e0333de97d0ae"
|
||||
dependencies = [
|
||||
"arc-swap",
|
||||
"gix-date",
|
||||
@ -1596,9 +1598,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "gix-pack"
|
||||
version = "0.55.0"
|
||||
version = "0.56.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9b91fec04d359544fecbb8e85117ec746fbaa9046ebafcefb58cb74f20dc76d4"
|
||||
checksum = "4158928929be29cae7ab97afc8e820a932071a7f39d8ba388eed2380c12c566c"
|
||||
dependencies = [
|
||||
"clru",
|
||||
"gix-chunk",
|
||||
@ -1616,9 +1618,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "gix-packetline"
|
||||
version = "0.18.1"
|
||||
version = "0.18.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8a720e5bebf494c3ceffa85aa89f57a5859450a0da0a29ebe89171e23543fa78"
|
||||
checksum = "911aeea8b2dabeed2f775af9906152a1f0109787074daf9e64224e3892dde453"
|
||||
dependencies = [
|
||||
"bstr",
|
||||
"faster-hex",
|
||||
@ -1668,9 +1670,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "gix-prompt"
|
||||
version = "0.8.9"
|
||||
version = "0.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7a7822afc4bc9c5fbbc6ce80b00f41c129306b7685cac3248dbfa14784960594"
|
||||
checksum = "82433a19aa44688e3bde05c692870eda50b5db053df53ed5ae6d8ea594a6babd"
|
||||
dependencies = [
|
||||
"gix-command",
|
||||
"gix-config-value",
|
||||
@ -1681,15 +1683,23 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "gix-protocol"
|
||||
version = "0.46.1"
|
||||
version = "0.47.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7a7e7e51a0dea531d3448c297e2fa919b2de187111a210c324b7e9f81508b8ca"
|
||||
checksum = "c84642e8b6fed7035ce9cc449593019c55b0ec1af7a5dce1ab8a0636eaaeb067"
|
||||
dependencies = [
|
||||
"bstr",
|
||||
"gix-credentials",
|
||||
"gix-date",
|
||||
"gix-features",
|
||||
"gix-hash",
|
||||
"gix-lock",
|
||||
"gix-negotiate",
|
||||
"gix-object",
|
||||
"gix-ref",
|
||||
"gix-refspec",
|
||||
"gix-revwalk",
|
||||
"gix-shallow",
|
||||
"gix-trace",
|
||||
"gix-transport",
|
||||
"gix-utils",
|
||||
"maybe-async",
|
||||
@ -1710,9 +1720,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "gix-ref"
|
||||
version = "0.49.0"
|
||||
version = "0.49.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1eae462723686272a58f49501015ef7c0d67c3e042c20049d8dd9c7eff92efde"
|
||||
checksum = "a91b61776c839d0f1b7114901179afb0947aa7f4d30793ca1c56d335dfef485f"
|
||||
dependencies = [
|
||||
"gix-actor",
|
||||
"gix-features",
|
||||
@ -1745,9 +1755,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "gix-revision"
|
||||
version = "0.31.0"
|
||||
version = "0.31.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "44488e0380847967bc3e3cacd8b22652e02ea1eb58afb60edd91847695cd2d8d"
|
||||
checksum = "61e1ddc474405a68d2ce8485705dd72fe6ce959f2f5fe718601ead5da2c8f9e7"
|
||||
dependencies = [
|
||||
"bitflags 2.6.0",
|
||||
"bstr",
|
||||
@ -1788,6 +1798,18 @@ dependencies = [
|
||||
"windows-sys 0.52.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gix-shallow"
|
||||
version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "88d2673242e87492cb6ff671f0c01f689061ca306c4020f137197f3abc84ce01"
|
||||
dependencies = [
|
||||
"bstr",
|
||||
"gix-hash",
|
||||
"gix-lock",
|
||||
"thiserror 2.0.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gix-submodule"
|
||||
version = "0.16.0"
|
||||
@ -1824,9 +1846,9 @@ checksum = "04bdde120c29f1fc23a24d3e115aeeea3d60d8e65bab92cc5f9d90d9302eb952"
|
||||
|
||||
[[package]]
|
||||
name = "gix-transport"
|
||||
version = "0.43.1"
|
||||
version = "0.44.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "39a1a41357b7236c03e0c984147f823d87c3e445a8581bac7006df141577200b"
|
||||
checksum = "dd04d91e507a8713cfa2318d5a85d75b36e53a40379cc7eb7634ce400ecacbaf"
|
||||
dependencies = [
|
||||
"base64",
|
||||
"bstr",
|
||||
@ -1843,9 +1865,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "gix-traverse"
|
||||
version = "0.43.0"
|
||||
version = "0.43.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3ff2ec9f779680f795363db1c563168b32b8d6728ec58564c628e85c92d29faf"
|
||||
checksum = "6ed47d648619e23e93f971d2bba0d10c1100e54ef95d2981d609907a8cabac89"
|
||||
dependencies = [
|
||||
"bitflags 2.6.0",
|
||||
"gix-commitgraph",
|
||||
@ -1860,13 +1882,14 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "gix-url"
|
||||
version = "0.28.1"
|
||||
version = "0.28.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e09f97db3618fb8e473d7d97e77296b50aaee0ddcd6a867f07443e3e87391099"
|
||||
checksum = "d096fb733ba6bd3f5403dba8bd72bdd8809fe2b347b57844040b8f49c93492d9"
|
||||
dependencies = [
|
||||
"bstr",
|
||||
"gix-features",
|
||||
"gix-path",
|
||||
"percent-encoding",
|
||||
"thiserror 2.0.3",
|
||||
"url",
|
||||
]
|
||||
|
@ -49,7 +49,7 @@ filetime = "0.2.23"
|
||||
flate2 = { version = "1.0.30", default-features = false, features = ["zlib"] }
|
||||
git2 = "0.19.0"
|
||||
git2-curl = "0.20.0"
|
||||
gix = { version = "0.68.0", default-features = false, features = ["blocking-http-transport-curl", "progress-tree", "parallel", "dirwalk"] }
|
||||
gix = { version = "0.69.1", default-features = false, features = ["blocking-http-transport-curl", "progress-tree", "parallel", "dirwalk"] }
|
||||
glob = "0.3.1"
|
||||
handlebars = { version = "6.0.0", features = ["dir_source"] }
|
||||
hex = "0.4.3"
|
||||
|
@ -352,7 +352,7 @@ pub fn cargo_config_to_gitoxide_overrides(gctx: &GlobalContext) -> CargoResult<V
|
||||
}
|
||||
|
||||
/// Reinitializes a given Git repository. This is useful when a Git repository
|
||||
/// seems corrupted and we want to start over.
|
||||
/// seems corrupted, and we want to start over.
|
||||
pub fn reinitialize(git_dir: &Path) -> CargoResult<()> {
|
||||
fn init(path: &Path, bare: bool) -> CargoResult<()> {
|
||||
let mut opts = git2::RepositoryInitOptions::new();
|
||||
|
@ -1057,7 +1057,9 @@ pub fn fetch(
|
||||
fn has_shallow_lock_file(err: &crate::sources::git::fetch::Error) -> bool {
|
||||
matches!(
|
||||
err,
|
||||
gix::env::collate::fetch::Error::Fetch(gix::remote::fetch::Error::LockShallowFile(_))
|
||||
gix::env::collate::fetch::Error::Fetch(gix::remote::fetch::Error::Fetch(
|
||||
gix::protocol::fetch::Error::LockShallowFile(_)
|
||||
))
|
||||
)
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user