From cb2c83e2006626dcadbedf2f0d02071b593bdb39 Mon Sep 17 00:00:00 2001 From: Zorg Date: Thu, 27 Aug 2026 21:21:04 -0700 Subject: [PATCH] Fix binary delta testFileSystemCompression failing on macOS 27 (#2904) --- Autoupdate/SUBinaryDeltaApply.m | 10 ++++++++-- Tests/SUBinaryDeltaTest.m | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Autoupdate/SUBinaryDeltaApply.m b/Autoupdate/SUBinaryDeltaApply.m index 2f439b09..9a7033f8 100644 --- a/Autoupdate/SUBinaryDeltaApply.m +++ b/Autoupdate/SUBinaryDeltaApply.m @@ -450,10 +450,16 @@ BOOL applyBinaryDelta(NSString *source, NSString *finalDestination, NSString *pa fprintf(stderr, "\nApplying file system compression..."); } - NSTask *dittoTask = [[NSTask alloc] init]; + NSMutableArray *dittoArguments = [@[@"--hfsCompression"] mutableCopy]; + if (@available(macOS 27, *)) { + // Compression won't be applied on macOS 27 without passing --noclone + [dittoArguments addObject:@"--noclone"]; + } + [dittoArguments addObjectsFromArray:@[destination, finalDestination]]; + NSTask *dittoTask = [[NSTask alloc] init]; dittoTask.executableURL = [NSURL fileURLWithPath:@"/usr/bin/ditto" isDirectory:NO]; - dittoTask.arguments = @[@"--hfsCompression", destination, finalDestination]; + dittoTask.arguments = [dittoArguments copy]; // If we fail to apply file system compression, we will try falling back to not doing this BOOL failedToApplyFileSystemCompression = NO; diff --git a/Tests/SUBinaryDeltaTest.m b/Tests/SUBinaryDeltaTest.m index 7c20d90c..f28f57ac 100644 --- a/Tests/SUBinaryDeltaTest.m +++ b/Tests/SUBinaryDeltaTest.m @@ -1377,7 +1377,7 @@ typedef void (^SUDeltaHandler)(NSFileManager *fileManager, NSString *sourceDirec NSTask *dittoTask = [[NSTask alloc] init]; dittoTask.executableURL = [NSURL fileURLWithPath:@"/usr/bin/ditto" isDirectory:NO]; - dittoTask.arguments = @[@"--hfsCompression", destinationFile, destinationFile2]; + dittoTask.arguments = @[@"--hfsCompression", @"--noclone", destinationFile, destinationFile2]; NSError *launchError = nil; BOOL launched = [dittoTask launchAndReturnError:&launchError];