From 85ba5a1a376ebe44f215b354e64a9a4e33e158f3 Mon Sep 17 00:00:00 2001 From: Max Goedjen Date: Sun, 6 Sep 2026 20:46:51 -0700 Subject: [PATCH] Set Xcode 27 builder (#822) * Set Xcode 27 builder * Fix Xcode 27 build errors --- .github/workflows/codeql.yml | 9 ++------- .github/workflows/nightly.yml | 4 +--- .github/workflows/oneoff.yml | 4 +--- .github/workflows/release.yml | 8 ++------ .github/workflows/test.yml | 4 +--- Sources/Packages/Sources/Brief/Updater.swift | 6 +++--- .../Sources/SecretAgentKit/SocketController.swift | 6 +++--- Sources/SecretAgent/AppDelegate.swift | 4 ++-- Sources/Secretive/App.swift | 2 +- Sources/Secretive/Views/Views/AgentStatusView.swift | 2 +- 10 files changed, 17 insertions(+), 32 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index bf95a16..fb0f31a 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -11,7 +11,7 @@ on: jobs: analyze: name: Analyze (${{ matrix.language }}) - runs-on: ${{ (matrix.language == 'swift' && 'macos-26') || 'ubuntu-latest' }} + runs-on: ${{ (matrix.language == 'swift' && 'xcode-27') || 'ubuntu-latest' }} permissions: security-events: write packages: read @@ -24,20 +24,15 @@ jobs: include: - language: actions build-mode: none - # Disable this until CodeQL supports Xcode 26 builds. - # - language: swift - # build-mode: manual steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Initialize CodeQL uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} build-mode: ${{ matrix.build-mode }} - if: matrix.build-mode == 'manual' - name: "Select Xcode" - run: sudo xcrun xcode-select -s /Applications/Xcode_26.4.app - if: matrix.build-mode == 'manual' name: "Build" run: xcrun xcodebuild -project Sources/Secretive.xcodeproj -scheme Secretive CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 112f5fb..aea9a4d 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -6,7 +6,7 @@ on: jobs: build: - runs-on: macos-26 + runs-on: xcode-27 permissions: id-token: write contents: write @@ -25,8 +25,6 @@ jobs: APPLE_API_KEY_DATA: ${{ secrets.APPLE_API_KEY_DATA }} APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }} run: ./.github/scripts/signing.sh - - name: Set Environment - run: sudo xcrun xcode-select -s /Applications/Xcode_26.4.app - name: Update Build Number env: RUN_ID: ${{ github.run_id }} diff --git a/.github/workflows/oneoff.yml b/.github/workflows/oneoff.yml index 9b1dbcf..e67b021 100644 --- a/.github/workflows/oneoff.yml +++ b/.github/workflows/oneoff.yml @@ -5,7 +5,7 @@ on: jobs: build: - runs-on: macos-26 + runs-on: xcode-27 permissions: id-token: write contents: write @@ -24,8 +24,6 @@ jobs: APPLE_API_KEY_DATA: ${{ secrets.APPLE_API_KEY_DATA }} APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }} run: ./.github/scripts/signing.sh - - name: Set Environment - run: sudo xcrun xcode-select -s /Applications/Xcode_26.4.app - name: Update Build Number env: RUN_ID: ${{ github.run_id }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a88efe6..8a811de 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,7 +8,7 @@ jobs: test: permissions: contents: read - runs-on: macos-26 + runs-on: xcode-27 timeout-minutes: 10 steps: - uses: actions/checkout@v5 @@ -21,8 +21,6 @@ jobs: APPLE_API_KEY_DATA: ${{ secrets.APPLE_API_KEY_DATA }} APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }} run: ./.github/scripts/signing.sh - - name: Set Environment - run: sudo xcrun xcode-select -s /Applications/Xcode_26.4.app - name: Test run: xcrun xcodebuild -project Sources/Secretive.xcodeproj -scheme PackageTests test # SPM doesn't seem to pick up on the tests currently? @@ -34,7 +32,7 @@ jobs: attestations: write artifact-metadata: write actions: read - runs-on: macos-26 + runs-on: xcode-27 timeout-minutes: 10 steps: - uses: actions/checkout@v5 @@ -47,8 +45,6 @@ jobs: APPLE_API_KEY_DATA: ${{ secrets.APPLE_API_KEY_DATA }} APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }} run: ./.github/scripts/signing.sh - - name: Set Environment - run: sudo xcrun xcode-select -s /Applications/Xcode_26.4.app - name: Update Build Number env: TAG_NAME: ${{ github.ref }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8ec1d21..3866087 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,12 +5,10 @@ jobs: test: permissions: contents: read - runs-on: macos-26 + runs-on: xcode-27 timeout-minutes: 10 steps: - uses: actions/checkout@v5 - - name: Set Environment - run: sudo xcrun xcode-select -s /Applications/Xcode_26.4.app - name: Test Main Packages run: xcrun xcodebuild -project Sources/Secretive.xcodeproj -scheme PackageTests test # SPM doesn't seem to pick up on the tests currently? diff --git a/Sources/Packages/Sources/Brief/Updater.swift b/Sources/Packages/Sources/Brief/Updater.swift index 12be1ee..cbb41fa 100644 --- a/Sources/Packages/Sources/Brief/Updater.swift +++ b/Sources/Packages/Sources/Brief/Updater.swift @@ -34,12 +34,12 @@ import XPCWrappers ) { self.osVersion = osVersion self.currentVersion = currentVersion - Task { + _ = Task { if checkOnLaunch { try await checkForUpdates() } - while !Task.isCancelled { - try? await Task.sleep(for: .seconds(Int(checkFrequency))) + while true { + try await Task.sleep(for: .seconds(Int(checkFrequency))) try await checkForUpdates() } } diff --git a/Sources/Packages/Sources/SecretAgentKit/SocketController.swift b/Sources/Packages/Sources/SecretAgentKit/SocketController.swift index 7839037..43d699f 100644 --- a/Sources/Packages/Sources/SecretAgentKit/SocketController.swift +++ b/Sources/Packages/Sources/SecretAgentKit/SocketController.swift @@ -94,7 +94,7 @@ extension SocketController { guard !data.isEmpty else { logger.debug("Socket controller received empty data, ending continuation.") messagesContinuation.finish() - try fileHandle.close() + try? fileHandle.close() return } messagesContinuation.yield(data) @@ -126,8 +126,8 @@ private extension SocketPort { convenience init(path: String) { var addr = sockaddr_un() - let length = unsafe withUnsafeMutablePointer(to: &addr.sun_path.0) { pointer in - unsafe path.withCString { cstring in + let length = withUnsafeMutablePointer(to: &addr.sun_path.0) { pointer in + path.withCString { cstring in let len = unsafe strlen(cstring) unsafe strncpy(pointer, cstring, len) return len diff --git a/Sources/SecretAgent/AppDelegate.swift b/Sources/SecretAgent/AppDelegate.swift index a3a7507..ce8d06e 100644 --- a/Sources/SecretAgent/AppDelegate.swift +++ b/Sources/SecretAgent/AppDelegate.swift @@ -52,15 +52,15 @@ class AppDelegate: NSObject, NSApplicationDelegate { Task { for await session in socketController.sessions { Task { - let inputParser = try await XPCAgentInputParser() do { + let inputParser = try await XPCAgentInputParser() for await message in session.messages { let request = try await inputParser.parse(data: message) let agentResponse = await agent.handle(request: request, provenance: session.provenance) try session.write(agentResponse) } } catch { - try session.close() + try? session.close() } } } diff --git a/Sources/Secretive/App.swift b/Sources/Secretive/App.swift index fa405d9..202b380 100644 --- a/Sources/Secretive/App.swift +++ b/Sources/Secretive/App.swift @@ -25,7 +25,7 @@ struct Secretive: App { guard !agentLaunchController.developmentBuild else { return } if justUpdatedChecker.justUpdatedBuild || !agentLaunchController.running { // Relaunch the agent, since it'll be running from earlier update still - try await agentLaunchController.forceLaunch() + try? await agentLaunchController.forceLaunch() } } } diff --git a/Sources/Secretive/Views/Views/AgentStatusView.swift b/Sources/Secretive/Views/Views/AgentStatusView.swift index 43c69a1..2313b01 100644 --- a/Sources/Secretive/Views/Views/AgentStatusView.swift +++ b/Sources/Secretive/Views/Views/AgentStatusView.swift @@ -101,7 +101,7 @@ struct AgentNotRunningView: View { guard !loading else { return } loading = true Task { - try await agentLaunchController.forceLaunch() + try? await agentLaunchController.forceLaunch() loading = false if !agentLaunchController.running {