]> git.sesse.net Git - bcachefs-tools-debian/commitdiff
Revert upstream patch f6b619da.
authorSteinar H. Gunderson <sesse@debian.org>
Tue, 13 Feb 2024 20:57:00 +0000 (21:57 +0100)
committerSteinar H. Gunderson <sesse@debian.org>
Wed, 21 Feb 2024 18:34:59 +0000 (19:34 +0100)
With this revert (and a loosening of the version dependency in
Cargo.toml), we compile and run with bindgen 0.66, which is in Debian.
It can safely be removed when Debian upgrades to at least 0.69.4.

debian/changelog
debian/patches/revert-bindgen-changes.patch [new file with mode: 0644]
debian/patches/series

index 24d41682df37df6b1815ff3f9b19c456cf977a49..7007b3c4d2ae1acb076433615c0ee84d62919c5a 100644 (file)
@@ -4,6 +4,9 @@ bcachefs-tools (1:1.6.3-0.1) UNRELEASED; urgency=medium
   * New upstream release.
     * Remove the do-not-install-mount-symlink patch.
     * Add epoch to deal with new upstream versioning scheme. (Closes: #1054620)
+    * revert-bindgen-changes.patch: New patch, reinstates upstream
+      hack that makes bcachefs-tools work with bindgen older than 0.69.4
+      (which isn't in Debian yet).
   * Build-depend on systemd-dev, since udev.pc has moved there.
 
  -- Steinar H. Gunderson <sesse@debian.org>  Wed, 21 Feb 2024 19:32:51 +0100
diff --git a/debian/patches/revert-bindgen-changes.patch b/debian/patches/revert-bindgen-changes.patch
new file mode 100644 (file)
index 0000000..3cafbd8
--- /dev/null
@@ -0,0 +1,94 @@
+Revert upstream patch f6b619da.
+
+With this revert (and a loosening of the version dependency in
+Cargo.toml), we compile and run with bindgen 0.66, which is in Debian.
+It can safely be removed when Debian upgrades to at least 0.69.4.
+
+The patch doesn't revert cleanly anymore, so some comment changes
+have been dropped, but they are not important.
+
+Index: bcachefs-tools/Cargo.lock
+===================================================================
+--- bcachefs-tools.orig/Cargo.lock
++++ bcachefs-tools/Cargo.lock
+@@ -107,17 +107,17 @@ dependencies = [
+ [[package]]
+ name = "bindgen"
+-version = "0.69.4"
++version = "0.69.2"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0"
++checksum = "a4c69fae65a523209d34240b60abe0c42d33d1045d445c0839d8a4894a736e2d"
+ dependencies = [
+  "bitflags 2.4.2",
+  "cexpr",
+  "clang-sys",
+- "itertools",
+  "lazy_static",
+  "lazycell",
+  "log",
++ "peeking_take_while",
+  "prettyplease",
+  "proc-macro2",
+  "quote",
+@@ -312,15 +312,6 @@ dependencies = [
+ ]
+ [[package]]
+-name = "itertools"
+-version = "0.12.1"
+-source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569"
+-dependencies = [
+- "either",
+-]
+-
+-[[package]]
+ name = "lazy_static"
+ version = "1.4.0"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+@@ -414,6 +405,12 @@ source = "registry+https://github.com/ru
+ checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c"
+ [[package]]
++name = "peeking_take_while"
++version = "0.1.2"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099"
++
++[[package]]
+ name = "pkg-config"
+ version = "0.3.29"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+Index: bcachefs-tools/bch_bindgen/Cargo.toml
+===================================================================
+--- bcachefs-tools.orig/bch_bindgen/Cargo.toml
++++ bcachefs-tools/bch_bindgen/Cargo.toml
+@@ -19,4 +19,4 @@ paste = "1.0.11"
+ [build-dependencies]
+ pkg-config = "0.3"
+-bindgen = "0.69.4"
++bindgen = "0.69.2"
+Index: bcachefs-tools/bch_bindgen/build.rs
+===================================================================
+--- bcachefs-tools.orig/bch_bindgen/build.rs
++++ bcachefs-tools/bch_bindgen/build.rs
+@@ -160,4 +160,16 @@ fn packed_and_align_fix(bindings: std::s
+             "#[repr(C, packed(8))]\npub struct bch_sb {",
+             "#[repr(C, align(8))]\npub struct bch_sb {",
+         )
++        .replace(
++            "#[repr(C, packed(8))]\n#[repr(align(8))]\n#[derive(Debug, Default, Copy, Clone)]\npub struct bkey {",
++            "#[repr(C, align(8))]\n#[derive(Debug, Default, Copy, Clone)]\npub struct bkey {",
++        )
++        .replace(
++            "#[repr(C, packed(8))]\n#[repr(align(8))]\n#[derive(Debug, Default, Copy, Clone)]\npub struct bch_extent_crc32 {",
++            "#[repr(C, align(8))]\n#[derive(Debug, Default, Copy, Clone)]\npub struct bch_extent_crc32 {",
++        )
++        .replace(
++            "#[repr(C, packed(8))]\n#[repr(align(8))]\n#[derive(Debug, Default, Copy, Clone)]\npub struct bch_extent_ptr {",
++            "#[repr(C, align(8))]\n#[derive(Debug, Default, Copy, Clone)]\npub struct bch_extent_ptr {",
++        )
+ }
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..242cf6b703fe9b5a3179de7bb8887d5dcc1dabfe 100644 (file)
@@ -0,0 +1 @@
+revert-bindgen-changes.patch