Skip to content

Fix CI: update macOS runner to macos-26, swift-tools-version to 6.2, fix Swift 6.2 async build errors, and replace default code scanning#33

Merged
SureshKViswanathan merged 11 commits intomainfrom
copilot/fix-build-error
Mar 5, 2026
Merged

Fix CI: update macOS runner to macos-26, swift-tools-version to 6.2, fix Swift 6.2 async build errors, and replace default code scanning#33
SureshKViswanathan merged 11 commits intomainfrom
copilot/fix-build-error

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 4, 2026

macos-15 runners ship Xcode 16.x (Swift 6.1). The J2KSwift dependency requires swift-tools-version: 6.2.0, which ships with Xcode 26 on macos-26. Additionally, stale SPM cached packages were causing build failures even after updating the toolchain, and the GitHub default code scanning setup fails because it runs on macos-latest (Swift 6.1) with autobuild.

error: package 'j2kswift' @ fb2e63c is using Swift tools version 6.2.0
       but the installed version is 6.1.0
  • Package.swift: swift-tools-version: 6.0swift-tools-version: 6.2 to match the J2KSwift dependency requirement
  • ci.yml, codeql.yml, release.yml: runs-on: macos-15macos-26, Xcode selection updated from Xcode_16.xXcode_26.x
  • ci.yml, codeql.yml, release.yml: Added swift package purge-cache && swift package reset && swift package update step before every build to clear stale caches and force SPM to fetch the latest commits from branch-based dependencies
  • ci.yml, release.yml: Fixed double-build issue — Build step now uses swift build --build-tests --enable-code-coverage and Test step uses swift test --skip-build so tests run immediately without recompiling. Previously swift test --enable-code-coverage triggered a full rebuild because the Build step compiled without coverage instrumentation, consuming the entire 15-minute timeout on macOS before tests could execute.
  • ci.yml, release.yml: macOS test timeout increased from 15 → 30 minutes as a safety buffer; Linux test timeout remains at 15 minutes
  • ci.yml, release.yml: Added --skip LDAPIntegrationTests to test commands on both Linux and macOS — the NIO mock LDAP server hangs in CI environments (Docker containers and macOS runners)
  • BackupManager.swift, IntegrityScanner.swift, AdminStorageHandler.swift: Fixed Swift 6.2 build error where NSDirectoryEnumerator.makeIterator() is unavailable from async contexts — extracted directory enumeration into nonisolated static helper methods (copyArchive, collectDCMPaths, countDCMFiles) that run in a synchronous context, preserving lazy streaming iteration without loading the entire directory tree into memory
  • codeql.yml: Added analyze-actions job for GitHub Actions language analysis alongside the existing Swift analysis, so the custom workflow fully replaces the GitHub default code scanning setup
  • codeql.yml: Upgraded github/codeql-action from v3 to v4 for consistency with GitHub's current defaults

⚠️ Admin actions required for checks to pass:

  1. Approve workflow runs: Go to the Actions tab → find the pending CI and CodeQL runs → click "Approve and run" (required because bot PRs need maintainer approval before workflows dispatch)
  2. Disable default code scanning: Go to Settings → Code security → Code scanning → disable the "Default setup" for Swift — it runs on macos-latest (Swift 6.1) and conflicts with the custom codeql.yml which handles Swift analysis on macos-26 (Swift 6.2) and Actions analysis on ubuntu-latest

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

…upport

The J2KSwift dependency requires Swift 6.2 (swift-tools-version: 6.2.0),
which ships with Xcode 26. The macos-15 runner only provides Swift 6.1
via Xcode 16.x. Updated all workflows to use the macos-26 runner and
Xcode 26 selection.

Co-authored-by: SureshKViswanathan <257696045+SureshKViswanathan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix error on build process Fix CI: update macOS runner to macos-26 for Swift 6.2 Mar 4, 2026
@SureshKViswanathan
Copy link
Copy Markdown
Contributor

@copilot fix the build issue we need Swift tool version 6.2.0 and above

The J2KSwift dependency requires swift-tools-version 6.2.0. Updated
Package.swift to match this requirement.

Co-authored-by: SureshKViswanathan <257696045+SureshKViswanathan@users.noreply.github.com>
@SureshKViswanathan
Copy link
Copy Markdown
Contributor

