git-branchless: fix build (broken by rust 1.89)

Bryan Lai 65fa6b9c c53baa66

+32
+18
pkgs/by-name/gi/git-branchless/fix-esl01-indexedlog-for-rust-1_89.patch
···
··· 1 + diff --git a/src/lock.rs b/src/lock.rs 2 + --- a/src/lock.rs 3 + +++ b/src/lock.rs 4 + @@ -132,10 +132,10 @@ impl ScopedDirLock { 5 + 6 + // Lock 7 + match (opts.exclusive, opts.non_blocking) { 8 + - (true, false) => file.lock_exclusive(), 9 + - (true, true) => file.try_lock_exclusive(), 10 + - (false, false) => file.lock_shared(), 11 + - (false, true) => file.try_lock_shared(), 12 + + (true, false) => fs2::FileExt::lock_exclusive(&file), 13 + + (true, true) => fs2::FileExt::try_lock_exclusive(&file), 14 + + (false, false) => fs2::FileExt::lock_shared(&file), 15 + + (false, true) => fs2::FileExt::try_lock_shared(&file), 16 + } 17 + .context(&path, || { 18 + format!(
+14
pkgs/by-name/gi/git-branchless/package.nix
··· 21 hash = "sha256-8uv+sZRr06K42hmxgjrKk6FDEngUhN/9epixRYKwE3U="; 22 }; 23 24 cargoHash = "sha256-i7KpTd4fX3PrhDjj3R9u98rdI0uHkpQCxSmEF+Gu7yk="; 25 26 nativeBuildInputs = [ pkg-config ];
··· 21 hash = "sha256-8uv+sZRr06K42hmxgjrKk6FDEngUhN/9epixRYKwE3U="; 22 }; 23 24 + # Patch the vendored esl01-indexedlog crate. 25 + # This is necessary to fix the build for rust 1.89. See: 26 + # - https://github.com/NixOS/nixpkgs/issues/437051 27 + # - https://github.com/arxanas/git-branchless/issues/1585 28 + # - https://github.com/facebook/sapling/issues/1119 29 + # The patch is derived from: 30 + # - https://github.com/facebook/sapling/commit/9e27acb84605079bf4e305afb637a4d6801831ac 31 + postPatch = '' 32 + ( 33 + cd ../git-branchless-*-vendor/esl01-indexedlog-*/ 34 + patch -p1 < ${./fix-esl01-indexedlog-for-rust-1_89.patch} 35 + ) 36 + ''; 37 + 38 cargoHash = "sha256-i7KpTd4fX3PrhDjj3R9u98rdI0uHkpQCxSmEF+Gu7yk="; 39 40 nativeBuildInputs = [ pkg-config ];