From aada018f05c1696efb5c306b5acbc3c9dd811632 Mon Sep 17 00:00:00 2001 From: Tim Kientzle Date: Sun, 13 Oct 2024 00:35:17 -0700 Subject: [PATCH] Increase the hole size for this test to 32MiB (#2380) APFS on macOS 15 seems to have a higher threshold for creating sparse files. --- .github/workflows/ci.yml | 2 +- libarchive/test/test_sparse_basic.c | 17 ++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ac2c85a4c..c93c8850e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,7 @@ permissions: jobs: MacOS: - runs-on: macos-13 + runs-on: macos-15 strategy: matrix: bs: [autotools, cmake] diff --git a/libarchive/test/test_sparse_basic.c b/libarchive/test/test_sparse_basic.c index 0350df1e9..963d5e8be 100644 --- a/libarchive/test/test_sparse_basic.c +++ b/libarchive/test/test_sparse_basic.c @@ -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 -- 2.47.2