@copilot - do not fetch libraries from catch just do new fetch Fetched https://github.com/Raster-Lab/J2KSwift.git from cache (1.59s)
error: package 'j2kswift' @

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 4, 2026

@copilot fix the build issue we need Swift tool version 6.2.0 and above

Updated Package.swift from swift-tools-version: 6.0 to swift-tools-version: 6.2 in commit 10669d3. Combined with the earlier CI runner updates (macos-15macos-26, Xcode 16.x → Xcode 26), the build should now resolve correctly with Swift 6.2.0+.

Copilot AI changed the title Fix CI: update macOS runner to macos-26 for Swift 6.2 Fix CI: update macOS runner to macos-26 and swift-tools-version to 6.2 Mar 4, 2026
…ndency fetches

Co-authored-by: SureshKViswanathan <257696045+SureshKViswanathan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 4, 2026

@copilot - do not fetch libraries from catch just do new fetch Fetched https://github.com/Raster-Lab/J2KSwift.git from cache (1.59s)
error: package 'j2kswift' @

Added swift package purge-cache && swift package reset step before every build in all three workflow files (ci.yml, codeql.yml, release.yml) in commit e55b72a. This forces SPM to fetch fresh dependencies instead of using stale cached packages.

Copilot AI changed the title Fix CI: update macOS runner to macos-26 and swift-tools-version to 6.2 Fix CI: update macOS runner to macos-26, swift-tools-version to 6.2, and reset SPM cache Mar 4, 2026
@SureshKViswanathan
Copy link
Copy Markdown
Contributor

@copilot fix the build issues.

…ace default code scanning

Co-authored-by: SureshKViswanathan <257696045+SureshKViswanathan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 4, 2026

@copilot fix the build issues.

The failing "PR #33" check is the GitHub default code scanning setup, which runs on macos-latest (Swift 6.1) with autobuild — separate from our custom workflows that already use macos-26 (Swift 6.2).

In commit 6861089, I added an Actions language analysis job to our custom codeql.yml so it now fully covers both Swift (on macos-26) and Actions (on ubuntu-latest).

Action needed from you: Disable the default code scanning setup in Settings → Code security → Code scanning since our custom codeql.yml now replaces it entirely. The default setup will keep failing because it uses macos-latest which only has Swift 6.1.

Copilot AI changed the title Fix CI: update macOS runner to macos-26, swift-tools-version to 6.2, and reset SPM cache Fix CI: update macOS runner to macos-26, swift-tools-version to 6.2, and replace default code scanning Mar 4, 2026
@SureshKViswanathan
Copy link
Copy Markdown
Contributor

@copilot - still the build is failing

…defaults

Co-authored-by: SureshKViswanathan <257696045+SureshKViswanathan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 4, 2026

@copilot - still the build is failing

I've investigated all the failing checks. Our code changes are correct — here's what's happening:

1. CI and CodeQL workflows → show action_required with 0 jobs dispatched. This is GitHub's security feature requiring maintainer approval for workflow runs on bot PRs. The workflows haven't run yet.

2. "PR #33" check → this is the GitHub default code scanning (separate from our custom codeql.yml). It runs on macos-latest (Swift 6.1) with autobuild and cannot be fixed through code changes.

The main branch is also broken with the same Swift 6.1 vs 6.2 mismatch — our PR fixes this.

In commit 0b3f29f I also upgraded codeql-action from v3 to v4 for consistency.

Two admin actions needed to unblock:

  1. Approve workflow runs: Go to the Actions tab → find the pending CI and CodeQL runs → click "Approve and run"

  2. Disable default code scanning: Go to Settings → Code security → Code scanning → disable "Default setup" for Swift. Our custom codeql.yml replaces it with Swift analysis on macos-26 (Swift 6.2) and Actions analysis on ubuntu-latest.

@SureshKViswanathan SureshKViswanathan marked this pull request as ready for review March 4, 2026 13:00
@SureshKViswanathan
Copy link
Copy Markdown
Contributor

fix the build issues

@SureshKViswanathan
Copy link
Copy Markdown
Contributor

@copilot fix the build issues

…rror for traced build step

Co-authored-by: SureshKViswanathan <257696045+SureshKViswanathan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 4, 2026

@copilot fix the build issues

I investigated the latest CI logs. There are three separate failing checks:

1. CodeQL Analyze (Swift) job — The swift build was crashing at compile step 166/654 under CodeQL's tracing (likely OOM from tracing overhead). Fixed in 614fc55 by limiting parallelism (-j2) and adding continue-on-error on the traced build step.

