Skip to content

Commit

Permalink
Increase the hole size for this test to 32MiB (libarchive#2380)
Browse files Browse the repository at this point in the history
APFS on macOS 15 seems to have a higher threshold for creating sparse
files.
  • Loading branch information
kientzle authored Oct 13, 2024
1 parent 6287b99 commit aada018
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ permissions:

jobs:
MacOS:
runs-on: macos-13
runs-on: macos-15
strategy:
matrix:
bs: [autotools, cmake]
Expand Down
17 changes: 10 additions & 7 deletions libarchive/test/test_sparse_basic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit aada018

Please sign in to comment.