diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a81c804c..260c9762 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,17 +10,17 @@ jobs: build: strategy: matrix: - xcode: ['xcode12.2', 'xcode11.7'] + xcode: ['xcode12.5', 'xcode13'] include: - - xcode: 'xcode12.2' - xcode-path: '/Applications/Xcode_12.2.app/Contents/Developer' + - xcode: 'xcode12.5' + xcode-path: '/Applications/Xcode_12.5.app/Contents/Developer' upload-dist: true - - xcode: 'xcode11.7' - xcode-path: '/Applications/Xcode_11.7.app/Contents/Developer' - upload-dist: false # No arm64 slice, so no upload + - xcode: 'xcode13' + xcode-path: '/Applications/Xcode_13.0.app/Contents/Developer' + upload-dist: false # In Beta, so no upload name: Build and Test Sparkle - runs-on: macos-10.15 + runs-on: macos-11 steps: - name: Checkout diff --git a/Autoupdate/SUUnarchiverNotifier.m b/Autoupdate/SUUnarchiverNotifier.m index 643f0eb9..4fd5e37d 100644 --- a/Autoupdate/SUUnarchiverNotifier.m +++ b/Autoupdate/SUUnarchiverNotifier.m @@ -31,6 +31,8 @@ if (self != nil) { _completionBlock = [completionBlock copy]; _progressBlock = [progressBlock copy]; + } else { + assert(false); } return self; } diff --git a/Configurations/ConfigCommon.xcconfig b/Configurations/ConfigCommon.xcconfig index fff4a6e2..c204a5d8 100644 --- a/Configurations/ConfigCommon.xcconfig +++ b/Configurations/ConfigCommon.xcconfig @@ -41,6 +41,7 @@ DOWNLOADER_BUNDLE_ID = ${XPC_SERVICE_BUNDLE_ID_PREFIX}.Downloader GCC_PREPROCESSOR_DEFINITIONS_COMMON = SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME=$(SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME) SPARKLE_BUILD_UI_BITS=$(SPARKLE_BUILD_UI_BITS) SPARKLE_BUNDLE_IDENTIFIER=\"$(SPARKLE_BUNDLE_IDENTIFIER)\" CURRENT_PROJECT_VERSION=\"$(CURRENT_PROJECT_VERSION)\" SPARKLE_RELAUNCH_TOOL_NAME=\"$(SPARKLE_RELAUNCH_TOOL_NAME)\" SPARKLE_INSTALLER_PROGRESS_TOOL_NAME=\"$(SPARKLE_INSTALLER_PROGRESS_TOOL_NAME)\" SPARKLE_ICON_NAME=\"$(SPARKLE_ICON_NAME)\" INSTALLER_LAUNCHER_BUNDLE_ID=\"${INSTALLER_LAUNCHER_BUNDLE_ID}\" INSTALLER_CONNECTION_BUNDLE_ID=\"${INSTALLER_CONNECTION_BUNDLE_ID}\" INSTALLER_STATUS_BUNDLE_ID=\"${INSTALLER_STATUS_BUNDLE_ID}\" DOWNLOADER_BUNDLE_ID=\"${DOWNLOADER_BUNDLE_ID}\" CODE_SIGN_IDENTITY = - +SDKROOT = macosx ENABLE_HARDENED_RUNTIME = YES CLANG_ENABLE_OBJC_ARC = YES GCC_ENABLE_PASCAL_STRINGS = NO diff --git a/Sparkle.xcodeproj/project.pbxproj b/Sparkle.xcodeproj/project.pbxproj index 9d999178..4fd84ea3 100644 --- a/Sparkle.xcodeproj/project.pbxproj +++ b/Sparkle.xcodeproj/project.pbxproj @@ -29,6 +29,7 @@ 895C5DC524D78E460058A82D /* ShellScript */, ); dependencies = ( + 72EF30B926747E39008CE987 /* PBXTargetDependency */, ); name = XCFrameworks; productName = Sparkle.xcframework; @@ -298,6 +299,8 @@ 726E4A2B1C87D56200C57C6A /* SUTestWebServer.m in Sources */ = {isa = PBXBuildFile; fileRef = A5BF4F1C1BC7668B007A052A /* SUTestWebServer.m */; }; 726E4A301C87DC1700C57C6A /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DC2EF5B0486A6940098B216 /* Sparkle.framework */; }; 726E4A371C89116000C57C6A /* SPUStandardUserDriverDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 726E4A361C89116000C57C6A /* SPUStandardUserDriverDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 726F168626747CEB005BEA89 /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DC2EF5B0486A6940098B216 /* Sparkle.framework */; }; + 726F168726747CEB005BEA89 /* Sparkle.framework in Copy Sparkle */ = {isa = PBXBuildFile; fileRef = 8DC2EF5B0486A6940098B216 /* Sparkle.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 726F2CE51BC9C33D001971A4 /* SUOperatingSystem.h in Headers */ = {isa = PBXBuildFile; fileRef = 726F2CE31BC9C33D001971A4 /* SUOperatingSystem.h */; }; 726F2CE61BC9C33D001971A4 /* SUOperatingSystem.m in Sources */ = {isa = PBXBuildFile; fileRef = 726F2CE41BC9C33D001971A4 /* SUOperatingSystem.m */; }; 726F2CE81BC9C48F001971A4 /* SUConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 61299A5F09CA6EB100B7442F /* SUConstants.m */; }; @@ -578,6 +581,13 @@ remoteGlobalIDString = 726E4A151C86C88F00C57C6A; remoteInfo = TestAppHelper; }; + 726F168826747CEB005BEA89 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 8DC2EF4F0486A6940098B216; + remoteInfo = Sparkle; + }; 72A5D5AB1D6929260009E5AC /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; @@ -599,6 +609,13 @@ remoteGlobalIDString = 72D9549D1CBB415B006F28BD; remoteInfo = "sparkle-cli"; }; + 72EF30B826747E39008CE987 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 8DC2EF4F0486A6940098B216; + remoteInfo = Sparkle; + }; 72F94F611CC48669002DEE68 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; @@ -719,6 +736,7 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( + 726F168726747CEB005BEA89 /* Sparkle.framework in Copy Sparkle */, ); name = "Copy Sparkle"; runOnlyForDeploymentPostprocessing = 0; @@ -1436,6 +1454,7 @@ buildActionMask = 2147483647; files = ( 724F76F91D6EAD0D00ECD062 /* Cocoa.framework in Frameworks */, + 726F168626747CEB005BEA89 /* Sparkle.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2620,6 +2639,7 @@ buildRules = ( ); dependencies = ( + 726F168926747CEB005BEA89 /* PBXTargetDependency */, ); name = "sparkle-cli"; productName = "sparkle-cli"; @@ -2725,7 +2745,7 @@ attributes = { CLASSPREFIX = SU; LastSwiftUpdateCheck = 1020; - LastUpgradeCheck = 1250; + LastUpgradeCheck = 1300; ORGANIZATIONNAME = "Sparkle Project"; TargetAttributes = { 612279D80DB5470200AB99EA = { @@ -3582,6 +3602,11 @@ target = 726E4A151C86C88F00C57C6A /* TestAppHelper */; targetProxy = 726E4A1F1C86C88F00C57C6A /* PBXContainerItemProxy */; }; + 726F168926747CEB005BEA89 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 8DC2EF4F0486A6940098B216 /* Sparkle */; + targetProxy = 726F168826747CEB005BEA89 /* PBXContainerItemProxy */; + }; 72A5D5AC1D6929260009E5AC /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 72B398D11D3D879300EE297F /* Autoupdate */; @@ -3597,6 +3622,11 @@ target = 72D9549D1CBB415B006F28BD /* sparkle-cli */; targetProxy = 72DBA3791D5FDE95002594A8 /* PBXContainerItemProxy */; }; + 72EF30B926747E39008CE987 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 8DC2EF4F0486A6940098B216 /* Sparkle */; + targetProxy = 72EF30B826747E39008CE987 /* PBXContainerItemProxy */; + }; 72F94F621CC48669002DEE68 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 726E07AC1CAF08D6001A286B /* SparkleInstallerLauncher */; @@ -4151,6 +4181,7 @@ baseConfigurationReference = 72D954B01CBB41E2006F28BD /* ConfigSparkleTool.xcconfig */; buildSettings = { CLANG_ANALYZER_NONNULL = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; }; name = Debug; }; @@ -4159,6 +4190,7 @@ baseConfigurationReference = 72D954B01CBB41E2006F28BD /* ConfigSparkleTool.xcconfig */; buildSettings = { CLANG_ANALYZER_NONNULL = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; }; name = Coverage; }; @@ -4167,6 +4199,7 @@ baseConfigurationReference = 72D954B01CBB41E2006F28BD /* ConfigSparkleTool.xcconfig */; buildSettings = { CLANG_ANALYZER_NONNULL = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; }; name = Release; }; diff --git a/Sparkle.xcodeproj/xcshareddata/xcschemes/Distribution.xcscheme b/Sparkle.xcodeproj/xcshareddata/xcschemes/Distribution.xcscheme index 3ebded4e..3006563a 100644 --- a/Sparkle.xcodeproj/xcshareddata/xcschemes/Distribution.xcscheme +++ b/Sparkle.xcodeproj/xcshareddata/xcschemes/Distribution.xcscheme @@ -1,9 +1,9 @@ )__unused resumableUpdate completion:(SPUUpdateDriverCompletion)__unused completionBlock +#pragma clang diagnostic pop { // Nothing really to do here.. this shouldn't be called. SULog(SULogLevelError, @"Error: resumeDownloadedUpdate:completion: called on SPUAutomaticUpdateDriver"); diff --git a/Sparkle/SPUInstallerDriver.m b/Sparkle/SPUInstallerDriver.m index dc2c47d0..e4903c4d 100644 --- a/Sparkle/SPUInstallerDriver.m +++ b/Sparkle/SPUInstallerDriver.m @@ -346,7 +346,10 @@ launcherConnection.invalidationHandler = ^{ dispatch_async(dispatch_get_main_queue(), ^{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wcompletion-handler" if (!madeReply) { +#pragma clang diagnostic pop // If something went horribly wrong, just guess that we won't require authorization reply(NO); @@ -367,7 +370,10 @@ [installerLauncher checkIfApplicationInstallationRequiresAuthorizationWithHostBundlePath:self.host.bundlePath reply:^(BOOL requiresAuthorization) { dispatch_async(dispatch_get_main_queue(), ^{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wcompletion-handler" if (!madeReply) { +#pragma clang diagnostic pop madeReply = YES; [launcherConnection invalidate]; @@ -403,7 +409,10 @@ launcherConnection.invalidationHandler = ^{ dispatch_async(dispatch_get_main_queue(), ^{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wcompletion-handler" if (!retrievedLaunchStatus) { +#pragma clang diagnostic pop NSError *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUInstallationError userInfo:@{ NSLocalizedDescriptionKey:SULocalizedString(@"An error occurred while connecting to the installer. Please try again later.", nil) }]; diff --git a/Sparkle/SPUProbeInstallStatus.m b/Sparkle/SPUProbeInstallStatus.m index d44aac2d..298bb94c 100644 --- a/Sparkle/SPUProbeInstallStatus.m +++ b/Sparkle/SPUProbeInstallStatus.m @@ -38,7 +38,10 @@ [installerStatus setInvalidationHandler:^{ dispatch_async(dispatch_get_main_queue(), ^{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wcompletion-handler" if (!handledCompletion) { +#pragma clang diagnostic pop completionHandler(NO); handledCompletion = YES; } @@ -50,7 +53,10 @@ [installerStatus probeStatusConnectivityWithReply:^{ dispatch_async(dispatch_get_main_queue(), ^{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wcompletion-handler" if (!handledCompletion) { +#pragma clang diagnostic pop completionHandler(YES); handledCompletion = YES; } @@ -58,8 +64,11 @@ [installerStatus invalidate]; }]; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wcompletion-handler" dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(PROBE_TIMEOUT * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ if (!handledCompletion) { +#pragma clang diagnostic pop if (usesXPC) { SULog(SULogLevelError, @"Timed out while probing installer progress. Please see https://sparkle-project.org/documentation/sandboxing/#testing for potential cause."); } else { @@ -86,7 +95,10 @@ [installerStatus setInvalidationHandler:^{ dispatch_async(dispatch_get_main_queue(), ^{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wcompletion-handler" if (!handledCompletion) { +#pragma clang diagnostic pop completionHandler(nil); handledCompletion = YES; } @@ -103,7 +115,10 @@ } dispatch_async(dispatch_get_main_queue(), ^{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wcompletion-handler" if (!handledCompletion) { +#pragma clang diagnostic pop completionHandler(installationInfo); handledCompletion = YES; } @@ -112,8 +127,11 @@ [installerStatus invalidate]; }]; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wcompletion-handler" dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(PROBE_TIMEOUT * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ if (!handledCompletion) { +#pragma clang diagnostic pop if (usesXPC) { SULog(SULogLevelDefault, @"Timed out while probing installer info data. Please see https://sparkle-project.org/documentation/sandboxing/#testing for potential cause."); } else { diff --git a/Sparkle/SPUUIBasedUpdateDriver.m b/Sparkle/SPUUIBasedUpdateDriver.m index 4c62a506..d17cc4df 100644 --- a/Sparkle/SPUUIBasedUpdateDriver.m +++ b/Sparkle/SPUUIBasedUpdateDriver.m @@ -42,6 +42,8 @@ if (self != nil) { _downloadDriver = [[SPUDownloadDriver alloc] initWithRequestURL:releaseNotesURL host:host userAgent:nil httpHeaders:nil inBackground:NO delegate:self]; _completionHandler = [completionHandler copy]; + } else { + assert(false); } return self; } diff --git a/Sparkle/SUUpdatePermissionPrompt.m b/Sparkle/SUUpdatePermissionPrompt.m index cdde16fe..034adaea 100644 --- a/Sparkle/SUUpdatePermissionPrompt.m +++ b/Sparkle/SUUpdatePermissionPrompt.m @@ -72,6 +72,8 @@ static NSString *const SUUpdatePermissionPromptTouchBarIndentifier = @"" SPARKLE _shouldSendProfile = [self shouldAskAboutProfile]; _systemProfileInformationArray = request.systemProfile; [self setShouldCascadeWindows:NO]; + } else { + assert(false); } return self; } diff --git a/TestApplication/SUInstallUpdateViewController.m b/TestApplication/SUInstallUpdateViewController.m index 86363981..ba22b103 100644 --- a/TestApplication/SUInstallUpdateViewController.m +++ b/TestApplication/SUInstallUpdateViewController.m @@ -32,6 +32,8 @@ if (self != nil) { _appcastItem = appcastItem; self.reply = reply; + } else { + assert(false); } return self; }