2. CI workflow — Shows action_required with 0 jobs. This is GitHub's security requirement for bot PRs — you need to click "Approve and run" in the Actions tab.

3. "PR #33" check (default code scanning) — Runs on macos-latest (Swift 6.1), fails with package 'mayam' is using Swift tools version 6.2.0 but the installed version is 6.1.0. This cannot be fixed through code. You need to disable it in Settings → Code security → Code scanning → Default setup.

Both #2 and #3 require admin action from you.

@SureshKViswanathan
Copy link
Copy Markdown
Contributor

@copilot - fix the build issues on linux its running for a long time and macOS its failing I have fixed the error on library get the latest and work

…odeQL build workaround, add test timeouts

Co-authored-by: SureshKViswanathan <257696045+SureshKViswanathan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 4, 2026

@copilot - fix the build issues on linux its running for a long time and macOS its failing I have fixed the error on library get the latest and work

Fixed in a402ab1. Three changes to address both issues:

  1. macOS build failing (JLSwift SIMDMask.any() error) — Added swift package update to all workflows so SPM fetches the latest commits from your library fixes instead of using stale resolved versions.

  2. Linux tests running too long — Added timeout-minutes: 15 to all test steps. Previously tests ran 26+ minutes before being cancelled.

  3. CodeQL failing — Removed the continue-on-error: true workaround from the build step (it was masking the build failure and causing CodeQL to see no Swift code). With your library fix + swift package update, the build should succeed cleanly.

Note: You still need to click "Approve and run" in the Actions tab for the workflows to execute (GitHub requires maintainer approval for bot PRs).

@SureshKViswanathan
Copy link
Copy Markdown
Contributor

@copilot fix the build issue on macOS

Copilot AI and others added 2 commits March 4, 2026 17:35
…iteration

Co-authored-by: SureshKViswanathan <257696045+SureshKViswanathan@users.noreply.github.com>
…eration, skip LDAP tests on Linux

Co-authored-by: SureshKViswanathan <257696045+SureshKViswanathan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 4, 2026

@copilot fix the build issue on macOS

Fixed in 85c8385.

macOS build fix: Swift 6.2 makes NSDirectoryEnumerator.makeIterator() unavailable from async contexts. Refactored BackupManager.swift, IntegrityScanner.swift, and AdminStorageHandler.swift to use nonisolated static helper methods that wrap the directory enumeration in a synchronous context instead of iterating the enumerator directly in actor methods.

Linux timeout fix: LDAPIntegrationTests hangs on Linux CI due to NIO mock server issues in Docker containers. Added --skip LDAPIntegrationTests to the Linux test command. macOS CI still runs all tests including LDAP integration.

Note: You still need to click "Approve and run" in the Actions tab for the workflows to execute.

Copilot AI changed the title Fix CI: update macOS runner to macos-26, swift-tools-version to 6.2, and replace default code scanning Fix CI: update macOS runner to macos-26, swift-tools-version to 6.2, fix Swift 6.2 async build errors, and replace default code scanning Mar 4, 2026
@SureshKViswanathan
Copy link
Copy Markdown
Contributor

@copilot the build is failing due to Test Cases, I would like to disable long running test cases and failing test cases.

… Build step, use --skip-build in Test step, increase macOS timeout to 30 min, skip LDAPIntegrationTests on macOS

Co-authored-by: SureshKViswanathan <257696045+SureshKViswanathan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 5, 2026

@copilot the build is failing due to Test Cases, I would like to disable long running test cases and failing test cases.

Fixed in ed0596f. The macOS test timeout was caused by a double-build — the Build step compiled without coverage, then swift test --enable-code-coverage triggered a full rebuild that consumed the entire 15-minute timeout before tests could run.

Three changes:

  1. Eliminated double-build — Build step now uses swift build --build-tests --enable-code-coverage, and Test step uses swift test --skip-build so it runs tests immediately without recompiling.
  2. Increased macOS timeout from 15 → 30 minutes as a safety buffer.
  3. Skip LDAPIntegrationTests on macOS (was already skipped on Linux) — these integration tests can hang in CI environments.

Note: You still need to click "Approve and run" in the Actions tab for the workflows to execute.

@SureshKViswanathan SureshKViswanathan merged commit a0f6023 into main Mar 5, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants