]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Increase the hole size for this test to 32MiB (#2380)
authorTim Kientzle <kientzle@acm.org>
Sun, 13 Oct 2024 07:35:17 +0000 (00:35 -0700)
committerGitHub <noreply@github.com>
Sun, 13 Oct 2024 07:35:17 +0000 (09:35 +0200)
APFS on macOS 15 seems to have a higher threshold for creating sparse
files.

.github/workflows/ci.yml
libarchive/test/test_sparse_basic.c

index ac2c85a4ca652b7b23cd90f4f6af28bfe37d0de7..c93c8850e2546284a52c9caf6bbfa16566172104 100644 (file)
@@ -7,7 +7,7 @@ permissions:
 
 jobs:
   MacOS:
-    runs-on: macos-13
+    runs-on: macos-15
     strategy:
       matrix:
         bs: [autotools, cmake]
index 0350df1e9f27638eb7c798eb0a7867c487f62fc0..963d5e8beeafc86d72a12d525dbc37141b1e434f 100644 (file)
@@ -67,13 +67,16 @@ struct sparse {
 
 static void create_sparse_file(const char *, const struct sparse *);
 
-#if defined(__APPLE__)
-/* On APFS holes need to be at least 4096x4097 bytes */
-#define MIN_HOLE 16781312
-#else
-/* Elsewhere we work with 4096*10 bytes */
-#define MIN_HOLE 409600
-#endif
+/* This should be large enough that any OS/filesystem that
+ * does support sparse files is certain to store a gap this big
+ * as a hole. */
+/* A few data points:
+ * = ZFS on FreeBSD needs this to be at least 200kB
+ * = macOS APFS needs this to be at least 4096x4097 bytes
+ *
+ * 32MiB here is bigger than either of the above.
+ */
+#define MIN_HOLE (32 * 1024UL * 1024UL)
 
 #if defined(_WIN32) && !defined(__CYGWIN__)
 #include <winioctl.h>